@pdf-viewer/react 1.9.0-beta.0 → 1.9.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Popover-1faa77f6.js → Popover-48c8394c.js} +2 -2
- package/dist/{RPLayout-3ef4e136.js → RPLayout-3042ec91.js} +996 -990
- package/dist/{component-1da194e8.js → component-2aa6e53b.js} +1 -1
- package/dist/components/RPConfig.js +691 -673
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +2 -2
- package/dist/components/layout/LayoutContainer.js +2 -2
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/RPLayout.js +2 -2
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +2 -2
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +3 -3
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +1 -1
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +2 -2
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ToolbarCustom.js +2 -2
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +2 -2
- 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 +2 -2
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +2 -2
- package/dist/components/page/AnnotationLayer.js +2 -2
- package/dist/components/page/CanvasLayer.js +2 -2
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +2 -2
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +2 -2
- package/dist/components/page/TextLayer.js +2 -2
- package/dist/components/ui/Checkbox.js +228 -116
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/Popover.js +1 -1
- package/dist/components/ui/RPTooltip.js +207 -207
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/{floating-ui.react-dom-15b9b819.js → floating-ui.react-dom-4b1e2e46.js} +394 -380
- package/dist/index-6e0e48fa.js +332 -0
- package/dist/{index-7279fb4e.js → index-951f0f1f.js} +464 -456
- package/dist/index-e3a67935.js +150 -0
- package/dist/main.js +1 -1
- package/dist/types/utils/types.d.ts +9 -4
- package/dist/utils/hooks/useFileDownload.js +2 -2
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +2 -2
- package/dist/utils/hooks/usePresentPage.js +2 -2
- package/dist/utils/hooks/usePrint.js +2 -2
- package/dist/utils/hooks/useScrollToPage.js +2 -2
- package/dist/utils/hooks/useSearch.js +2 -2
- package/dist/utils/hooks/useThumbnail.js +2 -2
- package/dist/utils/hooks/useVirtualReactWindow.js +2 -2
- package/package.json +1 -1
- package/dist/index-1cb41342.js +0 -307
- package/dist/index-aa2d3884.js +0 -140
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as i, Fragment as ie, jsxs as
|
|
1
|
+
import { jsx as i, Fragment as ie, jsxs as z } from "react/jsx-runtime";
|
|
2
2
|
import * as B from "react";
|
|
3
3
|
import { useRef as H, useEffect as W, useCallback as E, useState as G, useMemo as M, createContext as Qe, useContext as et, forwardRef as We, useImperativeHandle as pn, createElement as Ze, PureComponent as sr, Component as cr, memo as hn } from "react";
|
|
4
4
|
import { useLayoutContainer as se } from "./contexts/LayoutContainerContext.js";
|
|
5
|
-
import { Container as
|
|
6
|
-
import { useViewportContext as Pe, ViewportProvider as
|
|
5
|
+
import { Container as mn } from "./components/layout/Container.js";
|
|
6
|
+
import { useViewportContext as Pe, ViewportProvider as fn } from "./contexts/ViewportContext.js";
|
|
7
7
|
import { c as ne } from "./clsx-0c6e471a.js";
|
|
8
8
|
import { useThemeContext as lr } from "./contexts/ThemeContext.js";
|
|
9
9
|
import { useDocumentContext as X } from "./contexts/RPDocumentContext.js";
|
|
10
10
|
import { useDocumentPasswordContext as dr } from "./contexts/DocumentPasswordContext.js";
|
|
11
|
-
import { ViewMode as Re, ScrollMode as ee, AnnotationSubType as kt, SelectionMode as ur, ZoomLevel as
|
|
11
|
+
import { ViewMode as Re, ScrollMode as ee, AnnotationSubType as kt, SelectionMode as ur, ZoomLevel as ct } from "./utils/types.js";
|
|
12
12
|
import { useScrollModeContext as Ne } from "./contexts/ScrollModeContext.js";
|
|
13
13
|
import { useDarkModeContext as pr } from "./contexts/DarkModeContext.js";
|
|
14
14
|
import "./contexts/RotationContext.js";
|
|
@@ -17,12 +17,12 @@ import { useZoomContext as tt } from "./contexts/ZoomContext.js";
|
|
|
17
17
|
import { useViewModeContext as Ee } from "./contexts/ViewModeContext.js";
|
|
18
18
|
import { useVirtualScrollContext as nt } from "./contexts/VirtualScrollContext.js";
|
|
19
19
|
import { useVirtualGridContext as gn } from "./contexts/VirtualGridContext.js";
|
|
20
|
-
import { useSelectionModeContext as
|
|
21
|
-
import { useInitialStateContext as
|
|
20
|
+
import { useSelectionModeContext as mr } from "./contexts/SelectionModeContext.js";
|
|
21
|
+
import { useInitialStateContext as fr } from "./contexts/InitialStateContext.js";
|
|
22
22
|
import { useFullScreenContext as gr } from "./contexts/FullScreenContext.js";
|
|
23
23
|
import "./contexts/FileInputContext.js";
|
|
24
24
|
import "./contexts/DropFileZoneContext.js";
|
|
25
|
-
import { renderPage as
|
|
25
|
+
import { renderPage as _t } from "./utils/renderPage.js";
|
|
26
26
|
import { findMatches as vr, resetDivs as wr, highlightMatches as _r, isMatchEntireWord as br } from "./utils/highlight.js";
|
|
27
27
|
import { useDimensionPagesContext as Ue } from "./contexts/DimensionPagesContext.js";
|
|
28
28
|
import { useLocalizationContext as ce } from "./contexts/LocalizationContext.js";
|
|
@@ -32,32 +32,32 @@ import { useDownloadContext as Pr } from "./contexts/DownloadContext.js";
|
|
|
32
32
|
import { useSmoothScrollContext as vn } from "./contexts/SmoothScrollContext.js";
|
|
33
33
|
import "./contexts/ElementPageContext.js";
|
|
34
34
|
import { usePagesRotateContext as Ve } from "./contexts/PagesRotateContext.js";
|
|
35
|
-
import { useLoaderContext as
|
|
35
|
+
import { useLoaderContext as Tt } from "./contexts/LoaderContext.js";
|
|
36
36
|
import "./components/RPConfig.js";
|
|
37
37
|
import { ChevronUpIcon as Ge } from "./components/icons/ChevronUpIcon.js";
|
|
38
38
|
import { UIButton as re } from "./components/ui/Button.js";
|
|
39
39
|
import { UIInput as wn } from "./components/ui/Input.js";
|
|
40
40
|
import { useIconContext as he, IconProvider as Tr } from "./contexts/IconContext.js";
|
|
41
|
-
import { useToolbarComponentContext as
|
|
41
|
+
import { useToolbarComponentContext as me, ToolbarComponentProvider as yr } from "./contexts/ToolbarComponentContext.js";
|
|
42
42
|
import K from "./components/ui/RPTooltip.js";
|
|
43
43
|
import { FileUploadTool as _n } from "./components/layout/toolbar/FileUploadTool.js";
|
|
44
44
|
import { DarkModeTool as Sr } from "./components/layout/toolbar/DarkModeTool.js";
|
|
45
45
|
import { ThreeDotIcon as xr } from "./components/icons/ThreeDotIcon.js";
|
|
46
46
|
import { UIDropDown as bn } from "./components/ui/DropDown.js";
|
|
47
|
-
import {
|
|
48
|
-
import { D as Er,
|
|
49
|
-
import { a as Or, u as
|
|
50
|
-
import { h as Fr } from "./component-
|
|
47
|
+
import { c as Ir, u as yt, P as qe, a as $e, b as St, k as Rr, e as Lr, i as Nr } from "./index-6e0e48fa.js";
|
|
48
|
+
import { D as Er, a as lt } from "./index-e3a67935.js";
|
|
49
|
+
import { a as Or, u as Dr, F as zr, b as Ar, G as Ye } from "./index-951f0f1f.js";
|
|
50
|
+
import { h as Fr } from "./component-2aa6e53b.js";
|
|
51
51
|
import { CloseIcon as Wr } from "./components/icons/CloseIcon.js";
|
|
52
52
|
import { dateFormatter as Mt } from "./utils/dateFormatter.js";
|
|
53
|
-
import { LoaderIcon as
|
|
53
|
+
import { LoaderIcon as xt } from "./components/icons/LoaderIcon.js";
|
|
54
54
|
import { useInfiniteScroll as kr } from "./utils/hooks/useInfiniteScroll.js";
|
|
55
55
|
import { RPDropFileZone as Mr } from "./components/RPDropFileZone.js";
|
|
56
56
|
import { c as Q, S as Ht } from "./SearchCloseButton-ddb9877e.js";
|
|
57
57
|
import { UICheckbox as $t } from "./components/ui/Checkbox.js";
|
|
58
|
-
import { _ as Hr, U as $r } from "./Popover-
|
|
58
|
+
import { _ as Hr, U as $r } from "./Popover-48c8394c.js";
|
|
59
59
|
import { MenuItem as Ce } from "./components/layout/toolbar/MenuItem.js";
|
|
60
|
-
import { MenuSeparator as
|
|
60
|
+
import { MenuSeparator as It } from "./components/layout/toolbar/MenuSeparator.js";
|
|
61
61
|
import { useOtherToolContext as Gr, OtherToolProvider as Cn } from "./contexts/OtherToolContext.js";
|
|
62
62
|
import { WrapperLayout as Pn } from "./components/layout/WrapperLayout.js";
|
|
63
63
|
import { PropertyItem as Ur } from "./components/layout/toolbar/PropertyItem.js";
|
|
@@ -82,151 +82,151 @@ import { RPSplitter as ro } from "./components/layout/sidebar/RPSplitter.js";
|
|
|
82
82
|
import * as oo from "pdfjs-dist";
|
|
83
83
|
import { PixelsPerInch as io, AnnotationMode as ao, RenderingCancelledException as so, AnnotationLayer as co } from "pdfjs-dist";
|
|
84
84
|
import { SimpleLinkService as lo } from "./utils/link_service.js";
|
|
85
|
-
import { annotationsEvents as uo, annotationEventsHandler as po, handleClick as Vt, handleAnnotationWidget as ho, handleAnnotationLink as
|
|
85
|
+
import { annotationsEvents as uo, annotationEventsHandler as po, handleClick as Vt, handleAnnotationWidget as ho, handleAnnotationLink as mo, bindLayerEvents as fo, unbindLayerEvents as qt } from "./utils/annotations.js";
|
|
86
86
|
import { normalizeSingleKeyword as go, sortHighlightPosition as vo, unwrap as wo } from "./components/page/searchHighlight.js";
|
|
87
87
|
import { CustomElement as _o } from "./components/page/CustomElement.js";
|
|
88
88
|
import { useMousePressed as bo } from "./utils/hooks/useMousePressed.js";
|
|
89
89
|
import { useGrabScroll as Co } from "./utils/hooks/useGrabScroll.js";
|
|
90
90
|
import { usePinch as Po } from "./utils/hooks/usePinch.js";
|
|
91
|
-
import { useDebounce as
|
|
91
|
+
import { useDebounce as Rt } from "./utils/hooks/useDebounce.js";
|
|
92
92
|
import To from "./components/ui/PasswordModal.js";
|
|
93
93
|
import { getPositionFromPage as yo, getPageFromPosition as So } from "./utils/calculatePage.js";
|
|
94
94
|
import { getScrollDistance as Fe } from "./utils/getScrollDistance.js";
|
|
95
95
|
import { getWordPositionInPage as xo } from "./utils/getWordPositionInPage.js";
|
|
96
96
|
import { getThumbnailViewport as Bt } from "./utils/getThumbnailViewport.js";
|
|
97
|
-
import { smoothScrollTo as
|
|
97
|
+
import { smoothScrollTo as dt } from "./utils/smoothScrollTo.js";
|
|
98
98
|
import { appConsole as Io } from "./utils/appConsole.js";
|
|
99
99
|
import './assets/RPLayout.css';const Sn = () => {
|
|
100
|
-
const { viewMode: e } = Ee(), { scrollMode: t } = Ne(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = nt(), { setFocusedPage: a } = ae(), l = H(), { columnCount: c } = gn(), { widths: d, heights:
|
|
100
|
+
const { viewMode: e } = Ee(), { scrollMode: t } = Ne(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = nt(), { setFocusedPage: a } = ae(), l = H(), { columnCount: c } = gn(), { widths: d, heights: p } = Ue(), m = H(t), v = H(e), h = H(c), { targetScrollPage: w } = vn();
|
|
101
101
|
W(() => {
|
|
102
102
|
n != null && n.scrollToItem && (l.current = n);
|
|
103
103
|
}, [n]), W(() => {
|
|
104
|
-
|
|
104
|
+
m.current = t, v.current = e;
|
|
105
105
|
}, [t, e]);
|
|
106
|
-
const
|
|
107
|
-
(
|
|
106
|
+
const P = E(
|
|
107
|
+
(C, S) => {
|
|
108
108
|
if (!r)
|
|
109
109
|
return;
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
left: d[
|
|
110
|
+
const g = Math.ceil(C / 2) * 2 - 1;
|
|
111
|
+
if (C === g + 1) {
|
|
112
|
+
const f = {
|
|
113
|
+
left: d[g],
|
|
114
114
|
top: 0
|
|
115
115
|
};
|
|
116
116
|
return new Promise(
|
|
117
|
-
(s) =>
|
|
117
|
+
(s) => dt(r, f, s)
|
|
118
118
|
);
|
|
119
119
|
}
|
|
120
|
-
const
|
|
120
|
+
const u = {
|
|
121
121
|
left: 0,
|
|
122
122
|
top: 0
|
|
123
123
|
};
|
|
124
124
|
return r == null ? void 0 : r.scrollTo({
|
|
125
|
-
...
|
|
126
|
-
behavior:
|
|
125
|
+
...u,
|
|
126
|
+
behavior: S
|
|
127
127
|
});
|
|
128
128
|
},
|
|
129
|
-
[r, d,
|
|
129
|
+
[r, d, dt]
|
|
130
130
|
);
|
|
131
131
|
return W(() => {
|
|
132
|
-
|
|
132
|
+
m.current = t, v.current = e;
|
|
133
133
|
}, [t, e]), W(() => {
|
|
134
134
|
h.current = c;
|
|
135
135
|
}, [c]), { scrollToPage: E(
|
|
136
|
-
(
|
|
137
|
-
a(
|
|
138
|
-
const
|
|
139
|
-
let
|
|
140
|
-
if (v.current === Re.DUAL_PAGE &&
|
|
141
|
-
|
|
136
|
+
(C, S = "smooth") => {
|
|
137
|
+
a(C);
|
|
138
|
+
const g = C - 1;
|
|
139
|
+
let u = g, f = 0;
|
|
140
|
+
if (v.current === Re.DUAL_PAGE && m.current === ee.PAGE_SCROLLING) {
|
|
141
|
+
P(C, S);
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
if (
|
|
145
|
-
a(
|
|
144
|
+
if (m.current === ee.PAGE_SCROLLING) {
|
|
145
|
+
a(C);
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
if (!l.current || !o)
|
|
149
149
|
return;
|
|
150
150
|
const s = o;
|
|
151
|
-
if (w.current =
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
left: Fe(d,
|
|
151
|
+
if (w.current = C, m.current === ee.HORIZONTAL_SCROLLING) {
|
|
152
|
+
f = g;
|
|
153
|
+
const T = {
|
|
154
|
+
left: Fe(d, f),
|
|
155
155
|
top: 0
|
|
156
156
|
};
|
|
157
157
|
return s.scrollTo({
|
|
158
|
-
...
|
|
159
|
-
behavior:
|
|
158
|
+
...T,
|
|
159
|
+
behavior: S
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
if (v.current === Re.DUAL_PAGE) {
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
left: Fe(d,
|
|
166
|
-
top: Fe(
|
|
163
|
+
f = g % 2, u = Math.floor(g / 2);
|
|
164
|
+
const T = {
|
|
165
|
+
left: Fe(d, f),
|
|
166
|
+
top: Fe(p, u)
|
|
167
167
|
};
|
|
168
168
|
return s.scrollTo({
|
|
169
|
-
...
|
|
170
|
-
behavior:
|
|
169
|
+
...T,
|
|
170
|
+
behavior: S
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
const _ = {
|
|
174
174
|
left: 0,
|
|
175
|
-
top: Fe(
|
|
175
|
+
top: Fe(p, u)
|
|
176
176
|
};
|
|
177
177
|
return s.scrollTo({
|
|
178
178
|
..._,
|
|
179
|
-
behavior:
|
|
179
|
+
behavior: S
|
|
180
180
|
});
|
|
181
181
|
},
|
|
182
182
|
[
|
|
183
183
|
o,
|
|
184
184
|
c,
|
|
185
|
-
|
|
185
|
+
P,
|
|
186
186
|
a,
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
dt,
|
|
188
|
+
p,
|
|
189
189
|
d
|
|
190
190
|
]
|
|
191
191
|
) };
|
|
192
192
|
}, Ro = (e = 1) => {
|
|
193
|
-
const [t, n] = G(e), [o, r] = G(0), { scrollToPage: a } = Sn(), l = H(1), { viewMode: c } = Ee(), { scrollMode: d } = Ne(), { widths:
|
|
194
|
-
(
|
|
195
|
-
if (!/^[0-9]*$/g.test(
|
|
193
|
+
const [t, n] = G(e), [o, r] = G(0), { scrollToPage: a } = Sn(), l = H(1), { viewMode: c } = Ee(), { scrollMode: d } = Ne(), { widths: p } = Ue(), { pagesRef: m } = se(), v = Rt(t, 100), h = E(
|
|
194
|
+
(u) => {
|
|
195
|
+
if (!/^[0-9]*$/g.test(u.toString()) || !u)
|
|
196
196
|
return { success: !1, currentPage: l.current };
|
|
197
|
-
const s = +
|
|
198
|
-
return s < 0 || s > o ? { success: !1, currentPage: l.current } : (n(s), l.current = s, { success: !0, currentPage: +
|
|
197
|
+
const s = +u;
|
|
198
|
+
return s < 0 || s > o ? { success: !1, currentPage: l.current } : (n(s), l.current = s, { success: !0, currentPage: +u });
|
|
199
199
|
},
|
|
200
200
|
[o]
|
|
201
|
-
), w = E(h, [h]),
|
|
202
|
-
(
|
|
203
|
-
const
|
|
204
|
-
return
|
|
201
|
+
), w = E(h, [h]), P = E(
|
|
202
|
+
(u) => {
|
|
203
|
+
const f = h(u);
|
|
204
|
+
return f.success && a(f.currentPage), f;
|
|
205
205
|
},
|
|
206
206
|
[h, a]
|
|
207
|
-
),
|
|
208
|
-
const
|
|
209
|
-
if (!
|
|
207
|
+
), y = E((u) => {
|
|
208
|
+
const f = u % 2 === 1;
|
|
209
|
+
if (!m || f)
|
|
210
210
|
return !1;
|
|
211
|
-
const s =
|
|
212
|
-
return c === Re.DUAL_PAGE && s + _ <
|
|
213
|
-
}, [c,
|
|
214
|
-
let
|
|
215
|
-
|
|
216
|
-
}, [
|
|
217
|
-
if (
|
|
211
|
+
const s = f ? p[u] : p[u - 1], _ = f ? p[u + 1] : p[u];
|
|
212
|
+
return c === Re.DUAL_PAGE && s + _ < m.clientWidth;
|
|
213
|
+
}, [c, p, m, o]), C = E(() => {
|
|
214
|
+
let u = t - 1;
|
|
215
|
+
y(u) && (u = t - 2), P(u);
|
|
216
|
+
}, [P, t, c, d, y]), S = M(() => c === Re.DUAL_PAGE && d === ee.PAGE_SCROLLING ? t === o - 1 : t === o, [t, o, c, d]), g = E(() => {
|
|
217
|
+
if (S)
|
|
218
218
|
return;
|
|
219
|
-
let
|
|
220
|
-
|
|
221
|
-
}, [
|
|
219
|
+
let u = t + 1;
|
|
220
|
+
y(u) && (u = t + 2), P(u);
|
|
221
|
+
}, [P, t, y, c, d, S]);
|
|
222
222
|
return {
|
|
223
223
|
focusedPage: v,
|
|
224
224
|
totalPages: o,
|
|
225
225
|
setFocusedPage: w,
|
|
226
226
|
setTotalPages: r,
|
|
227
|
-
nextPage:
|
|
228
|
-
prevPage:
|
|
229
|
-
goToPage:
|
|
227
|
+
nextPage: g,
|
|
228
|
+
prevPage: C,
|
|
229
|
+
goToPage: P
|
|
230
230
|
};
|
|
231
231
|
}, xn = Qe({
|
|
232
232
|
focusedPage: 0,
|
|
@@ -243,7 +243,7 @@ import './assets/RPLayout.css';const Sn = () => {
|
|
|
243
243
|
}), ae = () => {
|
|
244
244
|
const e = et(xn);
|
|
245
245
|
return typeof (e == null ? void 0 : e.focusedPage) > "u" && Io.error("Please use this hooks inside children component of RPProvider"), e;
|
|
246
|
-
},
|
|
246
|
+
}, qs = ({ children: e }) => {
|
|
247
247
|
const { pdf: t } = X(), { focusedPage: n, totalPages: o, setFocusedPage: r, setTotalPages: a, goToPage: l, nextPage: c, prevPage: d } = Ro();
|
|
248
248
|
return W(() => {
|
|
249
249
|
t != null && t.numPages && (a(t.numPages), r(1));
|
|
@@ -268,155 +268,155 @@ const Lo = () => {
|
|
|
268
268
|
loadedPages: 0,
|
|
269
269
|
totalPages: 0,
|
|
270
270
|
percentage: 0
|
|
271
|
-
}), [r, a] = G(!1), [l, c] = G(!1), [d,
|
|
271
|
+
}), [r, a] = G(!1), [l, c] = G(!1), [d, p] = G(null), m = H(!1);
|
|
272
272
|
W(() => {
|
|
273
|
-
|
|
274
|
-
}, [
|
|
273
|
+
m.current;
|
|
274
|
+
}, [m]);
|
|
275
275
|
const v = E(() => {
|
|
276
276
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
277
|
-
const
|
|
278
|
-
|
|
277
|
+
const u = document.querySelector(".rp-print-zone");
|
|
278
|
+
u && u.remove();
|
|
279
279
|
}, []), h = E(() => {
|
|
280
|
-
|
|
280
|
+
m.current = !1, a(!1), c(!1), p(null), o({
|
|
281
281
|
loadedPages: 0,
|
|
282
282
|
totalPages: 0,
|
|
283
283
|
percentage: 0
|
|
284
284
|
});
|
|
285
285
|
}, []), w = () => {
|
|
286
|
-
|
|
287
|
-
},
|
|
288
|
-
scratchCanvas:
|
|
289
|
-
pdfDocument:
|
|
286
|
+
m.current = !0;
|
|
287
|
+
}, P = async ({
|
|
288
|
+
scratchCanvas: u,
|
|
289
|
+
pdfDocument: f,
|
|
290
290
|
pageNumber: s,
|
|
291
291
|
viewerPdfPage: _,
|
|
292
|
-
printResolution:
|
|
293
|
-
optionalContentConfigPromise:
|
|
292
|
+
printResolution: b,
|
|
293
|
+
optionalContentConfigPromise: T,
|
|
294
294
|
printAnnotationStoragePromise: L
|
|
295
295
|
}) => {
|
|
296
|
-
if (
|
|
296
|
+
if (m.current) {
|
|
297
297
|
h();
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
|
-
const x =
|
|
301
|
-
|
|
302
|
-
const I =
|
|
303
|
-
I.save(), I.fillStyle = "rgb(255, 255, 255)", I.fillRect(0, 0,
|
|
304
|
-
const [
|
|
305
|
-
|
|
300
|
+
const x = b / io.PDF;
|
|
301
|
+
u.width = Math.floor(_.width * x), u.height = Math.floor(_.height * x);
|
|
302
|
+
const I = u.getContext("2d");
|
|
303
|
+
I.save(), I.fillStyle = "rgb(255, 255, 255)", I.fillRect(0, 0, u.width, u.height), I.restore();
|
|
304
|
+
const [D, A] = await Promise.all([
|
|
305
|
+
f.getPage(s),
|
|
306
306
|
L
|
|
307
307
|
]);
|
|
308
|
-
if (
|
|
308
|
+
if (m.current) {
|
|
309
309
|
h();
|
|
310
310
|
return;
|
|
311
311
|
}
|
|
312
312
|
const F = {
|
|
313
313
|
canvasContext: I,
|
|
314
314
|
transform: [x, 0, 0, x, 0, 0],
|
|
315
|
-
viewport:
|
|
315
|
+
viewport: D.getViewport({ scale: 1, rotation: _.rotation }),
|
|
316
316
|
intent: "print",
|
|
317
317
|
annotationMode: ao.ENABLE_STORAGE,
|
|
318
|
-
optionalContentConfigPromise:
|
|
318
|
+
optionalContentConfigPromise: T,
|
|
319
319
|
printAnnotationStorage: A
|
|
320
320
|
};
|
|
321
321
|
try {
|
|
322
|
-
return
|
|
322
|
+
return D.render(F).promise;
|
|
323
323
|
} catch (R) {
|
|
324
324
|
throw R instanceof so || console.error(R), R;
|
|
325
325
|
}
|
|
326
|
-
},
|
|
327
|
-
const
|
|
328
|
-
return new Promise((
|
|
329
|
-
const s = (
|
|
326
|
+
}, y = E(() => {
|
|
327
|
+
const u = window.print;
|
|
328
|
+
return new Promise((f) => {
|
|
329
|
+
const s = (T) => {
|
|
330
330
|
setTimeout(() => {
|
|
331
|
-
|
|
331
|
+
u.call(window), setTimeout(() => T(), 20);
|
|
332
332
|
}, 0);
|
|
333
333
|
};
|
|
334
334
|
if (document.querySelector(".rp-print-zone")) {
|
|
335
|
-
s(
|
|
335
|
+
s(f);
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
338
|
-
const
|
|
339
|
-
document.querySelector(".rp-print-zone") && (s(
|
|
338
|
+
const b = new MutationObserver(() => {
|
|
339
|
+
document.querySelector(".rp-print-zone") && (s(f), b.disconnect());
|
|
340
340
|
});
|
|
341
|
-
|
|
341
|
+
b.observe(document.body, { childList: !0, subtree: !0 });
|
|
342
342
|
});
|
|
343
|
-
}, []),
|
|
344
|
-
const
|
|
345
|
-
return s.classList.add("rp-print-page"), await new Promise((_,
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
URL.revokeObjectURL(
|
|
349
|
-
},
|
|
343
|
+
}, []), C = async (u) => {
|
|
344
|
+
const f = document.createElement("img"), s = document.createElement("div");
|
|
345
|
+
return s.classList.add("rp-print-page"), await new Promise((_, b) => {
|
|
346
|
+
u.toBlob((T) => {
|
|
347
|
+
T ? (f.src = URL.createObjectURL(T), f.onload = () => {
|
|
348
|
+
URL.revokeObjectURL(f.src), _();
|
|
349
|
+
}, f.onerror = b) : b(new Error("Failed to create blob"));
|
|
350
350
|
});
|
|
351
351
|
}).catch(() => {
|
|
352
|
-
}), s.appendChild(
|
|
353
|
-
},
|
|
352
|
+
}), s.appendChild(f), s;
|
|
353
|
+
}, S = (u, f) => {
|
|
354
354
|
const s = document.createElement("div");
|
|
355
355
|
s.classList.add("rp-print-zone");
|
|
356
|
-
const _ = document.createElement("style"),
|
|
357
|
-
if (
|
|
358
|
-
const { width:
|
|
359
|
-
_.innerHTML = `@page { size: ${
|
|
356
|
+
const _ = document.createElement("style"), b = f.get(1);
|
|
357
|
+
if (b) {
|
|
358
|
+
const { width: T, height: L } = b == null ? void 0 : b.page.getViewport({ scale: 1 });
|
|
359
|
+
_.innerHTML = `@page { size: ${T}px ${L}px }`;
|
|
360
360
|
}
|
|
361
|
-
return s.appendChild(_), s.append(...
|
|
362
|
-
},
|
|
361
|
+
return s.appendChild(_), s.append(...u), s;
|
|
362
|
+
}, g = E(async () => {
|
|
363
363
|
if (!e)
|
|
364
364
|
return;
|
|
365
365
|
h();
|
|
366
|
-
const
|
|
366
|
+
const u = document.createElement("canvas"), f = [];
|
|
367
367
|
try {
|
|
368
368
|
e.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
369
|
-
const _ = e.getOptionalContentConfig({ intent: "print" }),
|
|
369
|
+
const _ = e.getOptionalContentConfig({ intent: "print" }), b = Promise.resolve(
|
|
370
370
|
e.annotationStorage.print ?? void 0
|
|
371
|
-
),
|
|
371
|
+
), T = t.size;
|
|
372
372
|
for (const [x, I] of t) {
|
|
373
|
-
if (
|
|
373
|
+
if (m.current) {
|
|
374
374
|
h();
|
|
375
375
|
return;
|
|
376
376
|
}
|
|
377
|
-
const
|
|
378
|
-
if (await
|
|
379
|
-
scratchCanvas:
|
|
377
|
+
const D = I.page.getViewport({ scale: 1 });
|
|
378
|
+
if (await P({
|
|
379
|
+
scratchCanvas: u,
|
|
380
380
|
pdfDocument: e,
|
|
381
381
|
pageNumber: x,
|
|
382
|
-
viewerPdfPage:
|
|
382
|
+
viewerPdfPage: D,
|
|
383
383
|
printResolution: 150,
|
|
384
384
|
optionalContentConfigPromise: _,
|
|
385
|
-
printAnnotationStoragePromise:
|
|
386
|
-
}),
|
|
385
|
+
printAnnotationStoragePromise: b
|
|
386
|
+
}), m.current) {
|
|
387
387
|
h();
|
|
388
388
|
return;
|
|
389
389
|
}
|
|
390
|
-
const A = await
|
|
391
|
-
|
|
392
|
-
const F = parseFloat((
|
|
390
|
+
const A = await C(u);
|
|
391
|
+
f.push(A);
|
|
392
|
+
const F = parseFloat((f.length / T * 100).toFixed(2));
|
|
393
393
|
o({
|
|
394
394
|
loadedPages: x,
|
|
395
|
-
totalPages:
|
|
395
|
+
totalPages: T,
|
|
396
396
|
percentage: F
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
|
-
if (
|
|
399
|
+
if (m.current) {
|
|
400
400
|
h();
|
|
401
401
|
return;
|
|
402
402
|
}
|
|
403
|
-
const L =
|
|
404
|
-
document.body.appendChild(L), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), a(!0), await
|
|
403
|
+
const L = S(f, t);
|
|
404
|
+
document.body.appendChild(L), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), a(!0), await y();
|
|
405
405
|
} catch (s) {
|
|
406
|
-
c(!0), s instanceof Error &&
|
|
406
|
+
c(!0), s instanceof Error && p(s);
|
|
407
407
|
} finally {
|
|
408
|
-
|
|
408
|
+
u.height = 0, u.width = 0;
|
|
409
409
|
}
|
|
410
|
-
}, [e, t,
|
|
410
|
+
}, [e, t, m]);
|
|
411
411
|
return W(() => {
|
|
412
|
-
const
|
|
412
|
+
const u = () => {
|
|
413
413
|
h(), v();
|
|
414
414
|
};
|
|
415
|
-
return window.addEventListener("afterprint",
|
|
416
|
-
window.removeEventListener("afterprint",
|
|
415
|
+
return window.addEventListener("afterprint", u, !0), () => {
|
|
416
|
+
window.removeEventListener("afterprint", u, !0);
|
|
417
417
|
};
|
|
418
418
|
}, [v, h]), {
|
|
419
|
-
print:
|
|
419
|
+
print: g,
|
|
420
420
|
cancel: w,
|
|
421
421
|
progress: n,
|
|
422
422
|
isComplete: r,
|
|
@@ -440,29 +440,29 @@ const Lo = () => {
|
|
|
440
440
|
console.error("Error in setOnError callback:", t);
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
-
}),
|
|
444
|
-
const [t, n] = G(null), [o, r] = G(null), { print: a, cancel: l, progress: c, isComplete: d, isError:
|
|
445
|
-
|
|
446
|
-
}, []), h = (
|
|
447
|
-
|
|
443
|
+
}), Bs = ({ children: e }) => {
|
|
444
|
+
const [t, n] = G(null), [o, r] = G(null), { print: a, cancel: l, progress: c, isComplete: d, isError: p, error: m } = Lo(), v = E((C) => {
|
|
445
|
+
C && typeof C == "function" && r(() => C);
|
|
446
|
+
}, []), h = (C) => {
|
|
447
|
+
m && C(m);
|
|
448
448
|
}, w = E(
|
|
449
|
-
(
|
|
450
|
-
n(() =>
|
|
449
|
+
(C) => {
|
|
450
|
+
n(() => C);
|
|
451
451
|
},
|
|
452
452
|
[c, t]
|
|
453
453
|
);
|
|
454
454
|
W(() => {
|
|
455
|
-
d && o &&
|
|
455
|
+
d && o && P();
|
|
456
456
|
}, [d, o]), W(() => {
|
|
457
|
-
|
|
458
|
-
console.error(
|
|
457
|
+
p && h((C) => {
|
|
458
|
+
console.error(C);
|
|
459
459
|
});
|
|
460
|
-
}, [
|
|
460
|
+
}, [p]), W(() => {
|
|
461
461
|
c && t && t(c);
|
|
462
462
|
}, [c, t]);
|
|
463
|
-
const
|
|
463
|
+
const P = () => {
|
|
464
464
|
o && (o(), r(null));
|
|
465
|
-
},
|
|
465
|
+
}, y = {
|
|
466
466
|
print: a,
|
|
467
467
|
cancel: l,
|
|
468
468
|
setOnProgress: w,
|
|
@@ -470,7 +470,7 @@ const Lo = () => {
|
|
|
470
470
|
setOnError: h,
|
|
471
471
|
progress: c
|
|
472
472
|
};
|
|
473
|
-
return /* @__PURE__ */ i(In.Provider, { value:
|
|
473
|
+
return /* @__PURE__ */ i(In.Provider, { value: y, children: e });
|
|
474
474
|
}, Be = () => {
|
|
475
475
|
const e = et(In);
|
|
476
476
|
if (!e)
|
|
@@ -490,27 +490,27 @@ const Lo = () => {
|
|
|
490
490
|
viewport: h,
|
|
491
491
|
defaultRotation: v.defaultRotation
|
|
492
492
|
};
|
|
493
|
-
}),
|
|
494
|
-
t(
|
|
495
|
-
const
|
|
493
|
+
}), p = d.reduce((v, h) => (v[h.page.pageNumber] = h, v), {});
|
|
494
|
+
t(p);
|
|
495
|
+
const m = [];
|
|
496
496
|
for (const v of d) {
|
|
497
|
-
const h = document.createElement("canvas"), w =
|
|
497
|
+
const h = document.createElement("canvas"), w = _t(v.page, h, {
|
|
498
498
|
scale: v.scale,
|
|
499
499
|
rotate: v.defaultRotation
|
|
500
500
|
}).promise.then(() => {
|
|
501
|
-
const
|
|
501
|
+
const P = h.toDataURL();
|
|
502
502
|
return {
|
|
503
503
|
...v,
|
|
504
|
-
thumbnailSrc:
|
|
504
|
+
thumbnailSrc: P,
|
|
505
505
|
loading: !1,
|
|
506
506
|
defaultRotation: v.defaultRotation
|
|
507
507
|
};
|
|
508
508
|
});
|
|
509
|
-
|
|
509
|
+
m.push(w);
|
|
510
510
|
}
|
|
511
|
-
Promise.all(
|
|
511
|
+
Promise.all(m).then((v) => {
|
|
512
512
|
const h = v.reduce(
|
|
513
|
-
(w,
|
|
513
|
+
(w, P) => (w[P.page.pageNumber] = P, w),
|
|
514
514
|
{}
|
|
515
515
|
);
|
|
516
516
|
t((w) => ({ ...w, ...h }));
|
|
@@ -529,8 +529,8 @@ const Lo = () => {
|
|
|
529
529
|
const c = n.get(l);
|
|
530
530
|
if (!c)
|
|
531
531
|
return;
|
|
532
|
-
t((
|
|
533
|
-
...
|
|
532
|
+
t((p) => ({
|
|
533
|
+
...p,
|
|
534
534
|
[l]: {
|
|
535
535
|
loading: !0,
|
|
536
536
|
page: c.page,
|
|
@@ -540,21 +540,21 @@ const Lo = () => {
|
|
|
540
540
|
}
|
|
541
541
|
}));
|
|
542
542
|
const d = document.createElement("canvas");
|
|
543
|
-
|
|
543
|
+
_t(c.page, d, {
|
|
544
544
|
scale: c.thumbnailScale,
|
|
545
545
|
rotate: c.defaultRotation
|
|
546
546
|
}).promise.then(() => {
|
|
547
|
-
const
|
|
547
|
+
const p = d.toDataURL(), { thumbnailViewport: m, scale: v } = Bt(c.page);
|
|
548
548
|
return {
|
|
549
549
|
scale: v,
|
|
550
|
-
thumbnailSrc:
|
|
550
|
+
thumbnailSrc: p,
|
|
551
551
|
page: c.page,
|
|
552
552
|
loading: !1,
|
|
553
|
-
viewport:
|
|
553
|
+
viewport: m,
|
|
554
554
|
defaultRotation: c.defaultRotation
|
|
555
555
|
};
|
|
556
|
-
}).then((
|
|
557
|
-
t((
|
|
556
|
+
}).then((p) => {
|
|
557
|
+
t((m) => ({ ...m, [l]: p }));
|
|
558
558
|
});
|
|
559
559
|
},
|
|
560
560
|
[n]
|
|
@@ -570,7 +570,7 @@ const Lo = () => {
|
|
|
570
570
|
setActive: (e) => {
|
|
571
571
|
},
|
|
572
572
|
active: !1
|
|
573
|
-
}),
|
|
573
|
+
}), Lt = () => et(Rn), Zs = ({
|
|
574
574
|
children: e,
|
|
575
575
|
initialThumbnailsVisible: t
|
|
576
576
|
}) => {
|
|
@@ -583,29 +583,29 @@ const Lo = () => {
|
|
|
583
583
|
}
|
|
584
584
|
);
|
|
585
585
|
}, Eo = (e = {}, t = "") => {
|
|
586
|
-
const [n, o] = G(t), [r, a] = G(!1), { pdf: l, pages: c } = X(), { widths: d, heights:
|
|
586
|
+
const [n, o] = G(t), [r, a] = G(!1), { pdf: l, pages: c } = X(), { widths: d, heights: p } = Ue(), m = H(!n), { currentZoom: v } = tt(), [h, w] = G([]), { setFocusedPage: P } = ae(), { columnCount: y } = Ee(), { pageRotate: C } = Ve(), [S, g] = G(0), { pageScrollElementRef: u, virtualScrollableElementRef: f } = nt(), { scrollMode: s } = Ne(), { pagesRef: _ } = se(), [b, T] = G(null), L = H({}), x = M(() => S === 0 ? null : h[S - 1], [S, h]), I = M(() => h.length, [h]);
|
|
587
587
|
W(() => {
|
|
588
588
|
if (!x || !c)
|
|
589
589
|
return;
|
|
590
|
-
const R =
|
|
590
|
+
const R = f || u;
|
|
591
591
|
if (!R || !_)
|
|
592
592
|
return;
|
|
593
593
|
const O = c.get(x.page);
|
|
594
|
-
if (s === ee.PAGE_SCROLLING &&
|
|
594
|
+
if (s === ee.PAGE_SCROLLING && P(x.page), !O)
|
|
595
595
|
return;
|
|
596
596
|
let N = 0, k = 0;
|
|
597
597
|
if (s === ee.VERTICAL_SCROLLING) {
|
|
598
|
-
const ue = x.page - 1, J =
|
|
599
|
-
N = Fe(
|
|
598
|
+
const ue = x.page - 1, J = y, ke = ue % J, _e = Math.floor(ue / J);
|
|
599
|
+
N = Fe(p, _e), k = Fe(d, ke);
|
|
600
600
|
}
|
|
601
601
|
s === ee.HORIZONTAL_SCROLLING && (k = d.slice(0, x.page - 1).reduce((ue, J) => ue + J, 0));
|
|
602
602
|
const $ = {
|
|
603
|
-
height:
|
|
603
|
+
height: p[x.page - 1],
|
|
604
604
|
width: d[x.page - 1]
|
|
605
605
|
}, Z = {
|
|
606
606
|
top: $.height / 2,
|
|
607
607
|
left: $.width / 2
|
|
608
|
-
}, j =
|
|
608
|
+
}, j = C[x.page], { leftInPage: q, topInPage: te } = xo(
|
|
609
609
|
$,
|
|
610
610
|
Z,
|
|
611
611
|
x.rect,
|
|
@@ -621,25 +621,25 @@ const Lo = () => {
|
|
|
621
621
|
});
|
|
622
622
|
}, [
|
|
623
623
|
c,
|
|
624
|
-
|
|
624
|
+
P,
|
|
625
625
|
d,
|
|
626
|
-
|
|
626
|
+
p,
|
|
627
627
|
x,
|
|
628
628
|
s,
|
|
629
|
-
|
|
630
|
-
|
|
629
|
+
f,
|
|
630
|
+
u,
|
|
631
631
|
_
|
|
632
632
|
]);
|
|
633
|
-
const
|
|
634
|
-
|
|
633
|
+
const D = E(() => {
|
|
634
|
+
g((R) => I ? R + 1 > I ? 1 : R + 1 : 0);
|
|
635
635
|
}, [I]), A = E(() => {
|
|
636
|
-
|
|
636
|
+
g((R) => I ? R - 1 <= 0 ? I : R - 1 : 0);
|
|
637
637
|
}, [I]), F = E(async (R) => {
|
|
638
638
|
if (!R)
|
|
639
639
|
return {};
|
|
640
640
|
const O = R.numPages, N = {};
|
|
641
641
|
for (let k = 1; k <= O; k++) {
|
|
642
|
-
if (
|
|
642
|
+
if (m.current)
|
|
643
643
|
throw "close pop over";
|
|
644
644
|
const $ = await R.getPage(k);
|
|
645
645
|
N[k.toString()] = await $.getTextContent();
|
|
@@ -648,10 +648,10 @@ const Lo = () => {
|
|
|
648
648
|
}, []);
|
|
649
649
|
return W(() => {
|
|
650
650
|
if (!n) {
|
|
651
|
-
|
|
651
|
+
m.current = !0, w([]), g(0);
|
|
652
652
|
return;
|
|
653
653
|
}
|
|
654
|
-
|
|
654
|
+
m.current = !1, a(!0), w([]), g(0), F(l).then((R) => {
|
|
655
655
|
L.current = R;
|
|
656
656
|
const N = Object.keys(R).reduce((k, $) => {
|
|
657
657
|
const Z = vr(
|
|
@@ -662,9 +662,9 @@ const Lo = () => {
|
|
|
662
662
|
).map((j, q) => ({ ...j, page: Number($), pageMatchIdx: q }));
|
|
663
663
|
return [...k, ...Z];
|
|
664
664
|
}, []);
|
|
665
|
-
w(N),
|
|
665
|
+
w(N), g(N.length ? 1 : 0);
|
|
666
666
|
}).catch(() => {
|
|
667
|
-
w([]),
|
|
667
|
+
w([]), g(0);
|
|
668
668
|
}).finally(() => a(!1));
|
|
669
669
|
}, [n, F, l, e]), {
|
|
670
670
|
search: n,
|
|
@@ -672,12 +672,12 @@ const Lo = () => {
|
|
|
672
672
|
loading: r,
|
|
673
673
|
matches: h,
|
|
674
674
|
totalMatches: I,
|
|
675
|
-
currentMatchPosition:
|
|
675
|
+
currentMatchPosition: S,
|
|
676
676
|
currentMatch: x,
|
|
677
|
-
nextMatch:
|
|
677
|
+
nextMatch: D,
|
|
678
678
|
prevMatch: A,
|
|
679
|
-
currentMatchElement:
|
|
680
|
-
setCurrentMatchElement:
|
|
679
|
+
currentMatchElement: b,
|
|
680
|
+
setCurrentMatchElement: T
|
|
681
681
|
};
|
|
682
682
|
}, Ln = Qe({
|
|
683
683
|
search: "",
|
|
@@ -697,7 +697,7 @@ const Lo = () => {
|
|
|
697
697
|
currentMatchElement: null,
|
|
698
698
|
setCurrentMatchElement: (e) => {
|
|
699
699
|
}
|
|
700
|
-
}),
|
|
700
|
+
}), js = ({
|
|
701
701
|
children: e,
|
|
702
702
|
initialSearch: t
|
|
703
703
|
}) => {
|
|
@@ -707,12 +707,12 @@ const Lo = () => {
|
|
|
707
707
|
totalMatches: l,
|
|
708
708
|
currentMatchPosition: c,
|
|
709
709
|
currentMatch: d,
|
|
710
|
-
search:
|
|
711
|
-
matches:
|
|
710
|
+
search: p,
|
|
711
|
+
matches: m,
|
|
712
712
|
nextMatch: v,
|
|
713
713
|
prevMatch: h,
|
|
714
714
|
currentMatchElement: w,
|
|
715
|
-
setCurrentMatchElement:
|
|
715
|
+
setCurrentMatchElement: P
|
|
716
716
|
} = Eo(n, t);
|
|
717
717
|
return /* @__PURE__ */ i(
|
|
718
718
|
Ln.Provider,
|
|
@@ -727,15 +727,15 @@ const Lo = () => {
|
|
|
727
727
|
currentMatch: d,
|
|
728
728
|
nextMatch: v,
|
|
729
729
|
prevMatch: h,
|
|
730
|
-
search:
|
|
731
|
-
matches:
|
|
730
|
+
search: p,
|
|
731
|
+
matches: m,
|
|
732
732
|
currentMatchElement: w,
|
|
733
|
-
setCurrentMatchElement:
|
|
733
|
+
setCurrentMatchElement: P
|
|
734
734
|
},
|
|
735
735
|
children: e
|
|
736
736
|
}
|
|
737
737
|
);
|
|
738
|
-
},
|
|
738
|
+
}, Nt = () => et(Ln), pe = {
|
|
739
739
|
"rp-pages": "_rp-pages_17t6t_1",
|
|
740
740
|
"rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_17t6t_7",
|
|
741
741
|
"rp-pages-container": "_rp-pages-container_17t6t_11",
|
|
@@ -744,7 +744,7 @@ const Lo = () => {
|
|
|
744
744
|
"rp-cursor-grab": "_rp-cursor-grab_17t6t_58",
|
|
745
745
|
"rp-cursor-grabbing": "_rp-cursor-grabbing_17t6t_66",
|
|
746
746
|
"rp-loader": "_rp-loader_17t6t_74"
|
|
747
|
-
},
|
|
747
|
+
}, ut = {
|
|
748
748
|
"rp-page-wrapper": "_rp-page-wrapper_14ohm_1",
|
|
749
749
|
"rp-page": "_rp-page_14ohm_1",
|
|
750
750
|
"rp-loader-wrapper": "_rp-loader-wrapper_14ohm_15"
|
|
@@ -753,181 +753,181 @@ const Lo = () => {
|
|
|
753
753
|
return W(() => {
|
|
754
754
|
if (!a || d === 0)
|
|
755
755
|
return;
|
|
756
|
-
const
|
|
757
|
-
if (r.current &&
|
|
758
|
-
const
|
|
759
|
-
|
|
756
|
+
const p = a.get(t);
|
|
757
|
+
if (r.current && p) {
|
|
758
|
+
const m = r.current;
|
|
759
|
+
m.hidden = !0;
|
|
760
760
|
const v = c.current;
|
|
761
|
-
v && v.cancel(), o && o(), c.current =
|
|
761
|
+
v && v.cancel(), o && o(), c.current = _t(p.page, m, {
|
|
762
762
|
scale: d,
|
|
763
763
|
rotate: l[t],
|
|
764
764
|
renderForms: !0
|
|
765
765
|
}), c.current.promise.then(() => {
|
|
766
|
-
|
|
766
|
+
m.hidden = !1;
|
|
767
767
|
}).catch(() => {
|
|
768
768
|
}).finally(() => {
|
|
769
769
|
n && n();
|
|
770
770
|
});
|
|
771
771
|
}
|
|
772
772
|
return () => {
|
|
773
|
-
var
|
|
774
|
-
(
|
|
773
|
+
var m;
|
|
774
|
+
(m = c.current) == null || m.cancel();
|
|
775
775
|
};
|
|
776
776
|
}, [a, t, l, d, o, n]), /* @__PURE__ */ i("canvas", { "data-rp": `page-${t}-canvas`, ref: r });
|
|
777
|
-
},
|
|
777
|
+
}, Do = "_selecting_usdup_9", fe = {
|
|
778
778
|
"rp-text-layer": "_rp-text-layer_usdup_1",
|
|
779
|
-
selecting:
|
|
779
|
+
selecting: Do,
|
|
780
780
|
"rp-text-layer-text": "_rp-text-layer-text_usdup_39"
|
|
781
|
-
},
|
|
782
|
-
const { pageNumber: t } = e, { pages: n } = X(), o = H(null), { matches: r, currentMatch: a, setCurrentMatchElement: l } =
|
|
781
|
+
}, zo = (e) => {
|
|
782
|
+
const { pageNumber: t } = e, { pages: n } = X(), o = H(null), { matches: r, currentMatch: a, setCurrentMatchElement: l } = Nt(), [c, d] = G(
|
|
783
783
|
[]
|
|
784
|
-
),
|
|
785
|
-
(
|
|
786
|
-
if (s && wr(
|
|
784
|
+
), p = H(), m = H(), v = H([]), h = M(() => r.filter((u) => u.pageIndex === t - 1), [r, t]), w = E(
|
|
785
|
+
(u, f, s = !1) => {
|
|
786
|
+
if (s && wr(u, f), !h.length) {
|
|
787
787
|
v.current = [], d([]);
|
|
788
788
|
return;
|
|
789
789
|
}
|
|
790
|
-
const _ = _r(h,
|
|
790
|
+
const _ = _r(h, u, f);
|
|
791
791
|
d(_);
|
|
792
792
|
},
|
|
793
793
|
[h]
|
|
794
|
-
),
|
|
794
|
+
), P = H(), y = H(!1), C = E(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
|
|
795
795
|
W(() => ((() => {
|
|
796
|
-
if (
|
|
796
|
+
if (P.current)
|
|
797
797
|
return;
|
|
798
|
-
|
|
799
|
-
const { signal:
|
|
800
|
-
|
|
801
|
-
const
|
|
802
|
-
|
|
798
|
+
P.current = new AbortController();
|
|
799
|
+
const { signal: f } = P.current, s = () => {
|
|
800
|
+
C().forEach((b) => {
|
|
801
|
+
const T = b.querySelector(".endOfContent");
|
|
802
|
+
T && (b.appendChild(T), T.style.width = "", T.style.height = "", b.classList.remove(fe.selecting));
|
|
803
803
|
});
|
|
804
804
|
};
|
|
805
805
|
document.addEventListener(
|
|
806
806
|
"pointerdown",
|
|
807
807
|
() => {
|
|
808
|
-
|
|
808
|
+
y.current = !0;
|
|
809
809
|
},
|
|
810
|
-
{ signal:
|
|
810
|
+
{ signal: f }
|
|
811
811
|
), document.addEventListener(
|
|
812
812
|
"pointerup",
|
|
813
813
|
() => {
|
|
814
|
-
|
|
814
|
+
y.current = !1, s();
|
|
815
815
|
},
|
|
816
|
-
{ signal:
|
|
816
|
+
{ signal: f }
|
|
817
817
|
), window.addEventListener(
|
|
818
818
|
"blur",
|
|
819
819
|
() => {
|
|
820
|
-
|
|
820
|
+
y.current = !1, s();
|
|
821
821
|
},
|
|
822
|
-
{ signal:
|
|
822
|
+
{ signal: f }
|
|
823
823
|
), document.addEventListener(
|
|
824
824
|
"keyup",
|
|
825
825
|
() => {
|
|
826
|
-
|
|
826
|
+
y.current || s();
|
|
827
827
|
},
|
|
828
|
-
{ signal:
|
|
828
|
+
{ signal: f }
|
|
829
829
|
);
|
|
830
830
|
let _ = null;
|
|
831
831
|
document.addEventListener(
|
|
832
832
|
"selectionchange",
|
|
833
833
|
() => {
|
|
834
834
|
var F, R;
|
|
835
|
-
const
|
|
836
|
-
if (!
|
|
835
|
+
const b = document.getSelection();
|
|
836
|
+
if (!b)
|
|
837
837
|
return;
|
|
838
|
-
if (
|
|
838
|
+
if (b.rangeCount === 0) {
|
|
839
839
|
s();
|
|
840
840
|
return;
|
|
841
841
|
}
|
|
842
|
-
const
|
|
843
|
-
for (let O = 0; O <
|
|
844
|
-
const N =
|
|
845
|
-
|
|
846
|
-
N.intersectsNode(k) && !
|
|
842
|
+
const T = /* @__PURE__ */ new Set();
|
|
843
|
+
for (let O = 0; O < b.rangeCount; O++) {
|
|
844
|
+
const N = b.getRangeAt(O);
|
|
845
|
+
C().forEach((k) => {
|
|
846
|
+
N.intersectsNode(k) && !T.has(k) && T.add(k);
|
|
847
847
|
});
|
|
848
848
|
}
|
|
849
|
-
|
|
850
|
-
if (
|
|
851
|
-
O.classList.add(
|
|
849
|
+
C().forEach((O) => {
|
|
850
|
+
if (T.has(O))
|
|
851
|
+
O.classList.add(fe.selecting);
|
|
852
852
|
else {
|
|
853
853
|
const N = O.querySelector(".endOfContent");
|
|
854
|
-
N && (O.appendChild(N), N.style.width = "", N.style.height = "", O.classList.remove(
|
|
854
|
+
N && (O.appendChild(N), N.style.width = "", N.style.height = "", O.classList.remove(fe.selecting));
|
|
855
855
|
}
|
|
856
856
|
});
|
|
857
|
-
const L =
|
|
857
|
+
const L = b.getRangeAt(0);
|
|
858
858
|
let I = _ && (L.compareBoundaryPoints(Range.END_TO_END, _) === 0 || L.compareBoundaryPoints(Range.START_TO_END, _) === 0) ? L.startContainer : L.endContainer;
|
|
859
859
|
I.nodeType === Node.TEXT_NODE && (I = I.parentNode);
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
), A =
|
|
863
|
-
A &&
|
|
860
|
+
const D = (F = I.parentElement) == null ? void 0 : F.closest(
|
|
861
|
+
fe["rp-text-layer"]
|
|
862
|
+
), A = D == null ? void 0 : D.querySelector(".endOfContent");
|
|
863
|
+
A && D && (A.style.width = D.style.width, A.style.height = D.style.height, (R = I.parentElement) == null || R.insertBefore(A, I.nextSibling)), _ = L.cloneRange();
|
|
864
864
|
},
|
|
865
|
-
{ signal:
|
|
865
|
+
{ signal: f }
|
|
866
866
|
);
|
|
867
867
|
})(), () => {
|
|
868
|
-
var
|
|
869
|
-
(
|
|
870
|
-
}), [
|
|
871
|
-
const
|
|
872
|
-
o.current && o.current.classList.add(
|
|
873
|
-
}, []),
|
|
874
|
-
o.current && o.current.classList.remove(
|
|
868
|
+
var f;
|
|
869
|
+
(f = P.current) == null || f.abort(), P.current = void 0;
|
|
870
|
+
}), [C]);
|
|
871
|
+
const S = E(() => {
|
|
872
|
+
o.current && o.current.classList.add(fe.selecting);
|
|
873
|
+
}, []), g = E(() => {
|
|
874
|
+
o.current && o.current.classList.remove(fe.selecting);
|
|
875
875
|
}, []);
|
|
876
876
|
return W(() => {
|
|
877
877
|
if (v.current.forEach((s) => {
|
|
878
878
|
s.classList.remove("selected");
|
|
879
879
|
}), !c.length || !a || a.pageIndex !== t - 1)
|
|
880
880
|
return;
|
|
881
|
-
const
|
|
881
|
+
const u = h.findIndex(
|
|
882
882
|
(s) => JSON.stringify(s) === JSON.stringify(a)
|
|
883
883
|
);
|
|
884
|
-
if (
|
|
884
|
+
if (u === -1)
|
|
885
885
|
return;
|
|
886
|
-
const
|
|
887
|
-
|
|
886
|
+
const f = c.filter((s) => s.index === u);
|
|
887
|
+
f.length && (v.current = f.map((s) => s.element), l(f[0].element), f.forEach((s) => {
|
|
888
888
|
s.element.classList.add("selected");
|
|
889
889
|
}));
|
|
890
890
|
}, [a, c, h]), W(() => {
|
|
891
|
-
const
|
|
892
|
-
if (!
|
|
891
|
+
const u = n.get(t);
|
|
892
|
+
if (!u || !o.current)
|
|
893
893
|
return;
|
|
894
|
-
const
|
|
895
|
-
return
|
|
896
|
-
const _ =
|
|
897
|
-
return
|
|
894
|
+
const f = o.current;
|
|
895
|
+
return p.current && p.current.cancel(), u.page.getTextContent().then((s) => {
|
|
896
|
+
const _ = u.page.getViewport({ scale: 1 });
|
|
897
|
+
return p.current = new oo.TextLayer({
|
|
898
898
|
viewport: _,
|
|
899
899
|
textContentSource: s,
|
|
900
|
-
container:
|
|
901
|
-
}),
|
|
900
|
+
container: f
|
|
901
|
+
}), m.current = s, f && (f.innerText = ""), p.current.render();
|
|
902
902
|
}).then(() => {
|
|
903
|
-
var
|
|
904
|
-
[].slice.call(
|
|
905
|
-
x.classList.add(
|
|
903
|
+
var T, L;
|
|
904
|
+
[].slice.call(f.children).forEach((x) => {
|
|
905
|
+
x.classList.add(fe["rp-text-layer-text"]), x.setAttribute("data-rp", "rp-text-layer-text");
|
|
906
906
|
});
|
|
907
|
-
const _ = (
|
|
908
|
-
_ &&
|
|
909
|
-
const
|
|
910
|
-
|
|
907
|
+
const _ = (T = p.current) == null ? void 0 : T.textDivs;
|
|
908
|
+
_ && m.current && w(m.current, _);
|
|
909
|
+
const b = document.createElement("div");
|
|
910
|
+
b.className = "endOfContent", (L = o.current) == null || L.appendChild(b);
|
|
911
911
|
}).catch(() => {
|
|
912
912
|
}), () => {
|
|
913
913
|
var s;
|
|
914
|
-
(s =
|
|
914
|
+
(s = p.current) == null || s.cancel();
|
|
915
915
|
};
|
|
916
916
|
}, [n, t]), W(() => {
|
|
917
917
|
var s;
|
|
918
918
|
[].slice.call(o.current.children).forEach((_) => {
|
|
919
|
-
_.classList.add(
|
|
919
|
+
_.classList.add(fe["rp-text-layer-text"]);
|
|
920
920
|
});
|
|
921
|
-
const
|
|
922
|
-
|
|
921
|
+
const f = (s = p.current) == null ? void 0 : s.textDivs;
|
|
922
|
+
f && m.current && w(m.current, f, !0);
|
|
923
923
|
}, [w]), /* @__PURE__ */ i(
|
|
924
924
|
"div",
|
|
925
925
|
{
|
|
926
926
|
"data-rp": `page-${t}-textLayer`,
|
|
927
|
-
className:
|
|
927
|
+
className: fe["rp-text-layer"],
|
|
928
928
|
ref: o,
|
|
929
|
-
onMouseDown:
|
|
930
|
-
onMouseUp:
|
|
929
|
+
onMouseDown: S,
|
|
930
|
+
onMouseUp: g
|
|
931
931
|
}
|
|
932
932
|
);
|
|
933
933
|
}, Ao = {
|
|
@@ -935,46 +935,46 @@ const Lo = () => {
|
|
|
935
935
|
};
|
|
936
936
|
let Fo = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
937
937
|
const Wo = (e) => {
|
|
938
|
-
const { pageNumber: t } = e, n = H(null), { pages: o, pdf: r } = X(), a = H(), [l, c] = G(), { setFocusedPage: d, goToPage:
|
|
938
|
+
const { pageNumber: t } = e, n = H(null), { pages: o, pdf: r } = X(), a = H(), [l, c] = G(), { setFocusedPage: d, goToPage: p } = ae(), { scrollMode: m } = Ne(), { print: v } = Be(), { download: h } = Zn(), w = M(() => o.get(t), [o, t]), P = M(() => w == null ? void 0 : w.page.getViewport(), [w]);
|
|
939
939
|
W(() => {
|
|
940
940
|
a.current && (a.current.div.replaceChildren(), a.current = void 0);
|
|
941
941
|
}, [r]), W(() => {
|
|
942
|
-
w && w.page.getAnnotations().then((
|
|
943
|
-
a.current = void 0, c(
|
|
942
|
+
w && w.page.getAnnotations().then((C) => {
|
|
943
|
+
a.current = void 0, c(C), n.current && (n.current.innerText = "");
|
|
944
944
|
});
|
|
945
945
|
}, [w]);
|
|
946
|
-
const
|
|
947
|
-
(
|
|
948
|
-
!l || !r || (uo(
|
|
949
|
-
var
|
|
950
|
-
((
|
|
951
|
-
}),
|
|
946
|
+
const y = E(
|
|
947
|
+
(C) => {
|
|
948
|
+
!l || !r || (uo(C), po(C, r, l).then((S) => {
|
|
949
|
+
var g, u;
|
|
950
|
+
((g = S == null ? void 0 : S.data) == null ? void 0 : g.action) === "Print" ? v() : ((u = S == null ? void 0 : S.data) == null ? void 0 : u.action) === "SaveAs" && h();
|
|
951
|
+
}), m === ee.PAGE_SCROLLING ? Vt(C, l, r, (S) => d(S.pageIndex + 1)) : Vt(C, l, r, (S) => p(S.pageIndex + 1)));
|
|
952
952
|
},
|
|
953
|
-
[r, l,
|
|
953
|
+
[r, l, p, d, m, v, h]
|
|
954
954
|
);
|
|
955
955
|
return W(() => {
|
|
956
956
|
if (!w || !l)
|
|
957
957
|
return;
|
|
958
|
-
const
|
|
958
|
+
const C = w.page.getViewport();
|
|
959
959
|
if (a.current) {
|
|
960
960
|
a.current.update({
|
|
961
|
-
viewport:
|
|
961
|
+
viewport: C.clone({ dontFlip: !0 })
|
|
962
962
|
});
|
|
963
963
|
return;
|
|
964
964
|
}
|
|
965
|
-
const
|
|
966
|
-
for (const
|
|
967
|
-
const { annotationType: s } =
|
|
965
|
+
const S = /* @__PURE__ */ new Map([]);
|
|
966
|
+
for (const f of l) {
|
|
967
|
+
const { annotationType: s } = f;
|
|
968
968
|
switch (s) {
|
|
969
969
|
case kt.Link:
|
|
970
|
-
|
|
970
|
+
mo(f);
|
|
971
971
|
break;
|
|
972
972
|
case kt.Widget:
|
|
973
|
-
ho(
|
|
973
|
+
ho(f, C, S);
|
|
974
974
|
break;
|
|
975
975
|
}
|
|
976
976
|
}
|
|
977
|
-
const
|
|
977
|
+
const g = new AbortController();
|
|
978
978
|
return (async () => {
|
|
979
979
|
var _;
|
|
980
980
|
a.current && (a.current.div.replaceChildren(), a.current = void 0), n.current && (n.current.innerText = ""), a.current = new co({
|
|
@@ -984,18 +984,18 @@ const Wo = (e) => {
|
|
|
984
984
|
annotationEditorUIManager: void 0,
|
|
985
985
|
structTreeLayer: null,
|
|
986
986
|
page: w.page,
|
|
987
|
-
viewport:
|
|
988
|
-
}), n.current && qt(n.current,
|
|
989
|
-
const
|
|
990
|
-
if (
|
|
987
|
+
viewport: C.clone({ dontFlip: !0 })
|
|
988
|
+
}), n.current && qt(n.current, y);
|
|
989
|
+
const f = await (r == null ? void 0 : r.hasJSActions()), s = await (r == null ? void 0 : r.getFieldObjects());
|
|
990
|
+
if (g.signal.aborted)
|
|
991
991
|
throw "abort";
|
|
992
992
|
return (_ = a.current) == null ? void 0 : _.render({
|
|
993
993
|
annotations: l,
|
|
994
994
|
annotationStorage: r == null ? void 0 : r.annotationStorage,
|
|
995
|
-
hasJSActions:
|
|
995
|
+
hasJSActions: f,
|
|
996
996
|
fieldObjects: s,
|
|
997
997
|
div: n.current,
|
|
998
|
-
viewport:
|
|
998
|
+
viewport: C.clone({ dontFlip: !0 }),
|
|
999
999
|
page: w.page,
|
|
1000
1000
|
imageResourcesPath: Fo,
|
|
1001
1001
|
renderForms: !0,
|
|
@@ -1004,18 +1004,18 @@ const Wo = (e) => {
|
|
|
1004
1004
|
enableScripting: !1
|
|
1005
1005
|
});
|
|
1006
1006
|
})().then(() => {
|
|
1007
|
-
n.current &&
|
|
1008
|
-
}).catch((
|
|
1009
|
-
if (
|
|
1010
|
-
throw
|
|
1007
|
+
n.current && fo(n.current, y);
|
|
1008
|
+
}).catch((f) => {
|
|
1009
|
+
if (f !== "abort")
|
|
1010
|
+
throw f;
|
|
1011
1011
|
}), () => {
|
|
1012
|
-
|
|
1012
|
+
g.abort("clear"), n.current && qt(n.current, y);
|
|
1013
1013
|
};
|
|
1014
|
-
}, [r, l,
|
|
1014
|
+
}, [r, l, y]), /* @__PURE__ */ i(
|
|
1015
1015
|
"div",
|
|
1016
1016
|
{
|
|
1017
1017
|
"data-rp": `page-${t}-annotationLayer`,
|
|
1018
|
-
style: { width: `${
|
|
1018
|
+
style: { width: `${P == null ? void 0 : P.width}px`, height: `${P == null ? void 0 : P.height}px` },
|
|
1019
1019
|
className: Ao["rp-annotation-layer"],
|
|
1020
1020
|
ref: n
|
|
1021
1021
|
}
|
|
@@ -1023,72 +1023,72 @@ const Wo = (e) => {
|
|
|
1023
1023
|
}, ko = {
|
|
1024
1024
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1025
1025
|
}, Mo = ({ pageNumber: e, viewport: t }) => {
|
|
1026
|
-
const [n, o] = G(), { pages: r } = X(), { highlightKeywords: a } = Cr(), l = !0, c = H(null), [d,
|
|
1026
|
+
const [n, o] = G(), { pages: r } = X(), { highlightKeywords: a } = Cr(), l = !0, c = H(null), [d, p] = G(null), [m, v] = G([]);
|
|
1027
1027
|
W(() => {
|
|
1028
|
-
c.current &&
|
|
1028
|
+
c.current && p(c.current.parentElement);
|
|
1029
1029
|
}, [c]), W(() => {
|
|
1030
1030
|
(async () => {
|
|
1031
|
-
const
|
|
1032
|
-
if (!
|
|
1031
|
+
const u = r.get(e);
|
|
1032
|
+
if (!u || !c.current)
|
|
1033
1033
|
return;
|
|
1034
|
-
const
|
|
1035
|
-
o(
|
|
1034
|
+
const f = await u.page.getTextContent();
|
|
1035
|
+
o(f);
|
|
1036
1036
|
})();
|
|
1037
1037
|
}, [r, e]);
|
|
1038
|
-
const h = M(() => a ? a.map((
|
|
1039
|
-
var
|
|
1038
|
+
const h = M(() => a ? a.map((g) => {
|
|
1039
|
+
var u, f;
|
|
1040
1040
|
return {
|
|
1041
|
-
...go(
|
|
1042
|
-
color:
|
|
1041
|
+
...go(g.keyword, (u = g.options) == null ? void 0 : u.matchCase, (f = g.options) == null ? void 0 : f.wholeWords),
|
|
1042
|
+
color: g.highlightColor
|
|
1043
1043
|
};
|
|
1044
1044
|
}) : [], [a]);
|
|
1045
|
-
function w(
|
|
1046
|
-
if (!
|
|
1045
|
+
function w(g, u) {
|
|
1046
|
+
if (!g)
|
|
1047
1047
|
return;
|
|
1048
|
-
const
|
|
1048
|
+
const f = `[data-rp="page-${u}-textLayer"]`;
|
|
1049
1049
|
return new Promise((s) => {
|
|
1050
|
-
const _ =
|
|
1050
|
+
const _ = g.querySelector(f);
|
|
1051
1051
|
if (_) {
|
|
1052
1052
|
s(_);
|
|
1053
1053
|
return;
|
|
1054
1054
|
}
|
|
1055
|
-
new MutationObserver((
|
|
1056
|
-
const x =
|
|
1055
|
+
new MutationObserver((T, L) => {
|
|
1056
|
+
const x = g.querySelector(f);
|
|
1057
1057
|
x && (s(x), L.disconnect());
|
|
1058
|
-
}).observe(
|
|
1058
|
+
}).observe(g, { childList: !0, subtree: !0 });
|
|
1059
1059
|
});
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1062
|
-
return new Promise((
|
|
1063
|
-
const
|
|
1061
|
+
function P(g) {
|
|
1062
|
+
return new Promise((u) => {
|
|
1063
|
+
const f = g.querySelectorAll(
|
|
1064
1064
|
'[data-rp="rp-text-layer-text"]'
|
|
1065
1065
|
);
|
|
1066
|
-
if (
|
|
1067
|
-
|
|
1066
|
+
if (f.length) {
|
|
1067
|
+
u(Array.from(f));
|
|
1068
1068
|
return;
|
|
1069
1069
|
}
|
|
1070
|
-
new MutationObserver((_,
|
|
1071
|
-
const
|
|
1070
|
+
new MutationObserver((_, b) => {
|
|
1071
|
+
const T = g.querySelectorAll(
|
|
1072
1072
|
".rp-text-layer-text"
|
|
1073
1073
|
);
|
|
1074
|
-
|
|
1075
|
-
}).observe(
|
|
1074
|
+
T.length && (u(Array.from(T)), b.disconnect());
|
|
1075
|
+
}).observe(g, { childList: !0, subtree: !0 });
|
|
1076
1076
|
});
|
|
1077
1077
|
}
|
|
1078
|
-
const
|
|
1078
|
+
const y = (g, u, f, s) => {
|
|
1079
1079
|
var Z;
|
|
1080
|
-
const _ = document.createRange(),
|
|
1081
|
-
if (!
|
|
1080
|
+
const _ = document.createRange(), b = f.firstChild;
|
|
1081
|
+
if (!b || b.nodeType !== Node.TEXT_NODE)
|
|
1082
1082
|
return null;
|
|
1083
|
-
const
|
|
1084
|
-
if (L >
|
|
1083
|
+
const T = ((Z = b.textContent) == null ? void 0 : Z.length) ?? 0, L = s[0].charIdxInSpan, x = s.length === 1 ? L : s[s.length - 1].charIdxInSpan;
|
|
1084
|
+
if (L > T || x + 1 > T)
|
|
1085
1085
|
return null;
|
|
1086
|
-
_.setStart(
|
|
1086
|
+
_.setStart(b, L), _.setEnd(b, x + 1);
|
|
1087
1087
|
const I = document.createElement("span");
|
|
1088
1088
|
I.style.width = "auto", _.surroundContents(I);
|
|
1089
|
-
const
|
|
1089
|
+
const D = I.getBoundingClientRect(), A = g.getBoundingClientRect(), F = A.height, R = A.width, O = 100 * (D.left - A.left) / R, N = 100 * (D.top - A.top) / F, k = 100 * D.height / F, $ = 100 * D.width / R;
|
|
1090
1090
|
return wo(I), {
|
|
1091
|
-
keywordStr:
|
|
1091
|
+
keywordStr: u,
|
|
1092
1092
|
left: O,
|
|
1093
1093
|
top: N,
|
|
1094
1094
|
height: k,
|
|
@@ -1097,17 +1097,17 @@ const Wo = (e) => {
|
|
|
1097
1097
|
pageWidth: R
|
|
1098
1098
|
};
|
|
1099
1099
|
};
|
|
1100
|
-
async function
|
|
1101
|
-
const
|
|
1102
|
-
if (!
|
|
1100
|
+
async function C(g, u) {
|
|
1101
|
+
const f = await w(d, g);
|
|
1102
|
+
if (!f)
|
|
1103
1103
|
return;
|
|
1104
|
-
const s = await
|
|
1104
|
+
const s = await P(f);
|
|
1105
1105
|
if (s.length) {
|
|
1106
|
-
const _ = s.map((
|
|
1107
|
-
(
|
|
1108
|
-
L.split("").map((I,
|
|
1106
|
+
const _ = s.map((T) => T.tagName === "BR" ? " " : T.textContent).reduce(
|
|
1107
|
+
(T, L, x) => T.concat(
|
|
1108
|
+
L.split("").map((I, D) => ({
|
|
1109
1109
|
char: I,
|
|
1110
|
-
charIdxInSpan:
|
|
1110
|
+
charIdxInSpan: D,
|
|
1111
1111
|
spanIdx: x
|
|
1112
1112
|
}))
|
|
1113
1113
|
),
|
|
@@ -1118,24 +1118,24 @@ const Wo = (e) => {
|
|
|
1118
1118
|
spanIdx: 0
|
|
1119
1119
|
}
|
|
1120
1120
|
]
|
|
1121
|
-
).slice(1),
|
|
1122
|
-
v(
|
|
1121
|
+
).slice(1), b = S(f, u, s, _);
|
|
1122
|
+
v(b);
|
|
1123
1123
|
}
|
|
1124
1124
|
}
|
|
1125
|
-
const
|
|
1126
|
-
const _ =
|
|
1125
|
+
const S = (g, u, f, s) => {
|
|
1126
|
+
const _ = u.length;
|
|
1127
1127
|
if (!s.length || !_)
|
|
1128
1128
|
return [];
|
|
1129
|
-
const
|
|
1129
|
+
const b = [], T = s.map((L) => L.char).join("");
|
|
1130
1130
|
return h.forEach((L) => {
|
|
1131
|
-
const { keyword: x, regExp: I, wholeWords:
|
|
1131
|
+
const { keyword: x, regExp: I, wholeWords: D, color: A } = L, F = x;
|
|
1132
1132
|
if (!F.trim())
|
|
1133
1133
|
return;
|
|
1134
1134
|
const R = I.flags.indexOf("g") === -1 ? new RegExp(I, `${I.flags}g`) : I;
|
|
1135
1135
|
let O;
|
|
1136
1136
|
const N = [];
|
|
1137
|
-
for (; (O = R.exec(
|
|
1138
|
-
|
|
1137
|
+
for (; (O = R.exec(T)) !== null; )
|
|
1138
|
+
D && !br(T, O.index, O[0].length) || N.push({
|
|
1139
1139
|
keyword: R,
|
|
1140
1140
|
startIndex: O.index,
|
|
1141
1141
|
endIndex: R.lastIndex
|
|
@@ -1152,63 +1152,63 @@ const Wo = (e) => {
|
|
|
1152
1152
|
);
|
|
1153
1153
|
for (const j of Object.values(Z))
|
|
1154
1154
|
if (j.length !== 1 || j[0].char.trim() !== "") {
|
|
1155
|
-
const q = j, te =
|
|
1156
|
-
|
|
1155
|
+
const q = j, te = f[q[0].spanIdx], Y = y(
|
|
1156
|
+
g,
|
|
1157
1157
|
F,
|
|
1158
1158
|
te,
|
|
1159
1159
|
q
|
|
1160
1160
|
);
|
|
1161
1161
|
if (Y) {
|
|
1162
1162
|
const { left: de, top: we } = Y;
|
|
1163
|
-
if (
|
|
1163
|
+
if (b.find((J) => J.left === de && J.top === we))
|
|
1164
1164
|
continue;
|
|
1165
|
-
|
|
1165
|
+
b.push({ ...Y, highlightColor: $.color });
|
|
1166
1166
|
}
|
|
1167
1167
|
}
|
|
1168
1168
|
}
|
|
1169
|
-
}),
|
|
1169
|
+
}), b.sort(vo), b;
|
|
1170
1170
|
};
|
|
1171
1171
|
return W(() => {
|
|
1172
1172
|
(async () => {
|
|
1173
1173
|
if (!(!a || a.length === 0))
|
|
1174
1174
|
try {
|
|
1175
|
-
await
|
|
1176
|
-
} catch (
|
|
1177
|
-
console.error(
|
|
1175
|
+
await C(e, a);
|
|
1176
|
+
} catch (u) {
|
|
1177
|
+
console.error(u);
|
|
1178
1178
|
}
|
|
1179
1179
|
})();
|
|
1180
|
-
}, [l, a, e, n, t]), /* @__PURE__ */ i(ie, { children: /* @__PURE__ */ i("div", { ref: c, "data-rp": `page-${e}-textHighlightLayer`, children:
|
|
1180
|
+
}, [l, a, e, n, t]), /* @__PURE__ */ i(ie, { children: /* @__PURE__ */ i("div", { ref: c, "data-rp": `page-${e}-textHighlightLayer`, children: m.map((g, u) => /* @__PURE__ */ i(
|
|
1181
1181
|
"div",
|
|
1182
1182
|
{
|
|
1183
1183
|
className: ko["rp-text-highlight"],
|
|
1184
1184
|
style: {
|
|
1185
|
-
top: `${
|
|
1186
|
-
left: `${
|
|
1187
|
-
width: `${
|
|
1188
|
-
height: `${
|
|
1189
|
-
backgroundColor:
|
|
1185
|
+
top: `${g.top}%`,
|
|
1186
|
+
left: `${g.left}%`,
|
|
1187
|
+
width: `${g.width}%`,
|
|
1188
|
+
height: `${g.height}%`,
|
|
1189
|
+
backgroundColor: g.highlightColor
|
|
1190
1190
|
}
|
|
1191
1191
|
},
|
|
1192
|
-
|
|
1192
|
+
u
|
|
1193
1193
|
)) }) });
|
|
1194
|
-
},
|
|
1195
|
-
const { pageNumber: n, style: o, ...r } = e, { pages: a } = X(), { pageRotate: l } = Ve(), { textLayer: c } = hr(), { currentZoom: d } = tt(),
|
|
1194
|
+
}, Et = We((e, t) => {
|
|
1195
|
+
const { pageNumber: n, style: o, ...r } = e, { pages: a } = X(), { pageRotate: l } = Ve(), { textLayer: c } = hr(), { currentZoom: d } = tt(), p = H(a.get(n)), [m, v] = G(!1), h = H(null), [w, P] = G({
|
|
1196
1196
|
width: 0,
|
|
1197
1197
|
height: 0
|
|
1198
1198
|
});
|
|
1199
1199
|
pn(t, () => h.current);
|
|
1200
|
-
const
|
|
1200
|
+
const y = M(() => p.current ? l[n] : 0, [n, l]);
|
|
1201
1201
|
W(() => {
|
|
1202
|
-
if (a && (
|
|
1203
|
-
const
|
|
1202
|
+
if (a && (p.current = a.get(n), p.current)) {
|
|
1203
|
+
const u = p.current.page.getViewport({
|
|
1204
1204
|
scale: d,
|
|
1205
|
-
rotation:
|
|
1205
|
+
rotation: y
|
|
1206
1206
|
});
|
|
1207
|
-
|
|
1207
|
+
P(u);
|
|
1208
1208
|
}
|
|
1209
|
-
}, [a, n,
|
|
1210
|
-
const
|
|
1211
|
-
switch (
|
|
1209
|
+
}, [a, n, y, d]);
|
|
1210
|
+
const C = M(() => {
|
|
1211
|
+
switch (y) {
|
|
1212
1212
|
case 90:
|
|
1213
1213
|
return `${w.width / 2}px ${w.width / 2}px`;
|
|
1214
1214
|
case -90:
|
|
@@ -1217,9 +1217,9 @@ const Wo = (e) => {
|
|
|
1217
1217
|
default:
|
|
1218
1218
|
return "center";
|
|
1219
1219
|
}
|
|
1220
|
-
}, [
|
|
1220
|
+
}, [y, w]), S = E(() => {
|
|
1221
1221
|
v(!0);
|
|
1222
|
-
}, []),
|
|
1222
|
+
}, []), g = E(() => {
|
|
1223
1223
|
v(!1);
|
|
1224
1224
|
}, []);
|
|
1225
1225
|
return /* @__PURE__ */ i(
|
|
@@ -1231,24 +1231,24 @@ const Wo = (e) => {
|
|
|
1231
1231
|
...r,
|
|
1232
1232
|
style: {
|
|
1233
1233
|
...o,
|
|
1234
|
-
"--rp-rotate": `${
|
|
1235
|
-
"--rp-page-rotate-translate": `${
|
|
1234
|
+
"--rp-rotate": `${y}deg`,
|
|
1235
|
+
"--rp-page-rotate-translate": `${C}`,
|
|
1236
1236
|
"--scale-factor": d
|
|
1237
1237
|
},
|
|
1238
|
-
className:
|
|
1239
|
-
children: /* @__PURE__ */
|
|
1238
|
+
className: ut["rp-page-wrapper"],
|
|
1239
|
+
children: /* @__PURE__ */ z(
|
|
1240
1240
|
"div",
|
|
1241
1241
|
{
|
|
1242
1242
|
style: {
|
|
1243
1243
|
width: `${w.width}px`,
|
|
1244
1244
|
height: `${w.height}px`
|
|
1245
1245
|
},
|
|
1246
|
-
className:
|
|
1246
|
+
className: ut["rp-page"],
|
|
1247
1247
|
children: [
|
|
1248
|
-
/* @__PURE__ */ i(Oo, { onLoading:
|
|
1249
|
-
|
|
1248
|
+
/* @__PURE__ */ i(Oo, { onLoading: S, onLoaded: g, pageNumber: n }),
|
|
1249
|
+
m && /* @__PURE__ */ i("div", { className: ut["rp-loader-wrapper"], children: /* @__PURE__ */ i(xt, {}) }),
|
|
1250
1250
|
/* @__PURE__ */ i(_o, { pageNumber: n }),
|
|
1251
|
-
c && /* @__PURE__ */ i(
|
|
1251
|
+
c && /* @__PURE__ */ i(zo, { pageNumber: n }),
|
|
1252
1252
|
/* @__PURE__ */ i(Mo, { pageNumber: n, viewport: w }),
|
|
1253
1253
|
/* @__PURE__ */ i(Wo, { pageNumber: n })
|
|
1254
1254
|
]
|
|
@@ -1262,13 +1262,13 @@ function Zt(e) {
|
|
|
1262
1262
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1263
1263
|
return e;
|
|
1264
1264
|
}
|
|
1265
|
-
function
|
|
1266
|
-
return
|
|
1265
|
+
function bt(e, t) {
|
|
1266
|
+
return bt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, o) {
|
|
1267
1267
|
return n.__proto__ = o, n;
|
|
1268
|
-
},
|
|
1268
|
+
}, bt(e, t);
|
|
1269
1269
|
}
|
|
1270
1270
|
function Ho(e, t) {
|
|
1271
|
-
e.prototype = Object.create(t.prototype), e.prototype.constructor = e,
|
|
1271
|
+
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, bt(e, t);
|
|
1272
1272
|
}
|
|
1273
1273
|
var jt = Number.isNaN || function(t) {
|
|
1274
1274
|
return typeof t == "number" && t !== t;
|
|
@@ -1284,7 +1284,7 @@ function Go(e, t) {
|
|
|
1284
1284
|
return !1;
|
|
1285
1285
|
return !0;
|
|
1286
1286
|
}
|
|
1287
|
-
function
|
|
1287
|
+
function pt(e, t) {
|
|
1288
1288
|
t === void 0 && (t = Go);
|
|
1289
1289
|
var n, o = [], r, a = !1;
|
|
1290
1290
|
function l() {
|
|
@@ -1324,13 +1324,13 @@ function Vo(e, t) {
|
|
|
1324
1324
|
};
|
|
1325
1325
|
return r;
|
|
1326
1326
|
}
|
|
1327
|
-
var
|
|
1327
|
+
var ht = -1;
|
|
1328
1328
|
function qo(e) {
|
|
1329
|
-
if (e === void 0 && (e = !1),
|
|
1329
|
+
if (e === void 0 && (e = !1), ht === -1 || e) {
|
|
1330
1330
|
var t = document.createElement("div"), n = t.style;
|
|
1331
|
-
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t),
|
|
1331
|
+
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), ht = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
1332
1332
|
}
|
|
1333
|
-
return
|
|
1333
|
+
return ht;
|
|
1334
1334
|
}
|
|
1335
1335
|
var Oe = null;
|
|
1336
1336
|
function Jt(e) {
|
|
@@ -1350,12 +1350,12 @@ var Bo = 150, Zo = function(t) {
|
|
|
1350
1350
|
}, je = null, Ke = null, Xe = null;
|
|
1351
1351
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (je = /* @__PURE__ */ new WeakSet(), Ke = /* @__PURE__ */ new WeakSet(), Xe = /* @__PURE__ */ new WeakSet());
|
|
1352
1352
|
function jo(e) {
|
|
1353
|
-
var t, n = e.getColumnOffset, o = e.getColumnStartIndexForOffset, r = e.getColumnStopIndexForStartIndex, a = e.getColumnWidth, l = e.getEstimatedTotalHeight, c = e.getEstimatedTotalWidth, d = e.getOffsetForColumnAndAlignment,
|
|
1354
|
-
return t = /* @__PURE__ */ function(
|
|
1355
|
-
Ho(
|
|
1356
|
-
function
|
|
1353
|
+
var t, n = e.getColumnOffset, o = e.getColumnStartIndexForOffset, r = e.getColumnStopIndexForStartIndex, a = e.getColumnWidth, l = e.getEstimatedTotalHeight, c = e.getEstimatedTotalWidth, d = e.getOffsetForColumnAndAlignment, p = e.getOffsetForRowAndAlignment, m = e.getRowHeight, v = e.getRowOffset, h = e.getRowStartIndexForOffset, w = e.getRowStopIndexForStartIndex, P = e.initInstanceProps, y = e.shouldResetStyleCacheOnItemSizeChange, C = e.validateProps;
|
|
1354
|
+
return t = /* @__PURE__ */ function(S) {
|
|
1355
|
+
Ho(g, S);
|
|
1356
|
+
function g(f) {
|
|
1357
1357
|
var s;
|
|
1358
|
-
return s =
|
|
1358
|
+
return s = S.call(this, f) || this, s._instanceProps = P(s.props, Zt(s)), s._resetIsScrollingTimeoutId = null, s._outerRef = void 0, s.state = {
|
|
1359
1359
|
instance: Zt(s),
|
|
1360
1360
|
isScrolling: !1,
|
|
1361
1361
|
horizontalScrollDirection: "forward",
|
|
@@ -1363,45 +1363,45 @@ function jo(e) {
|
|
|
1363
1363
|
scrollTop: typeof s.props.initialScrollTop == "number" ? s.props.initialScrollTop : 0,
|
|
1364
1364
|
scrollUpdateWasRequested: !1,
|
|
1365
1365
|
verticalScrollDirection: "forward"
|
|
1366
|
-
}, s._callOnItemsRendered = void 0, s._callOnItemsRendered =
|
|
1366
|
+
}, s._callOnItemsRendered = void 0, s._callOnItemsRendered = pt(function(_, b, T, L, x, I, D, A) {
|
|
1367
1367
|
return s.props.onItemsRendered({
|
|
1368
1368
|
overscanColumnStartIndex: _,
|
|
1369
|
-
overscanColumnStopIndex:
|
|
1370
|
-
overscanRowStartIndex:
|
|
1369
|
+
overscanColumnStopIndex: b,
|
|
1370
|
+
overscanRowStartIndex: T,
|
|
1371
1371
|
overscanRowStopIndex: L,
|
|
1372
1372
|
visibleColumnStartIndex: x,
|
|
1373
1373
|
visibleColumnStopIndex: I,
|
|
1374
|
-
visibleRowStartIndex:
|
|
1374
|
+
visibleRowStartIndex: D,
|
|
1375
1375
|
visibleRowStopIndex: A
|
|
1376
1376
|
});
|
|
1377
|
-
}), s._callOnScroll = void 0, s._callOnScroll =
|
|
1377
|
+
}), s._callOnScroll = void 0, s._callOnScroll = pt(function(_, b, T, L, x) {
|
|
1378
1378
|
return s.props.onScroll({
|
|
1379
|
-
horizontalScrollDirection:
|
|
1379
|
+
horizontalScrollDirection: T,
|
|
1380
1380
|
scrollLeft: _,
|
|
1381
|
-
scrollTop:
|
|
1381
|
+
scrollTop: b,
|
|
1382
1382
|
verticalScrollDirection: L,
|
|
1383
1383
|
scrollUpdateWasRequested: x
|
|
1384
1384
|
});
|
|
1385
|
-
}), s._getItemStyle = void 0, s._getItemStyle = function(_,
|
|
1386
|
-
var
|
|
1387
|
-
if (
|
|
1388
|
-
F =
|
|
1385
|
+
}), s._getItemStyle = void 0, s._getItemStyle = function(_, b) {
|
|
1386
|
+
var T = s.props, L = T.columnWidth, x = T.direction, I = T.rowHeight, D = s._getItemStyleCache(y && L, y && x, y && I), A = _ + ":" + b, F;
|
|
1387
|
+
if (D.hasOwnProperty(A))
|
|
1388
|
+
F = D[A];
|
|
1389
1389
|
else {
|
|
1390
|
-
var R = n(s.props,
|
|
1391
|
-
|
|
1390
|
+
var R = n(s.props, b, s._instanceProps), O = x === "rtl";
|
|
1391
|
+
D[A] = F = {
|
|
1392
1392
|
position: "absolute",
|
|
1393
1393
|
left: O ? void 0 : R,
|
|
1394
1394
|
right: O ? R : void 0,
|
|
1395
1395
|
top: v(s.props, _, s._instanceProps),
|
|
1396
|
-
height:
|
|
1397
|
-
width: a(s.props,
|
|
1396
|
+
height: m(s.props, _, s._instanceProps),
|
|
1397
|
+
width: a(s.props, b, s._instanceProps)
|
|
1398
1398
|
};
|
|
1399
1399
|
}
|
|
1400
1400
|
return F;
|
|
1401
|
-
}, s._getItemStyleCache = void 0, s._getItemStyleCache =
|
|
1401
|
+
}, s._getItemStyleCache = void 0, s._getItemStyleCache = pt(function(_, b, T) {
|
|
1402
1402
|
return {};
|
|
1403
1403
|
}), s._onScroll = function(_) {
|
|
1404
|
-
var
|
|
1404
|
+
var b = _.currentTarget, T = b.clientHeight, L = b.clientWidth, x = b.scrollLeft, I = b.scrollTop, D = b.scrollHeight, A = b.scrollWidth;
|
|
1405
1405
|
s.setState(function(F) {
|
|
1406
1406
|
if (F.scrollLeft === x && F.scrollTop === I)
|
|
1407
1407
|
return null;
|
|
@@ -1416,7 +1416,7 @@ function jo(e) {
|
|
|
1416
1416
|
break;
|
|
1417
1417
|
}
|
|
1418
1418
|
O = Math.max(0, Math.min(O, A - L));
|
|
1419
|
-
var N = Math.max(0, Math.min(I,
|
|
1419
|
+
var N = Math.max(0, Math.min(I, D - T));
|
|
1420
1420
|
return {
|
|
1421
1421
|
isScrolling: !0,
|
|
1422
1422
|
horizontalScrollDirection: F.scrollLeft < x ? "forward" : "backward",
|
|
@@ -1427,8 +1427,8 @@ function jo(e) {
|
|
|
1427
1427
|
};
|
|
1428
1428
|
}, s._resetIsScrollingDebounced);
|
|
1429
1429
|
}, s._outerRefSetter = function(_) {
|
|
1430
|
-
var
|
|
1431
|
-
s._outerRef = _, typeof
|
|
1430
|
+
var b = s.props.outerRef;
|
|
1431
|
+
s._outerRef = _, typeof b == "function" ? b(_) : b != null && typeof b == "object" && b.hasOwnProperty("current") && (b.current = _);
|
|
1432
1432
|
}, s._resetIsScrollingDebounced = function() {
|
|
1433
1433
|
s._resetIsScrollingTimeoutId !== null && Yt(s._resetIsScrollingTimeoutId), s._resetIsScrollingTimeoutId = Vo(s._resetIsScrolling, Bo);
|
|
1434
1434
|
}, s._resetIsScrolling = function() {
|
|
@@ -1439,63 +1439,63 @@ function jo(e) {
|
|
|
1439
1439
|
});
|
|
1440
1440
|
}, s;
|
|
1441
1441
|
}
|
|
1442
|
-
|
|
1443
|
-
return Ko(s, _),
|
|
1442
|
+
g.getDerivedStateFromProps = function(s, _) {
|
|
1443
|
+
return Ko(s, _), C(s), null;
|
|
1444
1444
|
};
|
|
1445
|
-
var
|
|
1446
|
-
return
|
|
1447
|
-
var _ = s.scrollLeft,
|
|
1448
|
-
_ !== void 0 && (_ = Math.max(0, _)),
|
|
1449
|
-
return _ === void 0 && (_ =
|
|
1450
|
-
horizontalScrollDirection:
|
|
1445
|
+
var u = g.prototype;
|
|
1446
|
+
return u.scrollTo = function(s) {
|
|
1447
|
+
var _ = s.scrollLeft, b = s.scrollTop;
|
|
1448
|
+
_ !== void 0 && (_ = Math.max(0, _)), b !== void 0 && (b = Math.max(0, b)), this.setState(function(T) {
|
|
1449
|
+
return _ === void 0 && (_ = T.scrollLeft), b === void 0 && (b = T.scrollTop), T.scrollLeft === _ && T.scrollTop === b ? null : {
|
|
1450
|
+
horizontalScrollDirection: T.scrollLeft < _ ? "forward" : "backward",
|
|
1451
1451
|
scrollLeft: _,
|
|
1452
|
-
scrollTop:
|
|
1452
|
+
scrollTop: b,
|
|
1453
1453
|
scrollUpdateWasRequested: !0,
|
|
1454
|
-
verticalScrollDirection:
|
|
1454
|
+
verticalScrollDirection: T.scrollTop < b ? "forward" : "backward"
|
|
1455
1455
|
};
|
|
1456
1456
|
}, this._resetIsScrollingDebounced);
|
|
1457
|
-
},
|
|
1458
|
-
var _ = s.align,
|
|
1459
|
-
|
|
1460
|
-
var $ = l(this.props, this._instanceProps), Z = c(this.props, this._instanceProps), j = Z > F ? k : 0, q = $ >
|
|
1457
|
+
}, u.scrollToItem = function(s) {
|
|
1458
|
+
var _ = s.align, b = _ === void 0 ? "auto" : _, T = s.columnIndex, L = s.rowIndex, x = this.props, I = x.columnCount, D = x.height, A = x.rowCount, F = x.width, R = this.state, O = R.scrollLeft, N = R.scrollTop, k = qo();
|
|
1459
|
+
T !== void 0 && (T = Math.max(0, Math.min(T, I - 1))), L !== void 0 && (L = Math.max(0, Math.min(L, A - 1)));
|
|
1460
|
+
var $ = l(this.props, this._instanceProps), Z = c(this.props, this._instanceProps), j = Z > F ? k : 0, q = $ > D ? k : 0;
|
|
1461
1461
|
this.scrollTo({
|
|
1462
|
-
scrollLeft:
|
|
1463
|
-
scrollTop: L !== void 0 ?
|
|
1462
|
+
scrollLeft: T !== void 0 ? d(this.props, T, b, O, this._instanceProps, q) : O,
|
|
1463
|
+
scrollTop: L !== void 0 ? p(this.props, L, b, N, this._instanceProps, j) : N
|
|
1464
1464
|
});
|
|
1465
|
-
},
|
|
1466
|
-
var s = this.props, _ = s.initialScrollLeft,
|
|
1465
|
+
}, u.componentDidMount = function() {
|
|
1466
|
+
var s = this.props, _ = s.initialScrollLeft, b = s.initialScrollTop;
|
|
1467
1467
|
if (this._outerRef != null) {
|
|
1468
|
-
var
|
|
1469
|
-
typeof _ == "number" && (
|
|
1468
|
+
var T = this._outerRef;
|
|
1469
|
+
typeof _ == "number" && (T.scrollLeft = _), typeof b == "number" && (T.scrollTop = b);
|
|
1470
1470
|
}
|
|
1471
1471
|
this._callPropsCallbacks();
|
|
1472
|
-
},
|
|
1473
|
-
var s = this.props.direction, _ = this.state,
|
|
1472
|
+
}, u.componentDidUpdate = function() {
|
|
1473
|
+
var s = this.props.direction, _ = this.state, b = _.scrollLeft, T = _.scrollTop, L = _.scrollUpdateWasRequested;
|
|
1474
1474
|
if (L && this._outerRef != null) {
|
|
1475
1475
|
var x = this._outerRef;
|
|
1476
1476
|
if (s === "rtl")
|
|
1477
1477
|
switch (Jt()) {
|
|
1478
1478
|
case "negative":
|
|
1479
|
-
x.scrollLeft = -
|
|
1479
|
+
x.scrollLeft = -b;
|
|
1480
1480
|
break;
|
|
1481
1481
|
case "positive-ascending":
|
|
1482
|
-
x.scrollLeft =
|
|
1482
|
+
x.scrollLeft = b;
|
|
1483
1483
|
break;
|
|
1484
1484
|
default:
|
|
1485
|
-
var I = x.clientWidth,
|
|
1486
|
-
x.scrollLeft =
|
|
1485
|
+
var I = x.clientWidth, D = x.scrollWidth;
|
|
1486
|
+
x.scrollLeft = D - I - b;
|
|
1487
1487
|
break;
|
|
1488
1488
|
}
|
|
1489
1489
|
else
|
|
1490
|
-
x.scrollLeft = Math.max(0,
|
|
1491
|
-
x.scrollTop = Math.max(0,
|
|
1490
|
+
x.scrollLeft = Math.max(0, b);
|
|
1491
|
+
x.scrollTop = Math.max(0, T);
|
|
1492
1492
|
}
|
|
1493
1493
|
this._callPropsCallbacks();
|
|
1494
|
-
},
|
|
1494
|
+
}, u.componentWillUnmount = function() {
|
|
1495
1495
|
this._resetIsScrollingTimeoutId !== null && Yt(this._resetIsScrollingTimeoutId);
|
|
1496
|
-
},
|
|
1497
|
-
var s = this.props, _ = s.children,
|
|
1498
|
-
if (
|
|
1496
|
+
}, u.render = function() {
|
|
1497
|
+
var s = this.props, _ = s.children, b = s.className, T = s.columnCount, L = s.direction, x = s.height, I = s.innerRef, D = s.innerElementType, A = s.innerTagName, F = s.itemData, R = s.itemKey, O = R === void 0 ? Zo : R, N = s.outerElementType, k = s.outerTagName, $ = s.rowCount, Z = s.style, j = s.useIsScrolling, q = s.width, te = this.state.isScrolling, Y = this._getHorizontalRangeToRender(), de = Y[0], we = Y[1], ue = this._getVerticalRangeToRender(), J = ue[0], ke = ue[1], _e = [];
|
|
1498
|
+
if (T > 0 && $)
|
|
1499
1499
|
for (var Te = J; Te <= ke; Te++)
|
|
1500
1500
|
for (var be = de; be <= we; be++)
|
|
1501
1501
|
_e.push(Ze(_, {
|
|
@@ -1510,9 +1510,9 @@ function jo(e) {
|
|
|
1510
1510
|
rowIndex: Te,
|
|
1511
1511
|
style: this._getItemStyle(Te, be)
|
|
1512
1512
|
}));
|
|
1513
|
-
var
|
|
1513
|
+
var ot = l(this.props, this._instanceProps), it = c(this.props, this._instanceProps);
|
|
1514
1514
|
return Ze(N || k || "div", {
|
|
1515
|
-
className:
|
|
1515
|
+
className: b,
|
|
1516
1516
|
onScroll: this._onScroll,
|
|
1517
1517
|
ref: this._outerRefSetter,
|
|
1518
1518
|
style: Hr({
|
|
@@ -1524,38 +1524,38 @@ function jo(e) {
|
|
|
1524
1524
|
willChange: "transform",
|
|
1525
1525
|
direction: L
|
|
1526
1526
|
}, Z)
|
|
1527
|
-
}, Ze(
|
|
1527
|
+
}, Ze(D || A || "div", {
|
|
1528
1528
|
children: _e,
|
|
1529
1529
|
ref: I,
|
|
1530
1530
|
style: {
|
|
1531
|
-
height:
|
|
1531
|
+
height: ot,
|
|
1532
1532
|
pointerEvents: te ? "none" : void 0,
|
|
1533
|
-
width:
|
|
1533
|
+
width: it
|
|
1534
1534
|
}
|
|
1535
1535
|
}));
|
|
1536
|
-
},
|
|
1537
|
-
var s = this.props, _ = s.columnCount,
|
|
1538
|
-
if (typeof
|
|
1539
|
-
var x = this._getHorizontalRangeToRender(), I = x[0],
|
|
1540
|
-
this._callOnItemsRendered(I,
|
|
1536
|
+
}, u._callPropsCallbacks = function() {
|
|
1537
|
+
var s = this.props, _ = s.columnCount, b = s.onItemsRendered, T = s.onScroll, L = s.rowCount;
|
|
1538
|
+
if (typeof b == "function" && _ > 0 && L > 0) {
|
|
1539
|
+
var x = this._getHorizontalRangeToRender(), I = x[0], D = x[1], A = x[2], F = x[3], R = this._getVerticalRangeToRender(), O = R[0], N = R[1], k = R[2], $ = R[3];
|
|
1540
|
+
this._callOnItemsRendered(I, D, O, N, A, F, k, $);
|
|
1541
1541
|
}
|
|
1542
|
-
if (typeof
|
|
1542
|
+
if (typeof T == "function") {
|
|
1543
1543
|
var Z = this.state, j = Z.horizontalScrollDirection, q = Z.scrollLeft, te = Z.scrollTop, Y = Z.scrollUpdateWasRequested, de = Z.verticalScrollDirection;
|
|
1544
1544
|
this._callOnScroll(q, te, j, de, Y);
|
|
1545
1545
|
}
|
|
1546
|
-
},
|
|
1547
|
-
var s = this.props, _ = s.columnCount,
|
|
1546
|
+
}, u._getHorizontalRangeToRender = function() {
|
|
1547
|
+
var s = this.props, _ = s.columnCount, b = s.overscanColumnCount, T = s.overscanColumnsCount, L = s.overscanCount, x = s.rowCount, I = this.state, D = I.horizontalScrollDirection, A = I.isScrolling, F = I.scrollLeft, R = b || T || L || 1;
|
|
1548
1548
|
if (_ === 0 || x === 0)
|
|
1549
1549
|
return [0, 0, 0, 0];
|
|
1550
|
-
var O = o(this.props, F, this._instanceProps), N = r(this.props, O, F, this._instanceProps), k = !A ||
|
|
1550
|
+
var O = o(this.props, F, this._instanceProps), N = r(this.props, O, F, this._instanceProps), k = !A || D === "backward" ? Math.max(1, R) : 1, $ = !A || D === "forward" ? Math.max(1, R) : 1;
|
|
1551
1551
|
return [Math.max(0, O - k), Math.max(0, Math.min(_ - 1, N + $)), O, N];
|
|
1552
|
-
},
|
|
1553
|
-
var s = this.props, _ = s.columnCount,
|
|
1552
|
+
}, u._getVerticalRangeToRender = function() {
|
|
1553
|
+
var s = this.props, _ = s.columnCount, b = s.overscanCount, T = s.overscanRowCount, L = s.overscanRowsCount, x = s.rowCount, I = this.state, D = I.isScrolling, A = I.verticalScrollDirection, F = I.scrollTop, R = T || L || b || 1;
|
|
1554
1554
|
if (_ === 0 || x === 0)
|
|
1555
1555
|
return [0, 0, 0, 0];
|
|
1556
|
-
var O = h(this.props, F, this._instanceProps), N = w(this.props, O, F, this._instanceProps), k = !
|
|
1556
|
+
var O = h(this.props, F, this._instanceProps), N = w(this.props, O, F, this._instanceProps), k = !D || A === "backward" ? Math.max(1, R) : 1, $ = !D || A === "forward" ? Math.max(1, R) : 1;
|
|
1557
1557
|
return [Math.max(0, O - k), Math.max(0, Math.min(x - 1, N + $)), O, N];
|
|
1558
|
-
},
|
|
1558
|
+
}, g;
|
|
1559
1559
|
}(sr), t.defaultProps = {
|
|
1560
1560
|
direction: "ltr",
|
|
1561
1561
|
itemData: void 0,
|
|
@@ -1563,9 +1563,9 @@ function jo(e) {
|
|
|
1563
1563
|
}, t;
|
|
1564
1564
|
}
|
|
1565
1565
|
var Ko = function(t, n) {
|
|
1566
|
-
var o = t.children, r = t.direction, a = t.height, l = t.innerTagName, c = t.outerTagName, d = t.overscanColumnsCount,
|
|
1566
|
+
var o = t.children, r = t.direction, a = t.height, l = t.innerTagName, c = t.outerTagName, d = t.overscanColumnsCount, p = t.overscanCount, m = t.overscanRowsCount, v = t.width, h = n.instance;
|
|
1567
1567
|
if (process.env.NODE_ENV !== "production") {
|
|
1568
|
-
if (typeof
|
|
1568
|
+
if (typeof p == "number" && je && !je.has(h) && (je.add(h), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof d == "number" || typeof m == "number") && Ke && !Ke.has(h) && (Ke.add(h), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (l != null || c != null) && Xe && !Xe.has(h) && (Xe.add(h), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), o == null)
|
|
1569
1569
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
1570
1570
|
switch (r) {
|
|
1571
1571
|
case "ltr":
|
|
@@ -1585,27 +1585,27 @@ var Ko = function(t, n) {
|
|
|
1585
1585
|
var d = r[l];
|
|
1586
1586
|
c = d.offset + d.size;
|
|
1587
1587
|
}
|
|
1588
|
-
var
|
|
1589
|
-
return c +
|
|
1588
|
+
var p = o - l - 1, m = p * a;
|
|
1589
|
+
return c + m;
|
|
1590
1590
|
}, En = function(t, n) {
|
|
1591
1591
|
var o = t.columnCount, r = n.columnMetadataMap, a = n.estimatedColumnWidth, l = n.lastMeasuredColumnIndex, c = 0;
|
|
1592
1592
|
if (l >= o && (l = o - 1), l >= 0) {
|
|
1593
1593
|
var d = r[l];
|
|
1594
1594
|
c = d.offset + d.size;
|
|
1595
1595
|
}
|
|
1596
|
-
var
|
|
1597
|
-
return c +
|
|
1596
|
+
var p = o - l - 1, m = p * a;
|
|
1597
|
+
return c + m;
|
|
1598
1598
|
}, ge = function(t, n, o, r) {
|
|
1599
1599
|
var a, l, c;
|
|
1600
1600
|
if (t === "column" ? (a = r.columnMetadataMap, l = n.columnWidth, c = r.lastMeasuredColumnIndex) : (a = r.rowMetadataMap, l = n.rowHeight, c = r.lastMeasuredRowIndex), o > c) {
|
|
1601
1601
|
var d = 0;
|
|
1602
1602
|
if (c >= 0) {
|
|
1603
|
-
var
|
|
1604
|
-
d =
|
|
1603
|
+
var p = a[c];
|
|
1604
|
+
d = p.offset + p.size;
|
|
1605
1605
|
}
|
|
1606
|
-
for (var
|
|
1607
|
-
var v = l(
|
|
1608
|
-
a[
|
|
1606
|
+
for (var m = c + 1; m <= o; m++) {
|
|
1607
|
+
var v = l(m);
|
|
1608
|
+
a[m] = {
|
|
1609
1609
|
offset: d,
|
|
1610
1610
|
size: v
|
|
1611
1611
|
}, d += v;
|
|
@@ -1631,7 +1631,7 @@ var Ko = function(t, n) {
|
|
|
1631
1631
|
r += c, c *= 2;
|
|
1632
1632
|
return On(t, n, o, Math.min(r, l - 1), Math.floor(r / 2), a);
|
|
1633
1633
|
}, tn = function(t, n, o, r, a, l, c) {
|
|
1634
|
-
var d = t === "column" ? n.width : n.height,
|
|
1634
|
+
var d = t === "column" ? n.width : n.height, p = ge(t, n, o, l), m = t === "column" ? En(n, l) : Nn(n, l), v = Math.max(0, Math.min(m - d, p.offset)), h = Math.max(0, p.offset - d + c + p.size);
|
|
1635
1635
|
switch (r === "smart" && (a >= h - d && a <= v + d ? r = "auto" : r = "center"), r) {
|
|
1636
1636
|
case "start":
|
|
1637
1637
|
return v;
|
|
@@ -1651,9 +1651,9 @@ var Ko = function(t, n) {
|
|
|
1651
1651
|
return en("column", t, o, n);
|
|
1652
1652
|
},
|
|
1653
1653
|
getColumnStopIndexForStartIndex: function(t, n, o, r) {
|
|
1654
|
-
for (var a = t.columnCount, l = t.width, c = ge("column", t, n, r), d = o + l,
|
|
1655
|
-
|
|
1656
|
-
return
|
|
1654
|
+
for (var a = t.columnCount, l = t.width, c = ge("column", t, n, r), d = o + l, p = c.offset + c.size, m = n; m < a - 1 && p < d; )
|
|
1655
|
+
m++, p += ge("column", t, m, r).size;
|
|
1656
|
+
return m;
|
|
1657
1657
|
},
|
|
1658
1658
|
getColumnWidth: function(t, n, o) {
|
|
1659
1659
|
return o.columnMetadataMap[n].size;
|
|
@@ -1676,9 +1676,9 @@ var Ko = function(t, n) {
|
|
|
1676
1676
|
return en("row", t, o, n);
|
|
1677
1677
|
},
|
|
1678
1678
|
getRowStopIndexForStartIndex: function(t, n, o, r) {
|
|
1679
|
-
for (var a = t.rowCount, l = t.height, c = ge("row", t, n, r), d = o + l,
|
|
1680
|
-
|
|
1681
|
-
return
|
|
1679
|
+
for (var a = t.rowCount, l = t.height, c = ge("row", t, n, r), d = o + l, p = c.offset + c.size, m = n; m < a - 1 && p < d; )
|
|
1680
|
+
m++, p += ge("row", t, m, r).size;
|
|
1681
|
+
return m;
|
|
1682
1682
|
},
|
|
1683
1683
|
initInstanceProps: function(t, n) {
|
|
1684
1684
|
var o = t, r = o.estimatedColumnWidth, a = o.estimatedRowHeight, l = {
|
|
@@ -1700,8 +1700,8 @@ var Ko = function(t, n) {
|
|
|
1700
1700
|
shouldForceUpdate: d
|
|
1701
1701
|
});
|
|
1702
1702
|
}, n.resetAfterIndices = function(c) {
|
|
1703
|
-
var d = c.columnIndex,
|
|
1704
|
-
typeof d == "number" && (l.lastMeasuredColumnIndex = Math.min(l.lastMeasuredColumnIndex, d - 1)), typeof
|
|
1703
|
+
var d = c.columnIndex, p = c.rowIndex, m = c.shouldForceUpdate, v = m === void 0 ? !0 : m;
|
|
1704
|
+
typeof d == "number" && (l.lastMeasuredColumnIndex = Math.min(l.lastMeasuredColumnIndex, d - 1)), typeof p == "number" && (l.lastMeasuredRowIndex = Math.min(l.lastMeasuredRowIndex, p - 1)), n._getItemStyleCache(-1), v && n.forceUpdate();
|
|
1705
1705
|
}, l;
|
|
1706
1706
|
},
|
|
1707
1707
|
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
@@ -1731,32 +1731,32 @@ function ei(e, t) {
|
|
|
1731
1731
|
return !nn(n, r) && !nn(o, a);
|
|
1732
1732
|
}
|
|
1733
1733
|
const ti = () => {
|
|
1734
|
-
const { viewMode: e } = Ee(), { scrollMode: t } = Ne(), { setColumnCount: n } = gn(), { virtualScrollableElementRef: o } = nt(), r = Ue(), a = M(() => r.heights.length, [r.heights]), l = M(() => t === ee.HORIZONTAL_SCROLLING ? a : e === Re.DUAL_PAGE ? 2 : 1, [e, t, t, a, o]), c = M(() => r.widths.reduce((
|
|
1735
|
-
const
|
|
1736
|
-
return (!
|
|
1734
|
+
const { viewMode: e } = Ee(), { scrollMode: t } = Ne(), { setColumnCount: n } = gn(), { virtualScrollableElementRef: o } = nt(), r = Ue(), a = M(() => r.heights.length, [r.heights]), l = M(() => t === ee.HORIZONTAL_SCROLLING ? a : e === Re.DUAL_PAGE ? 2 : 1, [e, t, t, a, o]), c = M(() => r.widths.reduce((P, y, C) => {
|
|
1735
|
+
const S = C % l;
|
|
1736
|
+
return (!P[S] || y > P[S]) && (P[S] = y), P;
|
|
1737
1737
|
}, []), [r.widths, l]), d = E(
|
|
1738
1738
|
(w) => {
|
|
1739
|
-
const
|
|
1740
|
-
return c[
|
|
1739
|
+
const P = w % c.length;
|
|
1740
|
+
return c[P] || 0;
|
|
1741
1741
|
},
|
|
1742
1742
|
[c]
|
|
1743
|
-
),
|
|
1743
|
+
), p = E(
|
|
1744
1744
|
(w) => {
|
|
1745
|
-
const
|
|
1746
|
-
const
|
|
1747
|
-
return r.heights[
|
|
1745
|
+
const P = Array.from({ length: l }, (y, C) => {
|
|
1746
|
+
const S = w * l + C;
|
|
1747
|
+
return r.heights[S] || 0;
|
|
1748
1748
|
});
|
|
1749
|
-
return Math.max(...
|
|
1749
|
+
return Math.max(...P);
|
|
1750
1750
|
},
|
|
1751
1751
|
[r.heights, l]
|
|
1752
1752
|
);
|
|
1753
1753
|
W(() => {
|
|
1754
1754
|
n(l);
|
|
1755
1755
|
}, [l, n]);
|
|
1756
|
-
const
|
|
1756
|
+
const m = M(() => t === ee.HORIZONTAL_SCROLLING || t === ee.PAGE_SCROLLING ? 1 : Math.round(a / l), [l, a, t]), v = M(() => r.heights.reduce((w, P) => w + P, 0) / r.heights.length || 0, [r]), h = M(() => r.widths.reduce((w, P) => w + P, 0) / r.heights.length || 0, [r]);
|
|
1757
1757
|
return {
|
|
1758
|
-
rowCount:
|
|
1759
|
-
rowHeight:
|
|
1758
|
+
rowCount: m,
|
|
1759
|
+
rowHeight: p,
|
|
1760
1760
|
columnCount: l,
|
|
1761
1761
|
columnWidth: d,
|
|
1762
1762
|
pageDimension: r,
|
|
@@ -1766,15 +1766,15 @@ const ti = () => {
|
|
|
1766
1766
|
};
|
|
1767
1767
|
let oe;
|
|
1768
1768
|
typeof window < "u" ? oe = window : typeof self < "u" ? oe = self : oe = global;
|
|
1769
|
-
let
|
|
1770
|
-
const rn = 20,
|
|
1771
|
-
ft == null || an == null ? (
|
|
1769
|
+
let Ct = null, Pt = null;
|
|
1770
|
+
const rn = 20, mt = oe.clearTimeout, on = oe.setTimeout, ft = oe.cancelAnimationFrame || oe.mozCancelAnimationFrame || oe.webkitCancelAnimationFrame, an = oe.requestAnimationFrame || oe.mozRequestAnimationFrame || oe.webkitRequestAnimationFrame;
|
|
1771
|
+
ft == null || an == null ? (Ct = mt, Pt = function(t) {
|
|
1772
1772
|
return on(t, rn);
|
|
1773
|
-
}) : (
|
|
1774
|
-
ft(t),
|
|
1775
|
-
},
|
|
1773
|
+
}) : (Ct = function([t, n]) {
|
|
1774
|
+
ft(t), mt(n);
|
|
1775
|
+
}, Pt = function(t) {
|
|
1776
1776
|
const n = an(function() {
|
|
1777
|
-
|
|
1777
|
+
mt(o), t();
|
|
1778
1778
|
}), o = on(function() {
|
|
1779
1779
|
ft(n), t();
|
|
1780
1780
|
}, rn);
|
|
@@ -1784,41 +1784,41 @@ function ni(e) {
|
|
|
1784
1784
|
let t, n, o, r, a, l, c;
|
|
1785
1785
|
const d = typeof document < "u" && document.attachEvent;
|
|
1786
1786
|
if (!d) {
|
|
1787
|
-
l = function(
|
|
1788
|
-
const
|
|
1789
|
-
|
|
1790
|
-
}, a = function(
|
|
1791
|
-
return
|
|
1792
|
-
}, c = function(
|
|
1793
|
-
if (
|
|
1787
|
+
l = function(S) {
|
|
1788
|
+
const g = S.__resizeTriggers__, u = g.firstElementChild, f = g.lastElementChild, s = u.firstElementChild;
|
|
1789
|
+
f.scrollLeft = f.scrollWidth, f.scrollTop = f.scrollHeight, s.style.width = u.offsetWidth + 1 + "px", s.style.height = u.offsetHeight + 1 + "px", u.scrollLeft = u.scrollWidth, u.scrollTop = u.scrollHeight;
|
|
1790
|
+
}, a = function(S) {
|
|
1791
|
+
return S.offsetWidth !== S.__resizeLast__.width || S.offsetHeight !== S.__resizeLast__.height;
|
|
1792
|
+
}, c = function(S) {
|
|
1793
|
+
if (S.target.className && typeof S.target.className.indexOf == "function" && S.target.className.indexOf("contract-trigger") < 0 && S.target.className.indexOf("expand-trigger") < 0)
|
|
1794
1794
|
return;
|
|
1795
|
-
const
|
|
1796
|
-
l(this), this.__resizeRAF__ &&
|
|
1797
|
-
a(
|
|
1798
|
-
s.call(
|
|
1795
|
+
const g = this;
|
|
1796
|
+
l(this), this.__resizeRAF__ && Ct(this.__resizeRAF__), this.__resizeRAF__ = Pt(function() {
|
|
1797
|
+
a(g) && (g.__resizeLast__.width = g.offsetWidth, g.__resizeLast__.height = g.offsetHeight, g.__resizeListeners__.forEach(function(s) {
|
|
1798
|
+
s.call(g, S);
|
|
1799
1799
|
}));
|
|
1800
1800
|
});
|
|
1801
1801
|
};
|
|
1802
1802
|
let h = !1, w = "";
|
|
1803
1803
|
o = "animationstart";
|
|
1804
|
-
const
|
|
1805
|
-
let
|
|
1804
|
+
const P = "Webkit Moz O ms".split(" ");
|
|
1805
|
+
let y = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), C = "";
|
|
1806
1806
|
{
|
|
1807
|
-
const
|
|
1808
|
-
if (
|
|
1809
|
-
for (let
|
|
1810
|
-
if (
|
|
1811
|
-
|
|
1807
|
+
const S = document.createElement("fakeelement");
|
|
1808
|
+
if (S.style.animationName !== void 0 && (h = !0), h === !1) {
|
|
1809
|
+
for (let g = 0; g < P.length; g++)
|
|
1810
|
+
if (S.style[P[g] + "AnimationName"] !== void 0) {
|
|
1811
|
+
C = P[g], w = "-" + C.toLowerCase() + "-", o = y[g], h = !0;
|
|
1812
1812
|
break;
|
|
1813
1813
|
}
|
|
1814
1814
|
}
|
|
1815
1815
|
}
|
|
1816
1816
|
n = "resizeanim", t = "@" + w + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", r = w + "animation: 1ms " + n + "; ";
|
|
1817
1817
|
}
|
|
1818
|
-
const
|
|
1818
|
+
const p = function(h) {
|
|
1819
1819
|
if (!h.getElementById("detectElementResize")) {
|
|
1820
|
-
const w = (t || "") + ".resize-triggers { " + (r || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',
|
|
1821
|
-
|
|
1820
|
+
const w = (t || "") + ".resize-triggers { " + (r || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', P = h.head || h.getElementsByTagName("head")[0], y = h.createElement("style");
|
|
1821
|
+
y.id = "detectElementResize", y.type = "text/css", e != null && y.setAttribute("nonce", e), y.styleSheet ? y.styleSheet.cssText = w : y.appendChild(h.createTextNode(w)), P.appendChild(y);
|
|
1822
1822
|
}
|
|
1823
1823
|
};
|
|
1824
1824
|
return {
|
|
@@ -1827,13 +1827,13 @@ function ni(e) {
|
|
|
1827
1827
|
h.attachEvent("onresize", w);
|
|
1828
1828
|
else {
|
|
1829
1829
|
if (!h.__resizeTriggers__) {
|
|
1830
|
-
const
|
|
1831
|
-
|
|
1832
|
-
const
|
|
1833
|
-
|
|
1834
|
-
const
|
|
1835
|
-
|
|
1836
|
-
|
|
1830
|
+
const P = h.ownerDocument, y = oe.getComputedStyle(h);
|
|
1831
|
+
y && y.position === "static" && (h.style.position = "relative"), p(P), h.__resizeLast__ = {}, h.__resizeListeners__ = [], (h.__resizeTriggers__ = P.createElement("div")).className = "resize-triggers";
|
|
1832
|
+
const C = P.createElement("div");
|
|
1833
|
+
C.className = "expand-trigger", C.appendChild(P.createElement("div"));
|
|
1834
|
+
const S = P.createElement("div");
|
|
1835
|
+
S.className = "contract-trigger", h.__resizeTriggers__.appendChild(C), h.__resizeTriggers__.appendChild(S), h.appendChild(h.__resizeTriggers__), l(h), h.addEventListener("scroll", c, !0), o && (h.__resizeTriggers__.__animationListener__ = function(u) {
|
|
1836
|
+
u.animationName === n && l(h);
|
|
1837
1837
|
}, h.__resizeTriggers__.addEventListener(o, h.__resizeTriggers__.__animationListener__));
|
|
1838
1838
|
}
|
|
1839
1839
|
h.__resizeListeners__.push(w);
|
|
@@ -1856,10 +1856,8 @@ class ri extends cr {
|
|
|
1856
1856
|
constructor(...t) {
|
|
1857
1857
|
super(...t), this.state = {
|
|
1858
1858
|
height: this.props.defaultHeight || 0,
|
|
1859
|
-
scaledHeight: this.props.defaultHeight || 0,
|
|
1860
|
-
scaledWidth: this.props.defaultWidth || 0,
|
|
1861
1859
|
width: this.props.defaultWidth || 0
|
|
1862
|
-
}, this._autoSizer = null, this._detectElementResize = null, this._parentNode = null, this._resizeObserver = null, this._timeoutId = null, this._onResize = () => {
|
|
1860
|
+
}, this._autoSizer = null, this._detectElementResize = null, this._didLogDeprecationWarning = !1, this._parentNode = null, this._resizeObserver = null, this._timeoutId = null, this._onResize = () => {
|
|
1863
1861
|
this._timeoutId = null;
|
|
1864
1862
|
const {
|
|
1865
1863
|
disableHeight: n,
|
|
@@ -1867,18 +1865,27 @@ class ri extends cr {
|
|
|
1867
1865
|
onResize: r
|
|
1868
1866
|
} = this.props;
|
|
1869
1867
|
if (this._parentNode) {
|
|
1870
|
-
const a = window.getComputedStyle(this._parentNode) || {}, l = parseFloat(a.paddingLeft || "0"), c = parseFloat(a.paddingRight || "0"), d = parseFloat(a.paddingTop || "0"),
|
|
1871
|
-
(!n &&
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1868
|
+
const a = window.getComputedStyle(this._parentNode) || {}, l = parseFloat(a.paddingLeft || "0"), c = parseFloat(a.paddingRight || "0"), d = parseFloat(a.paddingTop || "0"), p = parseFloat(a.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(), v = m.height - d - p, h = m.width - l - c;
|
|
1869
|
+
if (!n && this.state.height !== v || !o && this.state.width !== h) {
|
|
1870
|
+
this.setState({
|
|
1871
|
+
height: v,
|
|
1872
|
+
width: h
|
|
1873
|
+
});
|
|
1874
|
+
const w = () => {
|
|
1875
|
+
this._didLogDeprecationWarning || (this._didLogDeprecationWarning = !0, console.warn("scaledWidth and scaledHeight parameters have been deprecated; use width and height instead"));
|
|
1876
|
+
};
|
|
1877
|
+
typeof r == "function" && r({
|
|
1878
|
+
height: v,
|
|
1879
|
+
width: h,
|
|
1880
|
+
// TODO Remove these params in the next major release
|
|
1881
|
+
get scaledHeight() {
|
|
1882
|
+
return w(), v;
|
|
1883
|
+
},
|
|
1884
|
+
get scaledWidth() {
|
|
1885
|
+
return w(), h;
|
|
1886
|
+
}
|
|
1887
|
+
});
|
|
1888
|
+
}
|
|
1882
1889
|
}
|
|
1883
1890
|
}, this._setRef = (n) => {
|
|
1884
1891
|
this._autoSizer = n;
|
|
@@ -1909,56 +1916,54 @@ class ri extends cr {
|
|
|
1909
1916
|
doNotBailOutOnEmptyChildren: l = !1,
|
|
1910
1917
|
nonce: c,
|
|
1911
1918
|
onResize: d,
|
|
1912
|
-
style:
|
|
1913
|
-
tagName:
|
|
1919
|
+
style: p = {},
|
|
1920
|
+
tagName: m = "div",
|
|
1914
1921
|
...v
|
|
1915
1922
|
} = this.props, {
|
|
1916
1923
|
height: h,
|
|
1917
|
-
|
|
1918
|
-
scaledWidth: b,
|
|
1919
|
-
width: S
|
|
1924
|
+
width: w
|
|
1920
1925
|
} = this.state, P = {
|
|
1921
1926
|
overflow: "visible"
|
|
1922
|
-
},
|
|
1923
|
-
let
|
|
1924
|
-
return r || (h === 0 && (
|
|
1927
|
+
}, y = {};
|
|
1928
|
+
let C = !1;
|
|
1929
|
+
return r || (h === 0 && (C = !0), P.height = 0, y.height = h, y.scaledHeight = h), a || (w === 0 && (C = !0), P.width = 0, y.width = w, y.scaledWidth = w), l && (C = !1), Ze(m, {
|
|
1925
1930
|
ref: this._setRef,
|
|
1926
1931
|
style: {
|
|
1927
1932
|
...P,
|
|
1928
|
-
...
|
|
1933
|
+
...p
|
|
1929
1934
|
},
|
|
1930
1935
|
...v
|
|
1931
|
-
}, !
|
|
1936
|
+
}, !C && t(y));
|
|
1932
1937
|
}
|
|
1933
1938
|
}
|
|
1934
1939
|
const oi = hn(({ widths: e, heights: t }) => {
|
|
1935
1940
|
const { focusedPage: n, totalPages: o } = ae(), r = M(() => {
|
|
1936
1941
|
const c = [], d = Math.ceil(n / 2) * 2 - 1;
|
|
1937
1942
|
if (c.push(d), d + 1 <= o) {
|
|
1938
|
-
const
|
|
1939
|
-
c.push(
|
|
1943
|
+
const p = d + 1;
|
|
1944
|
+
c.push(p);
|
|
1940
1945
|
}
|
|
1941
1946
|
return c;
|
|
1942
1947
|
}, [n, o]), a = M(() => {
|
|
1943
|
-
const c = n % 2 === 1 ? n - 1 : n - 2, d = e(c),
|
|
1948
|
+
const c = n % 2 === 1 ? n - 1 : n - 2, d = e(c), p = t(c), m = e(c + 1), v = t(c + 1), h = p > v ? p : v, w = p < v ? p : v, P = h / 2 - w / 2;
|
|
1944
1949
|
return [
|
|
1945
1950
|
{
|
|
1946
1951
|
position: "absolute",
|
|
1947
1952
|
left: 0,
|
|
1948
|
-
top: h ===
|
|
1953
|
+
top: h === p ? 0 : P,
|
|
1949
1954
|
width: d,
|
|
1950
|
-
height:
|
|
1955
|
+
height: p
|
|
1951
1956
|
},
|
|
1952
1957
|
{
|
|
1953
1958
|
position: "absolute",
|
|
1954
1959
|
left: d,
|
|
1955
|
-
top: h === v ? 0 :
|
|
1956
|
-
width:
|
|
1960
|
+
top: h === v ? 0 : P,
|
|
1961
|
+
width: m,
|
|
1957
1962
|
height: v
|
|
1958
1963
|
}
|
|
1959
1964
|
];
|
|
1960
1965
|
}, [e, t, r]), l = M(() => a.reduce((c, d) => c + Number(d.width || 0), 0), [a]);
|
|
1961
|
-
return /* @__PURE__ */ i("div", { style: { width: l, position: "relative" }, children: r.map((c, d) => /* @__PURE__ */ i(
|
|
1966
|
+
return /* @__PURE__ */ i("div", { style: { width: l, position: "relative" }, children: r.map((c, d) => /* @__PURE__ */ i(Et, { style: a[d], pageNumber: c }, c)) });
|
|
1962
1967
|
}), ii = ({ widths: e, heights: t }) => {
|
|
1963
1968
|
const { focusedPage: n } = ae(), o = M(() => ({
|
|
1964
1969
|
position: "absolute",
|
|
@@ -1972,50 +1977,50 @@ const oi = hn(({ widths: e, heights: t }) => {
|
|
|
1972
1977
|
width: r,
|
|
1973
1978
|
position: "relative"
|
|
1974
1979
|
},
|
|
1975
|
-
children: /* @__PURE__ */ i(
|
|
1980
|
+
children: /* @__PURE__ */ i(Et, { style: o, pageNumber: n }, n)
|
|
1976
1981
|
}
|
|
1977
1982
|
);
|
|
1978
1983
|
}, ai = (e, t, n) => {
|
|
1979
|
-
const o = H(), { contentRef: r } = se(), { heights: a, widths: l } = Ue(), { setFocusedPage: c } = ae(), [d,
|
|
1980
|
-
const
|
|
1984
|
+
const o = H(), { contentRef: r } = se(), { heights: a, widths: l } = Ue(), { setFocusedPage: c } = ae(), [d, p] = G([]), { targetScrollPage: m } = vn(), v = Rt(d, 0, 500), h = M(() => a.map((P, y) => {
|
|
1985
|
+
const C = l[y], S = yo(y + 1, e), g = C * S.columnIndex, u = P * S.rowIndex, f = g + C, s = u + P;
|
|
1981
1986
|
return {
|
|
1982
|
-
pageNumber:
|
|
1983
|
-
...
|
|
1984
|
-
width:
|
|
1985
|
-
height:
|
|
1986
|
-
startX:
|
|
1987
|
-
startY:
|
|
1988
|
-
endX:
|
|
1987
|
+
pageNumber: y + 1,
|
|
1988
|
+
...S,
|
|
1989
|
+
width: C,
|
|
1990
|
+
height: P,
|
|
1991
|
+
startX: g,
|
|
1992
|
+
startY: u,
|
|
1993
|
+
endX: f,
|
|
1989
1994
|
endY: s
|
|
1990
1995
|
};
|
|
1991
1996
|
}), [a, l, e, t]);
|
|
1992
1997
|
W(() => {
|
|
1993
|
-
var
|
|
1994
|
-
v.length > 0 && !
|
|
1995
|
-
let
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
+
var y;
|
|
1999
|
+
v.length > 0 && !m.current && c(v[0].pageNumber);
|
|
2000
|
+
let P = (y = v[0]) == null ? void 0 : y.ratio;
|
|
2001
|
+
P && v.filter((C) => Math.round(C.ratio) === Math.round(P)).some((C) => C.pageNumber === m.current) && setTimeout(() => {
|
|
2002
|
+
m.current = void 0;
|
|
1998
2003
|
}, 500);
|
|
1999
2004
|
}, [v, c]);
|
|
2000
2005
|
const w = E(
|
|
2001
|
-
(
|
|
2006
|
+
(P) => {
|
|
2002
2007
|
o.current && cancelAnimationFrame(o.current), o.current = requestAnimationFrame(() => {
|
|
2003
|
-
const
|
|
2004
|
-
startTop:
|
|
2005
|
-
startLeft:
|
|
2006
|
-
endTop:
|
|
2007
|
-
endLeft:
|
|
2008
|
-
},
|
|
2009
|
-
const
|
|
2010
|
-
return
|
|
2011
|
-
}).map((
|
|
2012
|
-
const
|
|
2008
|
+
const y = P.target, C = {
|
|
2009
|
+
startTop: y.scrollTop,
|
|
2010
|
+
startLeft: y.scrollLeft,
|
|
2011
|
+
endTop: y.scrollTop + y.clientHeight,
|
|
2012
|
+
endLeft: y.scrollLeft + y.clientWidth
|
|
2013
|
+
}, S = h.filter((g) => {
|
|
2014
|
+
const u = g.endX >= C.startLeft && g.endY >= C.startTop, f = g.startX <= C.endLeft && g.startY <= C.endTop;
|
|
2015
|
+
return u && f;
|
|
2016
|
+
}).map((g) => {
|
|
2017
|
+
const u = C.startLeft > g.startX ? C.startLeft : g.startX, f = C.startTop > g.startY ? C.startTop : g.startY, s = C.endLeft < g.endX ? C.endLeft : g.endX, _ = C.endTop < g.endY ? C.endTop : g.endY, b = s - u, T = _ - f, x = +(b * T / (g.width * g.height) * 100).toFixed(2);
|
|
2013
2018
|
return {
|
|
2014
|
-
pageNumber:
|
|
2019
|
+
pageNumber: g.pageNumber,
|
|
2015
2020
|
ratio: x
|
|
2016
2021
|
};
|
|
2017
|
-
}).sort((
|
|
2018
|
-
|
|
2022
|
+
}).sort((g, u) => u.ratio - g.ratio);
|
|
2023
|
+
p(S);
|
|
2019
2024
|
});
|
|
2020
2025
|
},
|
|
2021
2026
|
[r, h]
|
|
@@ -2034,9 +2039,9 @@ const oi = hn(({ widths: e, heights: t }) => {
|
|
|
2034
2039
|
"rp-loader": "_rp-loader_1g4ff_20",
|
|
2035
2040
|
"rp-theme-variables": "_rp-theme-variables_1g4ff_24",
|
|
2036
2041
|
"rp-dark-mode": "_rp-dark-mode_1g4ff_135"
|
|
2037
|
-
},
|
|
2042
|
+
}, Ot = We(
|
|
2038
2043
|
(e, t) => {
|
|
2039
|
-
const { children: n, toolbarRef: o, style: r, className: a, ...l } = e, { customVariables: c, customDarkVariables: d } = lr(), { darkMode:
|
|
2044
|
+
const { children: n, toolbarRef: o, style: r, className: a, ...l } = e, { customVariables: c, customDarkVariables: d } = lr(), { darkMode: p } = pr();
|
|
2040
2045
|
return /* @__PURE__ */ i(
|
|
2041
2046
|
"div",
|
|
2042
2047
|
{
|
|
@@ -2045,13 +2050,13 @@ const oi = hn(({ widths: e, heights: t }) => {
|
|
|
2045
2050
|
className: ne(
|
|
2046
2051
|
ve["rp-theme-variables"],
|
|
2047
2052
|
ve["rp-container"],
|
|
2048
|
-
|
|
2053
|
+
p ? ve["rp-dark-mode"] : "",
|
|
2049
2054
|
a
|
|
2050
2055
|
),
|
|
2051
2056
|
style: {
|
|
2052
2057
|
"--rp-toolbar-height": `${(o == null ? void 0 : o.clientHeight) || 48}px`,
|
|
2053
2058
|
...c,
|
|
2054
|
-
...
|
|
2059
|
+
...p ? d : {},
|
|
2055
2060
|
...r
|
|
2056
2061
|
},
|
|
2057
2062
|
children: n
|
|
@@ -2060,23 +2065,23 @@ const oi = hn(({ widths: e, heights: t }) => {
|
|
|
2060
2065
|
}
|
|
2061
2066
|
), si = hn(({ columnIndex: e, rowIndex: t, data: n, style: o }) => {
|
|
2062
2067
|
const r = So(t, e, n.columnCount);
|
|
2063
|
-
return /* @__PURE__ */ i(
|
|
2064
|
-
}, ei),
|
|
2065
|
-
const { initialPage: e = 1, initialScrollMode: t, instanceId: n } =
|
|
2068
|
+
return /* @__PURE__ */ i(Et, { style: o, pageNumber: r }, r);
|
|
2069
|
+
}, ei), Ks = () => {
|
|
2070
|
+
const { initialPage: e = 1, initialScrollMode: t, instanceId: n } = fr(), { pagesRef: o, setPagesRef: r } = se(), { scrollToPage: a } = Sn(), {
|
|
2066
2071
|
virtualScrollRef: l,
|
|
2067
2072
|
getVirtualScrollRef: c,
|
|
2068
2073
|
getPageScrollElementRef: d,
|
|
2069
|
-
getVirtualScrollableElementRef:
|
|
2070
|
-
setTotalInnerDimensions:
|
|
2074
|
+
getVirtualScrollableElementRef: p,
|
|
2075
|
+
setTotalInnerDimensions: m,
|
|
2071
2076
|
virtualScrollableElementRef: v,
|
|
2072
2077
|
totalInnerDimensions: h,
|
|
2073
2078
|
pageScrollElementRef: w
|
|
2074
|
-
} = nt(),
|
|
2079
|
+
} = nt(), P = H(!0), { nextPage: y, prevPage: C, setFocusedPage: S, focusedPage: g } = ae(), { scrollMode: u } = Ne(), { viewMode: f } = Ee(), s = H(null), { loading: _ } = X(), { passwordRequired: b } = dr(), { LoaderImageComponent: T } = Tt(), L = H(
|
|
2075
2080
|
h
|
|
2076
2081
|
), x = H({
|
|
2077
|
-
viewMode:
|
|
2078
|
-
scrollMode:
|
|
2079
|
-
}), I = H(!1),
|
|
2082
|
+
viewMode: f,
|
|
2083
|
+
scrollMode: u
|
|
2084
|
+
}), I = H(!1), D = H(), { isFullScreen: A } = gr(), {
|
|
2080
2085
|
pageDimension: F,
|
|
2081
2086
|
rowCount: R,
|
|
2082
2087
|
rowHeight: O,
|
|
@@ -2084,23 +2089,23 @@ const oi = hn(({ widths: e, heights: t }) => {
|
|
|
2084
2089
|
columnWidth: k,
|
|
2085
2090
|
estimatedColumnWidth: $,
|
|
2086
2091
|
estimatedRowHeight: Z
|
|
2087
|
-
} = ti(), j =
|
|
2092
|
+
} = ti(), j = Rt(h, 100), q = H();
|
|
2088
2093
|
ai(N, R, v);
|
|
2089
2094
|
const te = H({
|
|
2090
2095
|
scrollTop: 0,
|
|
2091
2096
|
scrollLeft: 0
|
|
2092
2097
|
});
|
|
2093
2098
|
Po(o);
|
|
2094
|
-
const { isPressed: Y } = bo(), { selectionMode: de } =
|
|
2099
|
+
const { isPressed: Y } = bo(), { selectionMode: de } = mr(), { initializeGrabScroll: we, resetGrabState: ue } = Co({
|
|
2095
2100
|
isPressed: Y
|
|
2096
2101
|
}), J = M(() => de === ur.HAND, [de]), ke = M(() => ({
|
|
2097
2102
|
columnCount: N
|
|
2098
2103
|
}), [N]), _e = E(
|
|
2099
2104
|
(U) => {
|
|
2100
2105
|
const V = document.activeElement !== o;
|
|
2101
|
-
!A && V || (["ArrowUp", "ArrowLeft"].includes(U.key) ? (U.preventDefault(),
|
|
2106
|
+
!A && V || (["ArrowUp", "ArrowLeft"].includes(U.key) ? (U.preventDefault(), C()) : ["ArrowDown", "ArrowRight"].includes(U.key) && (U.preventDefault(), y()));
|
|
2102
2107
|
},
|
|
2103
|
-
[
|
|
2108
|
+
[y, C, A, u]
|
|
2104
2109
|
);
|
|
2105
2110
|
W(() => (window.addEventListener("keydown", _e), () => {
|
|
2106
2111
|
window.removeEventListener("keydown", _e);
|
|
@@ -2127,23 +2132,23 @@ const oi = hn(({ widths: e, heights: t }) => {
|
|
|
2127
2132
|
[v]
|
|
2128
2133
|
), be = E(
|
|
2129
2134
|
(U, V) => {
|
|
2130
|
-
if (x.current.viewMode !==
|
|
2131
|
-
q.current && clearTimeout(q.current), I.current = !0, a(
|
|
2135
|
+
if (x.current.viewMode !== f || x.current.scrollMode !== u) {
|
|
2136
|
+
q.current && clearTimeout(q.current), I.current = !0, a(g, "auto"), q.current = setTimeout(() => {
|
|
2132
2137
|
requestAnimationFrame(() => {
|
|
2133
|
-
x.current = { viewMode:
|
|
2138
|
+
x.current = { viewMode: f, scrollMode: u };
|
|
2134
2139
|
});
|
|
2135
2140
|
}, 100);
|
|
2136
2141
|
return;
|
|
2137
2142
|
}
|
|
2138
|
-
const Se = U.scrollTop,
|
|
2143
|
+
const Se = U.scrollTop, at = U.scrollLeft;
|
|
2139
2144
|
if (!V.height || !V.width)
|
|
2140
2145
|
return;
|
|
2141
2146
|
I.current = !0;
|
|
2142
|
-
const { height: xe, width:
|
|
2143
|
-
if (Ft === xe && Wt ===
|
|
2147
|
+
const { height: xe, width: st } = V, { height: Ft, width: Wt } = L.current;
|
|
2148
|
+
if (Ft === xe && Wt === st)
|
|
2144
2149
|
return;
|
|
2145
|
-
const rr = Se / Ft * xe, or =
|
|
2146
|
-
|
|
2150
|
+
const rr = Se / Ft * xe, or = at / Wt * st, ir = Math.round(Math.min(rr, xe)) || 0, ar = Math.round(Math.min(or, st)) || 0;
|
|
2151
|
+
D.current = setTimeout(() => {
|
|
2147
2152
|
requestAnimationFrame(() => {
|
|
2148
2153
|
l == null || l.scrollTo({
|
|
2149
2154
|
scrollTop: ir,
|
|
@@ -2155,23 +2160,23 @@ const oi = hn(({ widths: e, heights: t }) => {
|
|
|
2155
2160
|
width: V.width
|
|
2156
2161
|
};
|
|
2157
2162
|
},
|
|
2158
|
-
[l,
|
|
2163
|
+
[l, f, u, a]
|
|
2159
2164
|
);
|
|
2160
2165
|
W(() => {
|
|
2161
|
-
clearTimeout(
|
|
2166
|
+
clearTimeout(D.current);
|
|
2162
2167
|
const U = Array.from({ length: R }).reduce(
|
|
2163
|
-
(Se,
|
|
2168
|
+
(Se, at, xe) => Se + O(xe),
|
|
2164
2169
|
0
|
|
2165
2170
|
), V = Array.from({ length: N }).reduce(
|
|
2166
|
-
(Se,
|
|
2171
|
+
(Se, at, xe) => Se + k(xe),
|
|
2167
2172
|
0
|
|
2168
2173
|
), ye = Te(V, U);
|
|
2169
|
-
te.current = ye, be(ye, { height: U, width: V }),
|
|
2174
|
+
te.current = ye, be(ye, { height: U, width: V }), m({
|
|
2170
2175
|
height: U,
|
|
2171
2176
|
width: V
|
|
2172
2177
|
});
|
|
2173
2178
|
}, [F, R, N, be]);
|
|
2174
|
-
const
|
|
2179
|
+
const ot = E(
|
|
2175
2180
|
(U) => {
|
|
2176
2181
|
te.current = {
|
|
2177
2182
|
scrollTop: U.scrollTop,
|
|
@@ -2183,7 +2188,7 @@ const oi = hn(({ widths: e, heights: t }) => {
|
|
|
2183
2188
|
W(() => () => {
|
|
2184
2189
|
q.current && clearTimeout(q.current);
|
|
2185
2190
|
}, []);
|
|
2186
|
-
const
|
|
2191
|
+
const it = M(() => ne(pe["rp-pages-container"], {
|
|
2187
2192
|
[pe["rp-cursor-grab"]]: J && !Y,
|
|
2188
2193
|
[pe["rp-cursor-grabbing"]]: J && Y
|
|
2189
2194
|
}), [J, Y]), nr = E(
|
|
@@ -2198,36 +2203,36 @@ const oi = hn(({ widths: e, heights: t }) => {
|
|
|
2198
2203
|
return W(() => {
|
|
2199
2204
|
_ && ue();
|
|
2200
2205
|
}, [_]), W(() => {
|
|
2201
|
-
if (!(j.height === 0 || !
|
|
2206
|
+
if (!(j.height === 0 || !P.current)) {
|
|
2202
2207
|
if (t === ee.PAGE_SCROLLING) {
|
|
2203
|
-
e !==
|
|
2208
|
+
e !== g && w && S(e), P.current = !1;
|
|
2204
2209
|
return;
|
|
2205
2210
|
}
|
|
2206
|
-
a(e, "auto"),
|
|
2211
|
+
a(e, "auto"), S(e), P.current = !1;
|
|
2207
2212
|
}
|
|
2208
2213
|
}, [
|
|
2209
2214
|
a,
|
|
2210
2215
|
t,
|
|
2211
2216
|
w,
|
|
2212
|
-
|
|
2217
|
+
S,
|
|
2213
2218
|
j
|
|
2214
|
-
]), /* @__PURE__ */
|
|
2215
|
-
/* @__PURE__ */ i(
|
|
2219
|
+
]), /* @__PURE__ */ z(ie, { children: [
|
|
2220
|
+
/* @__PURE__ */ i(Ot, { id: n, ref: r, tabIndex: -1, className: it, children: /* @__PURE__ */ i(ri, { style: { minHeight: "50px" }, children: ({ width: U, height: V }) => /* @__PURE__ */ i("div", { "data-rp": "pages", ref: nr, style: { width: U, height: V }, children: u === ee.PAGE_SCROLLING ? /* @__PURE__ */ i(
|
|
2216
2221
|
"div",
|
|
2217
2222
|
{
|
|
2218
2223
|
ref: d,
|
|
2219
2224
|
style: { width: U, height: V },
|
|
2220
2225
|
className: ne(pe["rp-pages"], pe["rp-page-scrolling-wrapper"]),
|
|
2221
|
-
children:
|
|
2226
|
+
children: f === Re.DUAL_PAGE ? /* @__PURE__ */ i(oi, { widths: k, heights: O }) : /* @__PURE__ */ i(ii, { widths: k, heights: O })
|
|
2222
2227
|
}
|
|
2223
2228
|
) : $ ? /* @__PURE__ */ i(
|
|
2224
2229
|
Yo,
|
|
2225
2230
|
{
|
|
2226
2231
|
ref: c,
|
|
2227
2232
|
itemData: ke,
|
|
2228
|
-
outerRef:
|
|
2233
|
+
outerRef: p,
|
|
2229
2234
|
innerRef: s,
|
|
2230
|
-
onScroll:
|
|
2235
|
+
onScroll: ot,
|
|
2231
2236
|
columnCount: N,
|
|
2232
2237
|
columnWidth: k,
|
|
2233
2238
|
rowHeight: O,
|
|
@@ -2238,7 +2243,7 @@ const oi = hn(({ widths: e, heights: t }) => {
|
|
|
2238
2243
|
rowCount: R,
|
|
2239
2244
|
className: ne(
|
|
2240
2245
|
pe["rp-pages"],
|
|
2241
|
-
|
|
2246
|
+
u === ee.HORIZONTAL_SCROLLING ? pe["rp-pages-horizontal-scroll"] : ""
|
|
2242
2247
|
),
|
|
2243
2248
|
children: si
|
|
2244
2249
|
}
|
|
@@ -2253,10 +2258,10 @@ const oi = hn(({ widths: e, heights: t }) => {
|
|
|
2253
2258
|
height: "100%",
|
|
2254
2259
|
width: "100%"
|
|
2255
2260
|
},
|
|
2256
|
-
children:
|
|
2261
|
+
children: T && /* @__PURE__ */ i(T, {})
|
|
2257
2262
|
}
|
|
2258
2263
|
) }) }) }),
|
|
2259
|
-
|
|
2264
|
+
b && /* @__PURE__ */ i(To, {})
|
|
2260
2265
|
] });
|
|
2261
2266
|
}, Me = {
|
|
2262
2267
|
"rp-toolbar-content": "_rp-toolbar-content_sz31z_1",
|
|
@@ -2264,7 +2269,7 @@ const oi = hn(({ widths: e, heights: t }) => {
|
|
|
2264
2269
|
"rp-toolbar-start": "_rp-toolbar-start_sz31z_33",
|
|
2265
2270
|
"rp-toolbar-middle": "_rp-toolbar-middle_sz31z_39",
|
|
2266
2271
|
"rp-toolbar-end": "_rp-toolbar-end_sz31z_46"
|
|
2267
|
-
},
|
|
2272
|
+
}, gt = {
|
|
2268
2273
|
"rp-paginate": "_rp-paginate_1y9vo_1",
|
|
2269
2274
|
"rp-page-input": "_rp-page-input_1y9vo_6",
|
|
2270
2275
|
"rp-total-page": "_rp-total-page_1y9vo_11"
|
|
@@ -2275,24 +2280,24 @@ const oi = hn(({ widths: e, heights: t }) => {
|
|
|
2275
2280
|
const { nextIcon: e } = he();
|
|
2276
2281
|
return e || /* @__PURE__ */ i(Ge, { style: { transform: "rotate(180deg" } });
|
|
2277
2282
|
}, di = () => {
|
|
2278
|
-
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: a } = ae(), [l, c] = G(e.toString()), { pageNavigationTool: d = !0 } =
|
|
2283
|
+
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: a } = ae(), [l, c] = G(e.toString()), { pageNavigationTool: d = !0 } = me(), { isSmallScreen: p } = Pe(), { localeMessages: m } = ce(), { viewMode: v } = Ee(), { scrollMode: h } = Ne();
|
|
2279
2284
|
W(() => {
|
|
2280
2285
|
c(e.toString());
|
|
2281
2286
|
}, [e]);
|
|
2282
|
-
const w = E((
|
|
2283
|
-
const
|
|
2284
|
-
c(
|
|
2285
|
-
}, []),
|
|
2286
|
-
const
|
|
2287
|
-
|
|
2288
|
-
}, [a, l, t]),
|
|
2287
|
+
const w = E((g) => {
|
|
2288
|
+
const u = g.target.value;
|
|
2289
|
+
c(u);
|
|
2290
|
+
}, []), P = E(async () => {
|
|
2291
|
+
const g = a(l);
|
|
2292
|
+
g.success || c(g.currentPage.toString());
|
|
2293
|
+
}, [a, l, t]), y = E(() => {
|
|
2289
2294
|
c(e.toString());
|
|
2290
|
-
}, [e]),
|
|
2291
|
-
(
|
|
2292
|
-
|
|
2295
|
+
}, [e]), C = E(
|
|
2296
|
+
(g) => {
|
|
2297
|
+
g.key === "Enter" && P();
|
|
2293
2298
|
},
|
|
2294
|
-
[
|
|
2295
|
-
),
|
|
2299
|
+
[P]
|
|
2300
|
+
), S = M(() => v === Re.DUAL_PAGE && h === ee.PAGE_SCROLLING && e === t - 1 || e === t, [e, t, v, h]);
|
|
2296
2301
|
return typeof d != "boolean" ? /* @__PURE__ */ i(
|
|
2297
2302
|
d,
|
|
2298
2303
|
{
|
|
@@ -2303,42 +2308,42 @@ const oi = hn(({ widths: e, heights: t }) => {
|
|
|
2303
2308
|
goToPage: a,
|
|
2304
2309
|
changePage: n
|
|
2305
2310
|
}
|
|
2306
|
-
) : d ? /* @__PURE__ */
|
|
2307
|
-
!
|
|
2311
|
+
) : d ? /* @__PURE__ */ z("div", { className: gt["rp-paginate"], children: [
|
|
2312
|
+
!p && /* @__PURE__ */ i(K, { content: m == null ? void 0 : m.previousPageTooltip, children: /* @__PURE__ */ i(
|
|
2308
2313
|
re,
|
|
2309
2314
|
{
|
|
2310
2315
|
onClick: r,
|
|
2311
|
-
"aria-label":
|
|
2316
|
+
"aria-label": m == null ? void 0 : m.previousPageTooltip,
|
|
2312
2317
|
"aria-disabled": e === 1,
|
|
2313
2318
|
children: /* @__PURE__ */ i(ci, {})
|
|
2314
2319
|
}
|
|
2315
2320
|
) }),
|
|
2316
|
-
/* @__PURE__ */ i(K, { content:
|
|
2321
|
+
/* @__PURE__ */ i(K, { content: m == null ? void 0 : m.currentPageTooltip, children: /* @__PURE__ */ i(
|
|
2317
2322
|
wn,
|
|
2318
2323
|
{
|
|
2319
|
-
onKeyDown:
|
|
2320
|
-
onBlur:
|
|
2324
|
+
onKeyDown: C,
|
|
2325
|
+
onBlur: y,
|
|
2321
2326
|
onChange: w,
|
|
2322
2327
|
value: l,
|
|
2323
|
-
className:
|
|
2328
|
+
className: gt["rp-page-input"]
|
|
2324
2329
|
}
|
|
2325
2330
|
) }),
|
|
2326
|
-
/* @__PURE__ */
|
|
2331
|
+
/* @__PURE__ */ z("span", { className: gt["rp-total-page"], children: [
|
|
2327
2332
|
"/",
|
|
2328
2333
|
t
|
|
2329
2334
|
] }),
|
|
2330
|
-
!
|
|
2335
|
+
!p && /* @__PURE__ */ i(K, { content: m == null ? void 0 : m.nextPageTooltip, children: /* @__PURE__ */ i(
|
|
2331
2336
|
re,
|
|
2332
2337
|
{
|
|
2333
2338
|
onClick: o,
|
|
2334
|
-
"aria-label":
|
|
2335
|
-
"aria-disabled":
|
|
2339
|
+
"aria-label": m == null ? void 0 : m.nextPageTooltip,
|
|
2340
|
+
"aria-disabled": S,
|
|
2336
2341
|
children: /* @__PURE__ */ i(li, {})
|
|
2337
2342
|
}
|
|
2338
2343
|
) })
|
|
2339
2344
|
] }) : null;
|
|
2340
2345
|
};
|
|
2341
|
-
var
|
|
2346
|
+
var rt = "Dialog", [Dn, Xs] = Ir(rt), [ui, le] = Dn(rt), zn = (e) => {
|
|
2342
2347
|
const {
|
|
2343
2348
|
__scopeDialog: t,
|
|
2344
2349
|
children: n,
|
|
@@ -2346,10 +2351,11 @@ var Ot = "Dialog", [zn, Ks] = Ir(Ot), [ui, le] = zn(Ot), Dn = (e) => {
|
|
|
2346
2351
|
defaultOpen: r,
|
|
2347
2352
|
onOpenChange: a,
|
|
2348
2353
|
modal: l = !0
|
|
2349
|
-
} = e, c = B.useRef(null), d = B.useRef(null), [
|
|
2354
|
+
} = e, c = B.useRef(null), d = B.useRef(null), [p, m] = Lr({
|
|
2350
2355
|
prop: o,
|
|
2351
|
-
defaultProp: r,
|
|
2352
|
-
onChange: a
|
|
2356
|
+
defaultProp: r ?? !1,
|
|
2357
|
+
onChange: a,
|
|
2358
|
+
caller: rt
|
|
2353
2359
|
});
|
|
2354
2360
|
return /* @__PURE__ */ i(
|
|
2355
2361
|
ui,
|
|
@@ -2357,21 +2363,21 @@ var Ot = "Dialog", [zn, Ks] = Ir(Ot), [ui, le] = zn(Ot), Dn = (e) => {
|
|
|
2357
2363
|
scope: t,
|
|
2358
2364
|
triggerRef: c,
|
|
2359
2365
|
contentRef: d,
|
|
2360
|
-
contentId:
|
|
2361
|
-
titleId:
|
|
2362
|
-
descriptionId:
|
|
2363
|
-
open:
|
|
2364
|
-
onOpenChange:
|
|
2365
|
-
onOpenToggle: B.useCallback(() =>
|
|
2366
|
+
contentId: lt(),
|
|
2367
|
+
titleId: lt(),
|
|
2368
|
+
descriptionId: lt(),
|
|
2369
|
+
open: p,
|
|
2370
|
+
onOpenChange: m,
|
|
2371
|
+
onOpenToggle: B.useCallback(() => m((v) => !v), [m]),
|
|
2366
2372
|
modal: l,
|
|
2367
2373
|
children: n
|
|
2368
2374
|
}
|
|
2369
2375
|
);
|
|
2370
2376
|
};
|
|
2371
|
-
|
|
2377
|
+
zn.displayName = rt;
|
|
2372
2378
|
var An = "DialogTrigger", pi = B.forwardRef(
|
|
2373
2379
|
(e, t) => {
|
|
2374
|
-
const { __scopeDialog: n, ...o } = e, r = le(An, n), a =
|
|
2380
|
+
const { __scopeDialog: n, ...o } = e, r = le(An, n), a = yt(t, r.triggerRef);
|
|
2375
2381
|
return /* @__PURE__ */ i(
|
|
2376
2382
|
qe.button,
|
|
2377
2383
|
{
|
|
@@ -2388,27 +2394,27 @@ var An = "DialogTrigger", pi = B.forwardRef(
|
|
|
2388
2394
|
}
|
|
2389
2395
|
);
|
|
2390
2396
|
pi.displayName = An;
|
|
2391
|
-
var
|
|
2397
|
+
var Dt = "DialogPortal", [hi, Fn] = Dn(Dt, {
|
|
2392
2398
|
forceMount: void 0
|
|
2393
2399
|
}), Wn = (e) => {
|
|
2394
|
-
const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, a = le(
|
|
2395
|
-
return /* @__PURE__ */ i(hi, { scope: t, forceMount: n, children: B.Children.map(o, (l) => /* @__PURE__ */ i(
|
|
2400
|
+
const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, a = le(Dt, t);
|
|
2401
|
+
return /* @__PURE__ */ i(hi, { scope: t, forceMount: n, children: B.Children.map(o, (l) => /* @__PURE__ */ i(St, { present: n || a.open, children: /* @__PURE__ */ i(Ar, { asChild: !0, container: r, children: l }) })) });
|
|
2396
2402
|
};
|
|
2397
|
-
Wn.displayName =
|
|
2403
|
+
Wn.displayName = Dt;
|
|
2398
2404
|
var Je = "DialogOverlay", kn = B.forwardRef(
|
|
2399
2405
|
(e, t) => {
|
|
2400
2406
|
const n = Fn(Je, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, a = le(Je, e.__scopeDialog);
|
|
2401
|
-
return a.modal ? /* @__PURE__ */ i(
|
|
2407
|
+
return a.modal ? /* @__PURE__ */ i(St, { present: o || a.open, children: /* @__PURE__ */ i(fi, { ...r, ref: t }) }) : null;
|
|
2402
2408
|
}
|
|
2403
2409
|
);
|
|
2404
2410
|
kn.displayName = Je;
|
|
2405
|
-
var fi = B.forwardRef(
|
|
2411
|
+
var mi = Nr("DialogOverlay.RemoveScroll"), fi = B.forwardRef(
|
|
2406
2412
|
(e, t) => {
|
|
2407
2413
|
const { __scopeDialog: n, ...o } = e, r = le(Je, n);
|
|
2408
2414
|
return (
|
|
2409
2415
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
2410
2416
|
// ie. when `Overlay` and `Content` are siblings
|
|
2411
|
-
/* @__PURE__ */ i(Or, { as:
|
|
2417
|
+
/* @__PURE__ */ i(Or, { as: mi, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
|
|
2412
2418
|
qe.div,
|
|
2413
2419
|
{
|
|
2414
2420
|
"data-state": At(r.open),
|
|
@@ -2422,13 +2428,13 @@ var fi = B.forwardRef(
|
|
|
2422
2428
|
), Le = "DialogContent", Mn = B.forwardRef(
|
|
2423
2429
|
(e, t) => {
|
|
2424
2430
|
const n = Fn(Le, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, a = le(Le, e.__scopeDialog);
|
|
2425
|
-
return /* @__PURE__ */ i(
|
|
2431
|
+
return /* @__PURE__ */ i(St, { present: o || a.open, children: a.modal ? /* @__PURE__ */ i(gi, { ...r, ref: t }) : /* @__PURE__ */ i(vi, { ...r, ref: t }) });
|
|
2426
2432
|
}
|
|
2427
2433
|
);
|
|
2428
2434
|
Mn.displayName = Le;
|
|
2429
|
-
var
|
|
2435
|
+
var gi = B.forwardRef(
|
|
2430
2436
|
(e, t) => {
|
|
2431
|
-
const n = le(Le, e.__scopeDialog), o = B.useRef(null), r =
|
|
2437
|
+
const n = le(Le, e.__scopeDialog), o = B.useRef(null), r = yt(t, n.contentRef, o);
|
|
2432
2438
|
return B.useEffect(() => {
|
|
2433
2439
|
const a = o.current;
|
|
2434
2440
|
if (a)
|
|
@@ -2455,7 +2461,7 @@ var mi = B.forwardRef(
|
|
|
2455
2461
|
}
|
|
2456
2462
|
);
|
|
2457
2463
|
}
|
|
2458
|
-
),
|
|
2464
|
+
), vi = B.forwardRef(
|
|
2459
2465
|
(e, t) => {
|
|
2460
2466
|
const n = le(Le, e.__scopeDialog), o = B.useRef(!1), r = B.useRef(!1);
|
|
2461
2467
|
return /* @__PURE__ */ i(
|
|
@@ -2470,20 +2476,20 @@ var mi = B.forwardRef(
|
|
|
2470
2476
|
(l = e.onCloseAutoFocus) == null || l.call(e, a), a.defaultPrevented || (o.current || (c = n.triggerRef.current) == null || c.focus(), a.preventDefault()), o.current = !1, r.current = !1;
|
|
2471
2477
|
},
|
|
2472
2478
|
onInteractOutside: (a) => {
|
|
2473
|
-
var d,
|
|
2479
|
+
var d, p;
|
|
2474
2480
|
(d = e.onInteractOutside) == null || d.call(e, a), a.defaultPrevented || (o.current = !0, a.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
2475
2481
|
const l = a.target;
|
|
2476
|
-
((
|
|
2482
|
+
((p = n.triggerRef.current) == null ? void 0 : p.contains(l)) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && r.current && a.preventDefault();
|
|
2477
2483
|
}
|
|
2478
2484
|
}
|
|
2479
2485
|
);
|
|
2480
2486
|
}
|
|
2481
2487
|
), Hn = B.forwardRef(
|
|
2482
2488
|
(e, t) => {
|
|
2483
|
-
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: a, ...l } = e, c = le(Le, n), d = B.useRef(null),
|
|
2484
|
-
return
|
|
2489
|
+
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: a, ...l } = e, c = le(Le, n), d = B.useRef(null), p = yt(t, d);
|
|
2490
|
+
return Dr(), /* @__PURE__ */ z(ie, { children: [
|
|
2485
2491
|
/* @__PURE__ */ i(
|
|
2486
|
-
|
|
2492
|
+
zr,
|
|
2487
2493
|
{
|
|
2488
2494
|
asChild: !0,
|
|
2489
2495
|
loop: !0,
|
|
@@ -2499,32 +2505,32 @@ var mi = B.forwardRef(
|
|
|
2499
2505
|
"aria-labelledby": c.titleId,
|
|
2500
2506
|
"data-state": At(c.open),
|
|
2501
2507
|
...l,
|
|
2502
|
-
ref:
|
|
2508
|
+
ref: p,
|
|
2503
2509
|
onDismiss: () => c.onOpenChange(!1)
|
|
2504
2510
|
}
|
|
2505
2511
|
)
|
|
2506
2512
|
}
|
|
2507
2513
|
),
|
|
2508
|
-
/* @__PURE__ */
|
|
2509
|
-
/* @__PURE__ */ i(
|
|
2510
|
-
/* @__PURE__ */ i(
|
|
2514
|
+
/* @__PURE__ */ z(ie, { children: [
|
|
2515
|
+
/* @__PURE__ */ i(_i, { titleId: c.titleId }),
|
|
2516
|
+
/* @__PURE__ */ i(Ci, { contentRef: d, descriptionId: c.descriptionId })
|
|
2511
2517
|
] })
|
|
2512
2518
|
] });
|
|
2513
2519
|
}
|
|
2514
|
-
),
|
|
2520
|
+
), zt = "DialogTitle", $n = B.forwardRef(
|
|
2515
2521
|
(e, t) => {
|
|
2516
|
-
const { __scopeDialog: n, ...o } = e, r = le(
|
|
2522
|
+
const { __scopeDialog: n, ...o } = e, r = le(zt, n);
|
|
2517
2523
|
return /* @__PURE__ */ i(qe.h2, { id: r.titleId, ...o, ref: t });
|
|
2518
2524
|
}
|
|
2519
2525
|
);
|
|
2520
|
-
$n.displayName =
|
|
2521
|
-
var Gn = "DialogDescription",
|
|
2526
|
+
$n.displayName = zt;
|
|
2527
|
+
var Gn = "DialogDescription", wi = B.forwardRef(
|
|
2522
2528
|
(e, t) => {
|
|
2523
2529
|
const { __scopeDialog: n, ...o } = e, r = le(Gn, n);
|
|
2524
2530
|
return /* @__PURE__ */ i(qe.p, { id: r.descriptionId, ...o, ref: t });
|
|
2525
2531
|
}
|
|
2526
2532
|
);
|
|
2527
|
-
|
|
2533
|
+
wi.displayName = Gn;
|
|
2528
2534
|
var Un = "DialogClose", Vn = B.forwardRef(
|
|
2529
2535
|
(e, t) => {
|
|
2530
2536
|
const { __scopeDialog: n, ...o } = e, r = le(Un, n);
|
|
@@ -2543,11 +2549,11 @@ Vn.displayName = Un;
|
|
|
2543
2549
|
function At(e) {
|
|
2544
2550
|
return e ? "open" : "closed";
|
|
2545
2551
|
}
|
|
2546
|
-
var qn = "DialogTitleWarning", [
|
|
2552
|
+
var qn = "DialogTitleWarning", [Ys, Bn] = Rr(qn, {
|
|
2547
2553
|
contentName: Le,
|
|
2548
|
-
titleName:
|
|
2554
|
+
titleName: zt,
|
|
2549
2555
|
docsSlug: "dialog"
|
|
2550
|
-
}),
|
|
2556
|
+
}), _i = ({ titleId: e }) => {
|
|
2551
2557
|
const t = Bn(qn), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2552
2558
|
|
|
2553
2559
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
@@ -2556,14 +2562,14 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
2556
2562
|
return B.useEffect(() => {
|
|
2557
2563
|
e && (document.getElementById(e) || console.error(n));
|
|
2558
2564
|
}, [n, e]), null;
|
|
2559
|
-
},
|
|
2560
|
-
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Bn(
|
|
2565
|
+
}, bi = "DialogDescriptionWarning", Ci = ({ contentRef: e, descriptionId: t }) => {
|
|
2566
|
+
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Bn(bi).contentName}}.`;
|
|
2561
2567
|
return B.useEffect(() => {
|
|
2562
2568
|
var a;
|
|
2563
2569
|
const r = (a = e.current) == null ? void 0 : a.getAttribute("aria-describedby");
|
|
2564
2570
|
t && r && (document.getElementById(t) || console.warn(o));
|
|
2565
2571
|
}, [o, e, t]), null;
|
|
2566
|
-
},
|
|
2572
|
+
}, Pi = zn, Ti = Wn, yi = kn, Si = Mn, xi = $n, Ii = Vn;
|
|
2567
2573
|
const Ie = {
|
|
2568
2574
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2569
2575
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
@@ -2572,7 +2578,7 @@ const Ie = {
|
|
|
2572
2578
|
"rp-dialog-title": "_rp-dialog-title_slqo7_39",
|
|
2573
2579
|
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2574
2580
|
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2575
|
-
},
|
|
2581
|
+
}, Ri = () => {
|
|
2576
2582
|
const { pdfProperties: e } = X(), { container: t } = se(), { activeDocumentProperties: n, setActiveDocumentProperties: o } = Gr(), { localeMessages: r } = ce(), a = M(() => {
|
|
2577
2583
|
if (!e)
|
|
2578
2584
|
return [];
|
|
@@ -2580,23 +2586,23 @@ const Ie = {
|
|
|
2580
2586
|
fileSize: l,
|
|
2581
2587
|
filename: c,
|
|
2582
2588
|
title: d,
|
|
2583
|
-
author:
|
|
2584
|
-
subject:
|
|
2589
|
+
author: p,
|
|
2590
|
+
subject: m,
|
|
2585
2591
|
createdOn: v,
|
|
2586
2592
|
creator: h,
|
|
2587
2593
|
keywords: w,
|
|
2588
|
-
modifiedOn:
|
|
2589
|
-
pdfProducer:
|
|
2590
|
-
pdfVersion:
|
|
2591
|
-
pageCount:
|
|
2594
|
+
modifiedOn: P,
|
|
2595
|
+
pdfProducer: y,
|
|
2596
|
+
pdfVersion: C,
|
|
2597
|
+
pageCount: S
|
|
2592
2598
|
} = e;
|
|
2593
2599
|
return [
|
|
2594
2600
|
{ label: r == null ? void 0 : r.propertiesFilenameLabel, value: c },
|
|
2595
2601
|
{ label: r == null ? void 0 : r.propertiesFileSizeLabel, value: l },
|
|
2596
2602
|
{ separate: !0 },
|
|
2597
2603
|
{ label: r == null ? void 0 : r.propertiesTitleLabel, value: d },
|
|
2598
|
-
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value:
|
|
2599
|
-
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value:
|
|
2604
|
+
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value: p },
|
|
2605
|
+
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value: m },
|
|
2600
2606
|
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value: w },
|
|
2601
2607
|
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value: h },
|
|
2602
2608
|
{
|
|
@@ -2605,27 +2611,27 @@ const Ie = {
|
|
|
2605
2611
|
},
|
|
2606
2612
|
{
|
|
2607
2613
|
label: r == null ? void 0 : r.propertiesModifiedOnLabel,
|
|
2608
|
-
value:
|
|
2614
|
+
value: P ? Mt(P) : ""
|
|
2609
2615
|
},
|
|
2610
2616
|
{ separate: !0 },
|
|
2611
|
-
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value:
|
|
2612
|
-
{ label: r == null ? void 0 : r.propertiesPDFVersionLabel, value:
|
|
2613
|
-
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value:
|
|
2617
|
+
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value: y },
|
|
2618
|
+
{ label: r == null ? void 0 : r.propertiesPDFVersionLabel, value: C },
|
|
2619
|
+
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value: S }
|
|
2614
2620
|
];
|
|
2615
2621
|
}, [e, r]);
|
|
2616
|
-
return /* @__PURE__ */ i(
|
|
2617
|
-
/* @__PURE__ */ i(
|
|
2618
|
-
/* @__PURE__ */
|
|
2619
|
-
/* @__PURE__ */ i(
|
|
2622
|
+
return /* @__PURE__ */ i(Pi, { open: n, onOpenChange: o, children: /* @__PURE__ */ i(Ti, { container: t, children: /* @__PURE__ */ z("div", { className: Ie["rp-dialog-wrapper"], children: [
|
|
2623
|
+
/* @__PURE__ */ i(yi, { className: Ie["rp-dialog-overlay"] }),
|
|
2624
|
+
/* @__PURE__ */ z(Si, { className: Ie["rp-document-dialog"], children: [
|
|
2625
|
+
/* @__PURE__ */ i(xi, { className: Ie["rp-dialog-title"], children: r == null ? void 0 : r.documentPropertiesLabel }),
|
|
2620
2626
|
/* @__PURE__ */ i("div", { className: Ie["rp-document-properties"], children: a.map((l, c) => /* @__PURE__ */ i("div", { children: l.separate ? /* @__PURE__ */ i("div", { className: Ie["rp-properties-divider"] }) : /* @__PURE__ */ i(Ur, { label: l.label, value: l.value }) }, c)) }),
|
|
2621
|
-
/* @__PURE__ */ i(
|
|
2627
|
+
/* @__PURE__ */ i(Ii, { asChild: !0, className: Ie["rp-dialog-close"], children: /* @__PURE__ */ i(Wr, {}) })
|
|
2622
2628
|
] })
|
|
2623
2629
|
] }) }) });
|
|
2624
|
-
},
|
|
2630
|
+
}, Li = {
|
|
2625
2631
|
"rp-other-tool-content": "_rp-other-tool-content_su718_1"
|
|
2626
|
-
}, sn = ".pdf",
|
|
2632
|
+
}, sn = ".pdf", Ni = (e) => URL.createObjectURL(e), Ei = async (e) => {
|
|
2627
2633
|
const n = await (await fetch(e)).blob();
|
|
2628
|
-
return
|
|
2634
|
+
return Ni(n);
|
|
2629
2635
|
}, Zn = () => {
|
|
2630
2636
|
const { filename: e, pdfSrc: t } = X(), { downloadFilename: n } = Pr(), o = (a) => {
|
|
2631
2637
|
const l = n || a;
|
|
@@ -2635,26 +2641,26 @@ const Ie = {
|
|
|
2635
2641
|
if (!e || !t)
|
|
2636
2642
|
throw new Error("There is no PDF source to download");
|
|
2637
2643
|
const a = document.createElement("a");
|
|
2638
|
-
a.href = await
|
|
2644
|
+
a.href = await Ei(t), a.download = o(e), document.body.appendChild(a), a.click(), document.body.removeChild(a);
|
|
2639
2645
|
}, [e, t]) };
|
|
2640
2646
|
}, jn = () => {
|
|
2641
2647
|
const { downloadIcon: e } = he();
|
|
2642
2648
|
return e || /* @__PURE__ */ i(jr, {});
|
|
2643
|
-
}, Kn = ({ children: e, className: t, localeMessages: n }) => /* @__PURE__ */ i(K, { className: t, content: n == null ? void 0 : n.downloadFileTooltip, children: e }),
|
|
2649
|
+
}, Kn = ({ children: e, className: t, localeMessages: n }) => /* @__PURE__ */ i(K, { className: t, content: n == null ? void 0 : n.downloadFileTooltip, children: e }), Oi = ({ download: e, localeMessages: t }) => /* @__PURE__ */ i(Kn, { localeMessages: t, children: /* @__PURE__ */ i(re, { onClick: e, "aria-label": t == null ? void 0 : t.downloadFileTooltip, children: /* @__PURE__ */ i(jn, {}) }) }), Di = ({ download: e, localeMessages: t }) => /* @__PURE__ */ i(Ce, { onClick: e, children: /* @__PURE__ */ z(Kn, { className: "rp-menu-item", localeMessages: t, children: [
|
|
2644
2650
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(jn, {}) }),
|
|
2645
2651
|
t == null ? void 0 : t.downloadFileLabel
|
|
2646
2652
|
] }) }), Xn = () => {
|
|
2647
|
-
const { download: e } = Zn(), { downloadTool: t = !0 } =
|
|
2648
|
-
return t ? n ? /* @__PURE__ */ i(
|
|
2653
|
+
const { download: e } = Zn(), { downloadTool: t = !0 } = me(), { isSmallScreen: n } = Pe(), { localeMessages: o } = ce();
|
|
2654
|
+
return t ? n ? /* @__PURE__ */ i(Di, { download: e, localeMessages: o }) : typeof t == "function" ? /* @__PURE__ */ i(t, { download: e }) : t ? /* @__PURE__ */ i(Oi, { download: e, localeMessages: o }) : null : null;
|
|
2649
2655
|
}, Yn = () => {
|
|
2650
2656
|
const { printIcon: e } = he();
|
|
2651
2657
|
return e || /* @__PURE__ */ i(Kr, {});
|
|
2652
|
-
}, Jn = ({ children: e, className: t, localeMessages: n }) => /* @__PURE__ */ i(K, { className: t, content: n == null ? void 0 : n.printTooltip, children: e }), zi = ({ print: e, localeMessages: t }) => /* @__PURE__ */ i(Jn, { localeMessages: t, children: /* @__PURE__ */ i(re, { onClick: e, "aria-label": t == null ? void 0 : t.printTooltip, children: /* @__PURE__ */ i(Yn, {}) }) }),
|
|
2658
|
+
}, Jn = ({ children: e, className: t, localeMessages: n }) => /* @__PURE__ */ i(K, { className: t, content: n == null ? void 0 : n.printTooltip, children: e }), zi = ({ print: e, localeMessages: t }) => /* @__PURE__ */ i(Jn, { localeMessages: t, children: /* @__PURE__ */ i(re, { onClick: e, "aria-label": t == null ? void 0 : t.printTooltip, children: /* @__PURE__ */ i(Yn, {}) }) }), Ai = ({ print: e, localeMessages: t }) => /* @__PURE__ */ i(Ce, { onClick: e, children: /* @__PURE__ */ z(Jn, { className: "rp-menu-item", localeMessages: t, children: [
|
|
2653
2659
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Yn, {}) }),
|
|
2654
2660
|
t == null ? void 0 : t.printLabel
|
|
2655
2661
|
] }) }), Qn = () => {
|
|
2656
|
-
const { print: e, cancel: t, setOnProgress: n, setOnComplete: o, setOnError: r, progress: a } = Be(), { printTool: l = !0 } =
|
|
2657
|
-
return l ? c ? /* @__PURE__ */ i(
|
|
2662
|
+
const { print: e, cancel: t, setOnProgress: n, setOnComplete: o, setOnError: r, progress: a } = Be(), { printTool: l = !0 } = me(), { isSmallScreen: c } = Pe(), { localeMessages: d } = ce();
|
|
2663
|
+
return l ? c ? /* @__PURE__ */ i(Ai, { print: e, localeMessages: d }) : typeof l == "function" ? /* @__PURE__ */ i(
|
|
2658
2664
|
l,
|
|
2659
2665
|
{
|
|
2660
2666
|
print: e,
|
|
@@ -2665,32 +2671,32 @@ const Ie = {
|
|
|
2665
2671
|
progress: a
|
|
2666
2672
|
}
|
|
2667
2673
|
) : l ? /* @__PURE__ */ i(zi, { print: e, localeMessages: d }) : null : null;
|
|
2668
|
-
},
|
|
2674
|
+
}, Fi = {
|
|
2669
2675
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2670
|
-
}, Fi = () => {
|
|
2671
|
-
const { goToFirstPageIcon: e } = he();
|
|
2672
|
-
return e || /* @__PURE__ */ i(yn, { className: Ai["rp-go-to-Top"] });
|
|
2673
2676
|
}, Wi = () => {
|
|
2677
|
+
const { goToFirstPageIcon: e } = he();
|
|
2678
|
+
return e || /* @__PURE__ */ i(yn, { className: Fi["rp-go-to-Top"] });
|
|
2679
|
+
}, ki = () => {
|
|
2674
2680
|
const { goToLastPageIcon: e } = he();
|
|
2675
2681
|
return e || /* @__PURE__ */ i(yn, {});
|
|
2676
|
-
}, cn = { width: "100%" },
|
|
2677
|
-
const { goToPage: e, totalPages: t, focusedPage: n } = ae(), { jumpNavigationTool: o = !0 } =
|
|
2682
|
+
}, cn = { width: "100%" }, Mi = () => {
|
|
2683
|
+
const { goToPage: e, totalPages: t, focusedPage: n } = ae(), { jumpNavigationTool: o = !0 } = me(), { localeMessages: r } = ce(), a = M(() => n === 1, [n]), l = M(() => n === t, [n, t]), c = E(() => {
|
|
2678
2684
|
e(1);
|
|
2679
2685
|
}, [e]), d = E(() => {
|
|
2680
2686
|
e(t);
|
|
2681
2687
|
}, [e, t]);
|
|
2682
|
-
return o ? /* @__PURE__ */
|
|
2683
|
-
/* @__PURE__ */ i(Ce, { onClick: c, children: /* @__PURE__ */ i(K, { content: r == null ? void 0 : r.firstPageTooltip, style: cn, children: /* @__PURE__ */
|
|
2684
|
-
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(
|
|
2688
|
+
return o ? /* @__PURE__ */ z(Ye, { children: [
|
|
2689
|
+
/* @__PURE__ */ i(Ce, { onClick: c, children: /* @__PURE__ */ i(K, { content: r == null ? void 0 : r.firstPageTooltip, style: cn, children: /* @__PURE__ */ z("div", { className: "rp-menu-item", "aria-disabled": a, children: [
|
|
2690
|
+
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Wi, {}) }),
|
|
2685
2691
|
/* @__PURE__ */ i("span", { children: r == null ? void 0 : r.firstPageLabel })
|
|
2686
2692
|
] }) }) }),
|
|
2687
|
-
/* @__PURE__ */ i(Ce, { onClick: d, children: /* @__PURE__ */ i(K, { content: r == null ? void 0 : r.lastPageTooltip, style: cn, children: /* @__PURE__ */
|
|
2688
|
-
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(
|
|
2693
|
+
/* @__PURE__ */ i(Ce, { onClick: d, children: /* @__PURE__ */ i(K, { content: r == null ? void 0 : r.lastPageTooltip, style: cn, children: /* @__PURE__ */ z("div", { className: "rp-menu-item", "aria-disabled": l, children: [
|
|
2694
|
+
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(ki, {}) }),
|
|
2689
2695
|
/* @__PURE__ */ i("span", { children: r == null ? void 0 : r.lastPageLabel })
|
|
2690
2696
|
] }) }) }),
|
|
2691
|
-
/* @__PURE__ */ i(
|
|
2697
|
+
/* @__PURE__ */ i(It, {})
|
|
2692
2698
|
] }) : null;
|
|
2693
|
-
},
|
|
2699
|
+
}, Hi = () => {
|
|
2694
2700
|
const { container: e, pagesRef: t } = se(), { isSmallScreen: n } = Pe(), {
|
|
2695
2701
|
openFileTool: o,
|
|
2696
2702
|
downloadTool: r,
|
|
@@ -2698,17 +2704,17 @@ const Ie = {
|
|
|
2698
2704
|
scrollModeTool: l,
|
|
2699
2705
|
rotateTool: c,
|
|
2700
2706
|
selectionModeTool: d,
|
|
2701
|
-
jumpNavigationTool:
|
|
2702
|
-
printTool:
|
|
2707
|
+
jumpNavigationTool: p,
|
|
2708
|
+
printTool: m,
|
|
2703
2709
|
fullscreenTool: v
|
|
2704
|
-
} =
|
|
2705
|
-
new ResizeObserver((
|
|
2706
|
-
|
|
2710
|
+
} = me(), { localeMessages: h } = ce(), [w, P] = G(0), y = H(
|
|
2711
|
+
new ResizeObserver((S) => {
|
|
2712
|
+
P(S[0].contentRect.height);
|
|
2707
2713
|
})
|
|
2708
|
-
),
|
|
2709
|
-
const
|
|
2710
|
-
let
|
|
2711
|
-
return n && (
|
|
2714
|
+
), C = M(() => {
|
|
2715
|
+
const S = p || c || d || l || a;
|
|
2716
|
+
let g = !1;
|
|
2717
|
+
return n && (g = !(!o && !r && !m && !v)), S || g;
|
|
2712
2718
|
}, [
|
|
2713
2719
|
o,
|
|
2714
2720
|
r,
|
|
@@ -2716,12 +2722,12 @@ const Ie = {
|
|
|
2716
2722
|
l,
|
|
2717
2723
|
c,
|
|
2718
2724
|
d,
|
|
2719
|
-
|
|
2725
|
+
p,
|
|
2720
2726
|
n
|
|
2721
2727
|
]);
|
|
2722
|
-
return W(() => (t &&
|
|
2723
|
-
|
|
2724
|
-
}), [t]),
|
|
2728
|
+
return W(() => (t && y.current.observe(t), () => {
|
|
2729
|
+
y.current.disconnect();
|
|
2730
|
+
}), [t]), C ? /* @__PURE__ */ z(ie, { children: [
|
|
2725
2731
|
/* @__PURE__ */ i(
|
|
2726
2732
|
bn,
|
|
2727
2733
|
{
|
|
@@ -2729,21 +2735,21 @@ const Ie = {
|
|
|
2729
2735
|
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content: h == null ? void 0 : h.moreOptionTooltip, children: /* @__PURE__ */ i(re, { "aria-label": h == null ? void 0 : h.moreOptionTooltip, children: /* @__PURE__ */ i(xr, {}) }) }) }),
|
|
2730
2736
|
side: "bottom",
|
|
2731
2737
|
avoidCollisions: !1,
|
|
2732
|
-
children: /* @__PURE__ */
|
|
2738
|
+
children: /* @__PURE__ */ z(
|
|
2733
2739
|
"div",
|
|
2734
2740
|
{
|
|
2735
2741
|
style: { maxHeight: `${w}px`, overflow: "auto" },
|
|
2736
|
-
className:
|
|
2742
|
+
className: Li["rp-other-tool-content"],
|
|
2737
2743
|
"data-rp": "moreOptionsDropdown",
|
|
2738
2744
|
children: [
|
|
2739
|
-
n && /* @__PURE__ */
|
|
2745
|
+
n && /* @__PURE__ */ z(Ye, { children: [
|
|
2740
2746
|
/* @__PURE__ */ i(_n, {}),
|
|
2741
2747
|
/* @__PURE__ */ i(Xn, {}),
|
|
2742
2748
|
/* @__PURE__ */ i(Qn, {}),
|
|
2743
2749
|
/* @__PURE__ */ i(Tn, {}),
|
|
2744
|
-
/* @__PURE__ */ i(
|
|
2750
|
+
/* @__PURE__ */ i(It, {})
|
|
2745
2751
|
] }),
|
|
2746
|
-
/* @__PURE__ */ i(
|
|
2752
|
+
/* @__PURE__ */ i(Mi, {}),
|
|
2747
2753
|
/* @__PURE__ */ i(qr, {}),
|
|
2748
2754
|
/* @__PURE__ */ i(Xr, {}),
|
|
2749
2755
|
/* @__PURE__ */ i(Br, {}),
|
|
@@ -2754,95 +2760,95 @@ const Ie = {
|
|
|
2754
2760
|
)
|
|
2755
2761
|
}
|
|
2756
2762
|
),
|
|
2757
|
-
/* @__PURE__ */ i(
|
|
2763
|
+
/* @__PURE__ */ i(Ri, {})
|
|
2758
2764
|
] }) : null;
|
|
2759
|
-
},
|
|
2765
|
+
}, $i = () => {
|
|
2760
2766
|
const { isSmallScreen: e } = Pe();
|
|
2761
|
-
return /* @__PURE__ */
|
|
2767
|
+
return /* @__PURE__ */ z(ie, { children: [
|
|
2762
2768
|
/* @__PURE__ */ i(Sr, {}),
|
|
2763
|
-
!e && /* @__PURE__ */
|
|
2769
|
+
!e && /* @__PURE__ */ z(ie, { children: [
|
|
2764
2770
|
/* @__PURE__ */ i(_n, {}),
|
|
2765
2771
|
/* @__PURE__ */ i(Xn, {}),
|
|
2766
2772
|
/* @__PURE__ */ i(Qn, {}),
|
|
2767
2773
|
/* @__PURE__ */ i(Tn, {})
|
|
2768
2774
|
] }),
|
|
2769
|
-
/* @__PURE__ */ i(
|
|
2775
|
+
/* @__PURE__ */ i(Hi, {})
|
|
2770
2776
|
] });
|
|
2771
|
-
},
|
|
2777
|
+
}, De = {
|
|
2772
2778
|
"rp-zoom-wrapper": "_rp-zoom-wrapper_1113m_1",
|
|
2773
2779
|
"rp-current-zoom-wrapper": "_rp-current-zoom-wrapper_1113m_6",
|
|
2774
2780
|
"rp-current-zoom-icon": "_rp-current-zoom-icon_1113m_11",
|
|
2775
2781
|
"rp-zoom-level-icon": "_rp-zoom-level-icon_1113m_16",
|
|
2776
2782
|
"rp-current-zoom-text": "_rp-current-zoom-text_1113m_20",
|
|
2777
2783
|
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_1113m_24"
|
|
2778
|
-
},
|
|
2784
|
+
}, Gi = 25, vt = 1e3, Ui = [50, 75, 100, 125, 150, 200, 300, 400], Vi = () => {
|
|
2779
2785
|
const { zoomInIcon: e } = he();
|
|
2780
2786
|
return e || /* @__PURE__ */ i(Yr, {});
|
|
2781
|
-
},
|
|
2787
|
+
}, qi = () => {
|
|
2782
2788
|
const { zoomOutIcon: e } = he();
|
|
2783
2789
|
return e || /* @__PURE__ */ i(Jr, {});
|
|
2784
|
-
},
|
|
2785
|
-
const { zoomLevel: e, setZoomLevel: t } = tt(), { container: n, pagesRef: o } = se(), { zoomTool: r = !0 } =
|
|
2790
|
+
}, Bi = () => {
|
|
2791
|
+
const { zoomLevel: e, setZoomLevel: t } = tt(), { container: n, pagesRef: o } = se(), { zoomTool: r = !0 } = me(), { focusedPage: a } = ae(), { pageRotate: l } = Ve(), { pages: c } = X(), { isSmallScreen: d } = Pe(), { localeMessages: p } = ce(), { viewMode: m } = Ee(), [v, h] = G(0), w = H(
|
|
2786
2792
|
new ResizeObserver((s) => {
|
|
2787
2793
|
h(s[0].contentRect.height);
|
|
2788
2794
|
})
|
|
2789
|
-
),
|
|
2795
|
+
), P = E(() => {
|
|
2790
2796
|
t((s) => {
|
|
2791
2797
|
const _ = Math.floor(s / 25) * 25;
|
|
2792
|
-
return Math.min(_ + 25,
|
|
2798
|
+
return Math.min(_ + 25, vt);
|
|
2793
2799
|
});
|
|
2794
|
-
}, [t]),
|
|
2800
|
+
}, [t]), y = E(() => {
|
|
2795
2801
|
t((s) => {
|
|
2796
2802
|
const _ = Math.ceil(s / 25) * 25;
|
|
2797
|
-
return Math.min(_ - 25,
|
|
2803
|
+
return Math.min(_ - 25, vt);
|
|
2798
2804
|
});
|
|
2799
|
-
}, [t]),
|
|
2805
|
+
}, [t]), C = M(() => e <= Gi, [e]), S = M(() => e >= vt, [e]), g = M(() => {
|
|
2800
2806
|
const s = c.get(a);
|
|
2801
2807
|
return s ? s.page.getViewport({ scale: 1, rotation: l[a] }) : null;
|
|
2802
|
-
}, [c, a, l]),
|
|
2808
|
+
}, [c, a, l]), u = E(
|
|
2803
2809
|
(s) => {
|
|
2804
|
-
const _ = ((
|
|
2810
|
+
const _ = ((g == null ? void 0 : g.width) || 0) + 2 * Gt, b = ((g == null ? void 0 : g.height) || 0) + 2 * Gt, T = (o == null ? void 0 : o.clientWidth) || 0, L = (o == null ? void 0 : o.clientHeight) || 0, x = Qr(
|
|
2805
2811
|
s,
|
|
2806
|
-
|
|
2812
|
+
T,
|
|
2807
2813
|
L,
|
|
2808
2814
|
_,
|
|
2809
|
-
|
|
2810
|
-
|
|
2815
|
+
b,
|
|
2816
|
+
m
|
|
2811
2817
|
);
|
|
2812
2818
|
t(x);
|
|
2813
2819
|
},
|
|
2814
|
-
[t,
|
|
2815
|
-
),
|
|
2820
|
+
[t, g, o]
|
|
2821
|
+
), f = E(
|
|
2816
2822
|
(s) => {
|
|
2817
|
-
typeof s == "number" ? t(s) :
|
|
2823
|
+
typeof s == "number" ? t(s) : u(s);
|
|
2818
2824
|
},
|
|
2819
|
-
[t,
|
|
2825
|
+
[t, u]
|
|
2820
2826
|
);
|
|
2821
2827
|
return W(() => (o && w.current.observe(o), () => {
|
|
2822
2828
|
w.current.disconnect();
|
|
2823
|
-
}), [o]), typeof r != "boolean" ? /* @__PURE__ */ i(r, { zoomLevel: e, setZoomLevel: t }) : r ? /* @__PURE__ */
|
|
2824
|
-
/* @__PURE__ */ i(K, { content:
|
|
2829
|
+
}), [o]), typeof r != "boolean" ? /* @__PURE__ */ i(r, { zoomLevel: e, setZoomLevel: t }) : r ? /* @__PURE__ */ z("div", { className: De["rp-zoom-wrapper"], children: [
|
|
2830
|
+
/* @__PURE__ */ i(K, { content: p == null ? void 0 : p.zoomOutTooltip, children: /* @__PURE__ */ i(
|
|
2825
2831
|
re,
|
|
2826
2832
|
{
|
|
2827
|
-
disabled:
|
|
2828
|
-
onClick:
|
|
2829
|
-
"aria-label":
|
|
2830
|
-
children: /* @__PURE__ */ i(
|
|
2833
|
+
disabled: C,
|
|
2834
|
+
onClick: y,
|
|
2835
|
+
"aria-label": p == null ? void 0 : p.zoomOutTooltip,
|
|
2836
|
+
children: /* @__PURE__ */ i(qi, {})
|
|
2831
2837
|
}
|
|
2832
2838
|
) }),
|
|
2833
2839
|
!d && /* @__PURE__ */ i(
|
|
2834
2840
|
bn,
|
|
2835
2841
|
{
|
|
2836
2842
|
container: n,
|
|
2837
|
-
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content:
|
|
2843
|
+
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content: p == null ? void 0 : p.zoomSelectTooltip, children: /* @__PURE__ */ z(
|
|
2838
2844
|
re,
|
|
2839
2845
|
{
|
|
2840
|
-
className:
|
|
2841
|
-
"aria-label":
|
|
2846
|
+
className: De["rp-current-zoom-wrapper"],
|
|
2847
|
+
"aria-label": p == null ? void 0 : p.zoomSelectTooltip,
|
|
2842
2848
|
children: [
|
|
2843
|
-
/* @__PURE__ */ i("span", { className:
|
|
2844
|
-
/* @__PURE__ */ i("span", { className:
|
|
2845
|
-
/* @__PURE__ */ i(Ge, { className:
|
|
2849
|
+
/* @__PURE__ */ i("span", { className: De["rp-current-zoom-text"], children: e }),
|
|
2850
|
+
/* @__PURE__ */ i("span", { className: De["rp-current-zoom-text"], children: "%" }),
|
|
2851
|
+
/* @__PURE__ */ i(Ge, { className: De["rp-current-zoom-icon"] })
|
|
2846
2852
|
]
|
|
2847
2853
|
}
|
|
2848
2854
|
) }) }),
|
|
@@ -2850,19 +2856,19 @@ const Ie = {
|
|
|
2850
2856
|
align: "center",
|
|
2851
2857
|
side: "bottom",
|
|
2852
2858
|
avoidCollisions: !1,
|
|
2853
|
-
children: /* @__PURE__ */
|
|
2859
|
+
children: /* @__PURE__ */ z(
|
|
2854
2860
|
"div",
|
|
2855
2861
|
{
|
|
2856
2862
|
style: { maxHeight: `${v}px`, overflow: "auto" },
|
|
2857
|
-
className:
|
|
2863
|
+
className: De["rp-zoom-dropdown-content"],
|
|
2858
2864
|
children: [
|
|
2859
|
-
/* @__PURE__ */
|
|
2860
|
-
/* @__PURE__ */ i(Ce, { onClick: () =>
|
|
2861
|
-
/* @__PURE__ */ i(Ce, { onClick: () =>
|
|
2862
|
-
/* @__PURE__ */ i(Ce, { onClick: () =>
|
|
2865
|
+
/* @__PURE__ */ z(Ye, { children: [
|
|
2866
|
+
/* @__PURE__ */ i(Ce, { onClick: () => f(ct.ACTUAL), children: p == null ? void 0 : p.zoomActualSize }),
|
|
2867
|
+
/* @__PURE__ */ i(Ce, { onClick: () => f(ct.PAGE_FIT), children: p == null ? void 0 : p.zoomPageFit }),
|
|
2868
|
+
/* @__PURE__ */ i(Ce, { onClick: () => f(ct.PAGE_WIDTH), children: p == null ? void 0 : p.zoomPageWidth })
|
|
2863
2869
|
] }),
|
|
2864
|
-
/* @__PURE__ */ i(
|
|
2865
|
-
/* @__PURE__ */ i(Ye, { children:
|
|
2870
|
+
/* @__PURE__ */ i(It, {}),
|
|
2871
|
+
/* @__PURE__ */ i(Ye, { children: Ui.map((s) => /* @__PURE__ */ z(Ce, { onClick: () => f(s), children: [
|
|
2866
2872
|
s,
|
|
2867
2873
|
" %"
|
|
2868
2874
|
] }, s)) })
|
|
@@ -2871,13 +2877,13 @@ const Ie = {
|
|
|
2871
2877
|
)
|
|
2872
2878
|
}
|
|
2873
2879
|
),
|
|
2874
|
-
/* @__PURE__ */ i(K, { content:
|
|
2880
|
+
/* @__PURE__ */ i(K, { content: p == null ? void 0 : p.zoomInTooltip, children: /* @__PURE__ */ i(
|
|
2875
2881
|
re,
|
|
2876
2882
|
{
|
|
2877
|
-
disabled:
|
|
2878
|
-
onClick:
|
|
2879
|
-
"aria-label":
|
|
2880
|
-
children: /* @__PURE__ */ i(
|
|
2883
|
+
disabled: S,
|
|
2884
|
+
onClick: P,
|
|
2885
|
+
"aria-label": p == null ? void 0 : p.zoomInTooltip,
|
|
2886
|
+
children: /* @__PURE__ */ i(Vi, {})
|
|
2881
2887
|
}
|
|
2882
2888
|
) })
|
|
2883
2889
|
] }) : null;
|
|
@@ -2886,8 +2892,8 @@ const Ie = {
|
|
|
2886
2892
|
totalMatches: e,
|
|
2887
2893
|
nextMatch: t,
|
|
2888
2894
|
prevMatch: n
|
|
2889
|
-
} =
|
|
2890
|
-
return /* @__PURE__ */
|
|
2895
|
+
} = Nt(), { localeMessages: o } = ce();
|
|
2896
|
+
return /* @__PURE__ */ z(ie, { children: [
|
|
2891
2897
|
/* @__PURE__ */ i(K, { content: o == null ? void 0 : o.searchPrevTooltip, className: Q["rp-search-tool-result-navigator"], children: /* @__PURE__ */ i(re, { onClick: n, "aria-label": o == null ? void 0 : o.searchPrevTooltip, children: /* @__PURE__ */ i(
|
|
2892
2898
|
Ge,
|
|
2893
2899
|
{
|
|
@@ -2907,45 +2913,45 @@ const Ie = {
|
|
|
2907
2913
|
}, dn = () => {
|
|
2908
2914
|
const { searchIcon: e } = he();
|
|
2909
2915
|
return e || /* @__PURE__ */ i(eo, {});
|
|
2910
|
-
},
|
|
2916
|
+
}, Zi = ({ icon: e }) => {
|
|
2911
2917
|
const { container: t } = se(), [n, o] = G(!1), { pdf: r } = X(), [a, l] = G(null), {
|
|
2912
2918
|
searchOptions: c,
|
|
2913
2919
|
setSearchOptions: d,
|
|
2914
|
-
loading:
|
|
2915
|
-
setSearch:
|
|
2920
|
+
loading: p,
|
|
2921
|
+
setSearch: m,
|
|
2916
2922
|
totalMatches: v,
|
|
2917
2923
|
currentMatchPosition: h,
|
|
2918
2924
|
nextMatch: w,
|
|
2919
|
-
prevMatch:
|
|
2920
|
-
search:
|
|
2921
|
-
} =
|
|
2925
|
+
prevMatch: P,
|
|
2926
|
+
search: y
|
|
2927
|
+
} = Nt(), { searchTool: C = !0 } = me(), [S, g] = G(y), { localeMessages: u } = ce(), { isSmallScreen: f } = Pe(), s = E(() => {
|
|
2922
2928
|
o(!0);
|
|
2923
2929
|
}, []), _ = E(() => {
|
|
2924
|
-
|
|
2925
|
-
}, [
|
|
2930
|
+
m(""), g(""), o(!1);
|
|
2931
|
+
}, [m]), b = (N) => {
|
|
2926
2932
|
const k = N.key === "Enter", $ = N.key === " ";
|
|
2927
2933
|
(k || $) && _();
|
|
2928
|
-
},
|
|
2934
|
+
}, T = E(
|
|
2929
2935
|
(N) => {
|
|
2930
2936
|
N.key === "Escape" && n && _();
|
|
2931
2937
|
},
|
|
2932
2938
|
[n]
|
|
2933
2939
|
), L = E(
|
|
2934
2940
|
(N) => {
|
|
2935
|
-
N.shiftKey && N.key === "Enter" ?
|
|
2941
|
+
N.shiftKey && N.key === "Enter" ? P() : N.key === "Enter" && y !== S ? m(S) : N.key === "Enter" && w();
|
|
2936
2942
|
},
|
|
2937
|
-
[
|
|
2943
|
+
[S, P, w, m, y]
|
|
2938
2944
|
);
|
|
2939
|
-
W(() => (window.addEventListener("keydown",
|
|
2940
|
-
window.removeEventListener("keydown",
|
|
2941
|
-
}), [
|
|
2945
|
+
W(() => (window.addEventListener("keydown", T), () => {
|
|
2946
|
+
window.removeEventListener("keydown", T);
|
|
2947
|
+
}), [T]), W(() => {
|
|
2942
2948
|
a && a.focus();
|
|
2943
2949
|
}, [a]);
|
|
2944
2950
|
const x = E((N) => {
|
|
2945
|
-
|
|
2951
|
+
g(N.target.value);
|
|
2946
2952
|
}, []), I = E(() => {
|
|
2947
|
-
|
|
2948
|
-
}, [
|
|
2953
|
+
g(""), m("");
|
|
2954
|
+
}, [m]), D = M(() => `${h} / ${v}`, [h, v]), { wholeWords: A, matchCase: F } = M(() => c, [c]), R = E(
|
|
2949
2955
|
(N) => {
|
|
2950
2956
|
d((k) => ({ ...k, matchCase: N }));
|
|
2951
2957
|
},
|
|
@@ -2958,84 +2964,84 @@ const Ie = {
|
|
|
2958
2964
|
);
|
|
2959
2965
|
return W(() => {
|
|
2960
2966
|
_();
|
|
2961
|
-
}, [r, _]),
|
|
2967
|
+
}, [r, _]), C ? /* @__PURE__ */ i(ie, { children: /* @__PURE__ */ i(
|
|
2962
2968
|
$r,
|
|
2963
2969
|
{
|
|
2964
2970
|
open: n,
|
|
2965
2971
|
container: t,
|
|
2966
|
-
triggerComponent: /* @__PURE__ */ i(K, { content:
|
|
2967
|
-
children: /* @__PURE__ */
|
|
2968
|
-
/* @__PURE__ */
|
|
2969
|
-
/* @__PURE__ */
|
|
2970
|
-
/* @__PURE__ */ i(K, { content:
|
|
2972
|
+
triggerComponent: /* @__PURE__ */ i(K, { content: u == null ? void 0 : u.searchButtonTooltip, children: /* @__PURE__ */ i(re, { onClick: s, "aria-label": u == null ? void 0 : u.searchButtonTooltip, children: e || /* @__PURE__ */ i(dn, {}) }) }),
|
|
2973
|
+
children: /* @__PURE__ */ z("div", { className: Q["rp-search-tool-content"], children: [
|
|
2974
|
+
/* @__PURE__ */ z("div", { className: Q["rp-search-tool-input-wrapper"], children: [
|
|
2975
|
+
/* @__PURE__ */ z("div", { className: Q["rp-search-tool-input"], children: [
|
|
2976
|
+
/* @__PURE__ */ i(K, { content: u == null ? void 0 : u.searchInputTooltip, children: /* @__PURE__ */ i(
|
|
2971
2977
|
wn,
|
|
2972
2978
|
{
|
|
2973
|
-
value:
|
|
2979
|
+
value: S,
|
|
2974
2980
|
onKeyDown: L,
|
|
2975
2981
|
onChange: x,
|
|
2976
2982
|
icon: /* @__PURE__ */ i(dn, {}),
|
|
2977
|
-
placeholder:
|
|
2983
|
+
placeholder: u == null ? void 0 : u.searchInputPlaceholder,
|
|
2978
2984
|
className: Q["rp-search-input"],
|
|
2979
2985
|
ref: l,
|
|
2980
|
-
children: !!
|
|
2986
|
+
children: !!S && /* @__PURE__ */ i("span", { className: Q["rp-search-tool-input-clear"], onClick: I, children: /* @__PURE__ */ i(to, {}) })
|
|
2981
2987
|
}
|
|
2982
2988
|
) }),
|
|
2983
|
-
|
|
2984
|
-
|
|
2989
|
+
p ? /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(xt, { className: Q["rp-search-loader-icon"] }) }) : /* @__PURE__ */ i("span", { children: D }),
|
|
2990
|
+
f && /* @__PURE__ */ i("div", { className: Q["rp-search-tool-controls"], children: /* @__PURE__ */ i(Ht, { onKeyPress: b, handleClose: _ }) })
|
|
2985
2991
|
] }),
|
|
2986
|
-
/* @__PURE__ */
|
|
2987
|
-
|
|
2988
|
-
/* @__PURE__ */ i($t, { name: "matchCase", value: F, onChange: R, children:
|
|
2989
|
-
!
|
|
2990
|
-
/* @__PURE__ */ i($t, { name: "wholeWord", value: A, onChange: O, children:
|
|
2991
|
-
!
|
|
2992
|
+
/* @__PURE__ */ z("div", { className: Q["rp-search-tool-input-checkboxes"], children: [
|
|
2993
|
+
f && /* @__PURE__ */ i(ln, {}),
|
|
2994
|
+
/* @__PURE__ */ i($t, { name: "matchCase", value: F, onChange: R, children: u == null ? void 0 : u.searchMatchCaseLabel }),
|
|
2995
|
+
!f && /* @__PURE__ */ i(K, { content: u == null ? void 0 : u.searchMatchCaseTooltip, children: /* @__PURE__ */ i("div", { className: Q["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(Ut, {}) }) }),
|
|
2996
|
+
/* @__PURE__ */ i($t, { name: "wholeWord", value: A, onChange: O, children: u == null ? void 0 : u.searchWholeWordsLabel }),
|
|
2997
|
+
!f && /* @__PURE__ */ i(K, { content: u == null ? void 0 : u.searchWholeWordsTooltip, children: /* @__PURE__ */ i("div", { className: Q["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(Ut, {}) }) })
|
|
2992
2998
|
] })
|
|
2993
2999
|
] }),
|
|
2994
|
-
!
|
|
3000
|
+
!f && /* @__PURE__ */ z("div", { className: Q["rp-search-tool-controls"], children: [
|
|
2995
3001
|
/* @__PURE__ */ i(ln, {}),
|
|
2996
|
-
/* @__PURE__ */ i(Ht, { onKeyPress:
|
|
3002
|
+
/* @__PURE__ */ i(Ht, { onKeyPress: b, handleClose: _ })
|
|
2997
3003
|
] })
|
|
2998
3004
|
] })
|
|
2999
3005
|
}
|
|
3000
3006
|
) }) : null;
|
|
3001
|
-
},
|
|
3007
|
+
}, ji = "_loading_wazy2_1", ze = {
|
|
3002
3008
|
"rp-loading-overlay": "_rp-loading-overlay_wazy2_1",
|
|
3003
3009
|
"rp-loading-modal": "_rp-loading-modal_wazy2_14",
|
|
3004
3010
|
"rp-loading-title": "_rp-loading-title_wazy2_27",
|
|
3005
3011
|
"rp-loading-progress-bar": "_rp-loading-progress-bar_wazy2_35",
|
|
3006
3012
|
"rp-loading-progress": "_rp-loading-progress_wazy2_35",
|
|
3007
3013
|
"rp-loading-cancel-button": "_rp-loading-cancel-button_wazy2_55",
|
|
3008
|
-
loading:
|
|
3014
|
+
loading: ji
|
|
3009
3015
|
}, er = ({ percentage: e }) => {
|
|
3010
3016
|
const { cancel: t } = Be(), { localeMessages: n } = ce();
|
|
3011
|
-
return e < 1 ? null : /* @__PURE__ */ i("div", { className: ne(
|
|
3012
|
-
/* @__PURE__ */
|
|
3017
|
+
return e < 1 ? null : /* @__PURE__ */ i("div", { className: ne(ze["rp-loading-overlay"]), children: /* @__PURE__ */ z("div", { className: ne(ze["rp-loading-modal"]), children: [
|
|
3018
|
+
/* @__PURE__ */ z("div", { className: ne(ze["rp-loading-title"]), children: [
|
|
3013
3019
|
n == null ? void 0 : n.printLoadingMessage,
|
|
3014
3020
|
"..."
|
|
3015
3021
|
] }),
|
|
3016
|
-
/* @__PURE__ */ i("div", { className: ne(
|
|
3022
|
+
/* @__PURE__ */ i("div", { className: ne(ze["rp-loading-progress-bar"]), children: /* @__PURE__ */ i(
|
|
3017
3023
|
"div",
|
|
3018
3024
|
{
|
|
3019
|
-
className: ne(
|
|
3025
|
+
className: ne(ze["rp-loading-progress"]),
|
|
3020
3026
|
style: { width: `${e}%` }
|
|
3021
3027
|
}
|
|
3022
3028
|
) }),
|
|
3023
|
-
/* @__PURE__ */ i("button", { className: ne(
|
|
3029
|
+
/* @__PURE__ */ i("button", { className: ne(ze["rp-loading-cancel-button"]), onClick: t, children: n == null ? void 0 : n.printCancelLabel })
|
|
3024
3030
|
] }) });
|
|
3025
|
-
},
|
|
3026
|
-
const { showPrintProgress: n } =
|
|
3027
|
-
return /* @__PURE__ */
|
|
3028
|
-
/* @__PURE__ */ i("div", { "data-rp": "topBar", ref: t, className: Me["rp-toolbar-content"], children: /* @__PURE__ */
|
|
3029
|
-
/* @__PURE__ */
|
|
3030
|
-
/* @__PURE__ */ i(
|
|
3031
|
+
}, Ki = We((e, t) => {
|
|
3032
|
+
const { showPrintProgress: n } = me(), { progress: o } = Be(), { isSmallScreen: r } = Pe(), { percentage: a } = o || {}, l = () => r ? { gridTemplateColumns: "25% 60% 15%" } : void 0;
|
|
3033
|
+
return /* @__PURE__ */ z("div", { children: [
|
|
3034
|
+
/* @__PURE__ */ i("div", { "data-rp": "topBar", ref: t, className: Me["rp-toolbar-content"], children: /* @__PURE__ */ z("div", { className: Me["rp-toolbar-wrapper"], style: l(), children: [
|
|
3035
|
+
/* @__PURE__ */ z("div", { "data-rp": "topBarLeft", className: Me["rp-toolbar-start"], children: [
|
|
3036
|
+
/* @__PURE__ */ i(Zi, {}),
|
|
3031
3037
|
/* @__PURE__ */ i(di, {})
|
|
3032
3038
|
] }),
|
|
3033
|
-
/* @__PURE__ */ i("div", { "data-rp": "topBarCenter", className: Me["rp-toolbar-middle"], children: /* @__PURE__ */ i(
|
|
3034
|
-
/* @__PURE__ */ i("div", { "data-rp": "topBarRight", className: Me["rp-toolbar-end"], children: /* @__PURE__ */ i(
|
|
3039
|
+
/* @__PURE__ */ i("div", { "data-rp": "topBarCenter", className: Me["rp-toolbar-middle"], children: /* @__PURE__ */ i(Bi, {}) }),
|
|
3040
|
+
/* @__PURE__ */ i("div", { "data-rp": "topBarRight", className: Me["rp-toolbar-end"], children: /* @__PURE__ */ i($i, {}) })
|
|
3035
3041
|
] }) }),
|
|
3036
3042
|
n && a ? /* @__PURE__ */ i(er, { percentage: a }) : null
|
|
3037
3043
|
] });
|
|
3038
|
-
}),
|
|
3044
|
+
}), wt = {
|
|
3039
3045
|
"rp-sidebar-content-wrapper": "_rp-sidebar-content-wrapper_1sdl6_1",
|
|
3040
3046
|
"rp-sidebar-content": "_rp-sidebar-content_1sdl6_1",
|
|
3041
3047
|
"rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_1sdl6_16",
|
|
@@ -3046,17 +3052,17 @@ const Ie = {
|
|
|
3046
3052
|
"rp-thumbnail": "_rp-thumbnail_3fenb_1",
|
|
3047
3053
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
3048
3054
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
3049
|
-
},
|
|
3055
|
+
}, Xi = (e) => {
|
|
3050
3056
|
const { thumbnailSrc: t, pageNumber: n, isFocused: o, viewport: r } = e, { goToPage: a } = ae(), { pageRotate: l } = Ve(), c = M(() => o ? He["rp-thumbnail-active"] : "", [o]), d = M(() => ({
|
|
3051
3057
|
width: Math.round(r.width),
|
|
3052
3058
|
height: Math.round(r.height)
|
|
3053
|
-
}), [r]),
|
|
3059
|
+
}), [r]), p = E(() => {
|
|
3054
3060
|
n && a(n);
|
|
3055
3061
|
}, [a, n]);
|
|
3056
|
-
return /* @__PURE__ */
|
|
3062
|
+
return /* @__PURE__ */ z(
|
|
3057
3063
|
"div",
|
|
3058
3064
|
{
|
|
3059
|
-
onClick:
|
|
3065
|
+
onClick: p,
|
|
3060
3066
|
id: `page-${n}`,
|
|
3061
3067
|
className: He["rp-thumbnail-wrapper"],
|
|
3062
3068
|
children: [
|
|
@@ -3083,7 +3089,7 @@ const Ie = {
|
|
|
3083
3089
|
width: `${d.width}px`,
|
|
3084
3090
|
height: `${d.height}px`
|
|
3085
3091
|
},
|
|
3086
|
-
children: /* @__PURE__ */ i(
|
|
3092
|
+
children: /* @__PURE__ */ i(xt, {})
|
|
3087
3093
|
}
|
|
3088
3094
|
)
|
|
3089
3095
|
}
|
|
@@ -3095,62 +3101,62 @@ const Ie = {
|
|
|
3095
3101
|
}, un = {
|
|
3096
3102
|
"rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
|
|
3097
3103
|
"rp-thumbnails": "_rp-thumbnails_16vqr_1"
|
|
3098
|
-
},
|
|
3104
|
+
}, Yi = 16, Ji = (e, t) => {
|
|
3099
3105
|
const n = e == null ? void 0 : e.querySelector(`#page-${t}`);
|
|
3100
|
-
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) -
|
|
3106
|
+
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) - Yi);
|
|
3101
3107
|
}, tr = We((e, t) => {
|
|
3102
|
-
const { show: n } = e, { focusedPage: o, totalPages: r } = ae(), { thumbnailPages: a, addPage: l, thumbnailLength: c, addToPage: d } =
|
|
3103
|
-
pn(t, () =>
|
|
3108
|
+
const { show: n } = e, { focusedPage: o, totalPages: r } = ae(), { thumbnailPages: a, addPage: l, thumbnailLength: c, addToPage: d } = Lt(), p = H(null), m = H(1);
|
|
3109
|
+
pn(t, () => p.current);
|
|
3104
3110
|
const v = M(() => Object.values(a), [a]), h = E(() => {
|
|
3105
3111
|
const w = c + 1;
|
|
3106
3112
|
w <= r && l(w);
|
|
3107
3113
|
}, [l, r, c]);
|
|
3108
3114
|
return W(() => {
|
|
3109
|
-
o > c ? d(o) : n &&
|
|
3110
|
-
}, [o, c, d, n, v]), kr(
|
|
3111
|
-
var
|
|
3115
|
+
o > c ? d(o) : n && m.current !== o && (Ji(p.current, o), m.current = o);
|
|
3116
|
+
}, [o, c, d, n, v]), kr(p.current, h), /* @__PURE__ */ i("div", { ref: p, className: un["rp-thumbnails-container"], children: /* @__PURE__ */ i("div", { className: un["rp-thumbnails"], children: n ? v.map((w, P) => {
|
|
3117
|
+
var y, C;
|
|
3112
3118
|
return /* @__PURE__ */ i(
|
|
3113
|
-
|
|
3119
|
+
Xi,
|
|
3114
3120
|
{
|
|
3115
|
-
isFocused: o === ((
|
|
3116
|
-
pageNumber: (
|
|
3121
|
+
isFocused: o === ((y = w.page) == null ? void 0 : y.pageNumber),
|
|
3122
|
+
pageNumber: (C = w.page) == null ? void 0 : C.pageNumber,
|
|
3117
3123
|
thumbnailSrc: w.thumbnailSrc,
|
|
3118
3124
|
loading: w.loading,
|
|
3119
3125
|
viewport: w.viewport,
|
|
3120
3126
|
defaultRotation: w.defaultRotation
|
|
3121
3127
|
},
|
|
3122
|
-
|
|
3128
|
+
P
|
|
3123
3129
|
);
|
|
3124
3130
|
}) : null }) });
|
|
3125
|
-
}),
|
|
3131
|
+
}), Qi = () => {
|
|
3126
3132
|
const { thumbnailIcon: e } = he();
|
|
3127
3133
|
return e || /* @__PURE__ */ i(no, {});
|
|
3128
|
-
},
|
|
3129
|
-
const { active: e, setActive: t } =
|
|
3130
|
-
t((
|
|
3131
|
-
}, []),
|
|
3134
|
+
}, ea = () => {
|
|
3135
|
+
const { active: e, setActive: t } = Lt(), [n, o] = G(200), r = H(null), { thumbnailTool: a, sidebarEnable: l } = me(), { localeMessages: c } = ce(), d = E(() => {
|
|
3136
|
+
t((m) => !m);
|
|
3137
|
+
}, []), p = M(() => typeof a != "boolean" && a ? /* @__PURE__ */ i(a, { onClick: d, active: e }) : a ? /* @__PURE__ */ i(K, { content: c == null ? void 0 : c.thumbnailTooltip, children: /* @__PURE__ */ i(
|
|
3132
3138
|
re,
|
|
3133
3139
|
{
|
|
3134
3140
|
onClick: d,
|
|
3135
3141
|
active: e,
|
|
3136
3142
|
"aria-label": c == null ? void 0 : c.thumbnailTooltip,
|
|
3137
|
-
children: /* @__PURE__ */ i(
|
|
3143
|
+
children: /* @__PURE__ */ i(Qi, {})
|
|
3138
3144
|
}
|
|
3139
3145
|
) }) : null, [a, e, d, c]);
|
|
3140
|
-
return /* @__PURE__ */ i(ie, { children: l && /* @__PURE__ */
|
|
3146
|
+
return /* @__PURE__ */ i(ie, { children: l && /* @__PURE__ */ z(
|
|
3141
3147
|
"div",
|
|
3142
3148
|
{
|
|
3143
3149
|
style: { "--rp-thumbnail-width": `${n}px` },
|
|
3144
|
-
className:
|
|
3150
|
+
className: wt["rp-sidebar-content-wrapper"],
|
|
3145
3151
|
"data-rp": "sidebar",
|
|
3146
3152
|
children: [
|
|
3147
|
-
/* @__PURE__ */ i("div", { className:
|
|
3148
|
-
/* @__PURE__ */
|
|
3153
|
+
/* @__PURE__ */ i("div", { className: wt["rp-sidebar-content"], children: p }),
|
|
3154
|
+
/* @__PURE__ */ z(
|
|
3149
3155
|
"div",
|
|
3150
3156
|
{
|
|
3151
3157
|
"data-rp": "thumbnailSidebar",
|
|
3152
3158
|
hidden: !e,
|
|
3153
|
-
className:
|
|
3159
|
+
className: wt["rp-thumbnails-wrapper"],
|
|
3154
3160
|
children: [
|
|
3155
3161
|
/* @__PURE__ */ i(tr, { show: e, ref: r }),
|
|
3156
3162
|
/* @__PURE__ */ i(ro, { onWidthChange: o, thumbnailRef: r })
|
|
@@ -3160,7 +3166,7 @@ const Ie = {
|
|
|
3160
3166
|
]
|
|
3161
3167
|
}
|
|
3162
3168
|
) });
|
|
3163
|
-
},
|
|
3169
|
+
}, Js = We((e, t) => {
|
|
3164
3170
|
const {
|
|
3165
3171
|
children: n,
|
|
3166
3172
|
slots: o,
|
|
@@ -3169,23 +3175,23 @@ const Ie = {
|
|
|
3169
3175
|
className: l,
|
|
3170
3176
|
mobileWidth: c,
|
|
3171
3177
|
onLoaded: d,
|
|
3172
|
-
cleanupOnLoaded:
|
|
3173
|
-
onLayoutWidthChange:
|
|
3174
|
-
} = e, [v, h] = G(null), { setContainer: w, setContentRef:
|
|
3178
|
+
cleanupOnLoaded: p,
|
|
3179
|
+
onLayoutWidthChange: m
|
|
3180
|
+
} = e, [v, h] = G(null), { setContainer: w, setContentRef: P } = se(), { loading: y } = X(), { LoaderImageComponent: C } = Tt();
|
|
3175
3181
|
return W(() => (d && d(), () => {
|
|
3176
|
-
|
|
3177
|
-
}), [d,
|
|
3178
|
-
/* @__PURE__ */
|
|
3179
|
-
/* @__PURE__ */
|
|
3180
|
-
/* @__PURE__ */ i(
|
|
3181
|
-
/* @__PURE__ */
|
|
3182
|
-
/* @__PURE__ */ i("div", { className: ve["rp-sidebar"], children: /* @__PURE__ */ i(
|
|
3183
|
-
/* @__PURE__ */ i("div", { ref:
|
|
3182
|
+
p && p();
|
|
3183
|
+
}), [d, p]), /* @__PURE__ */ i(Ot, { toolbarRef: v, ref: t, children: /* @__PURE__ */ i(fn, { mobileWidth: c, onLayoutWidthChange: m, children: /* @__PURE__ */ i(yr, { slots: o, children: /* @__PURE__ */ i(Tr, { icons: r, children: /* @__PURE__ */ i(Cn, { children: /* @__PURE__ */ z(mn, { getContainerRef: w, style: a, className: l, children: [
|
|
3184
|
+
/* @__PURE__ */ z(Pn, { children: [
|
|
3185
|
+
/* @__PURE__ */ z("div", { className: ve["rp-layout"], children: [
|
|
3186
|
+
/* @__PURE__ */ i(Ki, { ref: h }),
|
|
3187
|
+
/* @__PURE__ */ z("div", { className: ve["rp-content"], children: [
|
|
3188
|
+
/* @__PURE__ */ i("div", { className: ve["rp-sidebar"], children: /* @__PURE__ */ i(ea, {}) }),
|
|
3189
|
+
/* @__PURE__ */ i("div", { ref: P, className: ve["rp-pages"], children: n })
|
|
3184
3190
|
] })
|
|
3185
3191
|
] }),
|
|
3186
3192
|
/* @__PURE__ */ i(Mr, {})
|
|
3187
3193
|
] }),
|
|
3188
|
-
|
|
3194
|
+
y ? /* @__PURE__ */ i(
|
|
3189
3195
|
"div",
|
|
3190
3196
|
{
|
|
3191
3197
|
className: ve["rp-loader"],
|
|
@@ -3208,7 +3214,7 @@ const Ie = {
|
|
|
3208
3214
|
height: "100%",
|
|
3209
3215
|
width: "100%"
|
|
3210
3216
|
},
|
|
3211
|
-
children:
|
|
3217
|
+
children: C && /* @__PURE__ */ i(C, {})
|
|
3212
3218
|
}
|
|
3213
3219
|
)
|
|
3214
3220
|
}
|
|
@@ -3221,30 +3227,31 @@ const Ie = {
|
|
|
3221
3227
|
"rp-sidebar-content": "_rp-sidebar-content_vwobs_22",
|
|
3222
3228
|
"rp-pages": "_rp-pages_vwobs_32",
|
|
3223
3229
|
"rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_vwobs_37"
|
|
3224
|
-
},
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
/* @__PURE__ */
|
|
3230
|
-
|
|
3231
|
-
|
|
3230
|
+
}, ta = (e) => {
|
|
3231
|
+
var v, h;
|
|
3232
|
+
const { children: t, toolbar: n } = e, o = H(null), { setContentRef: r } = se(), { active: a } = Lt(), { showPrintProgress: l } = me(), { progress: c } = Be(), { percentage: d } = c || {}, p = (v = n == null ? void 0 : n.topbar) == null ? void 0 : v.component, m = (h = n == null ? void 0 : n.leftSidebar) == null ? void 0 : h.component;
|
|
3233
|
+
return /* @__PURE__ */ z(ie, { children: [
|
|
3234
|
+
/* @__PURE__ */ z("div", { className: Ae["rp-toolbar-layout"], children: [
|
|
3235
|
+
p && /* @__PURE__ */ i("div", { "data-rp": "topbar", className: Ae["rp-topbar-content"], children: p }),
|
|
3236
|
+
/* @__PURE__ */ z("div", { className: Ae["rp-content"], children: [
|
|
3237
|
+
/* @__PURE__ */ z(ie, { children: [
|
|
3238
|
+
m && /* @__PURE__ */ i("div", { "data-rp": "sidebar", className: Ae["rp-sidebar-content"], children: m }),
|
|
3232
3239
|
/* @__PURE__ */ i(
|
|
3233
3240
|
"div",
|
|
3234
3241
|
{
|
|
3235
3242
|
"data-rp": "thumbnailSidebar",
|
|
3236
|
-
hidden: !
|
|
3243
|
+
hidden: !a,
|
|
3237
3244
|
className: Ae["rp-thumbnails-wrapper"],
|
|
3238
|
-
children: /* @__PURE__ */ i(tr, { show:
|
|
3245
|
+
children: /* @__PURE__ */ i(tr, { show: a, ref: o })
|
|
3239
3246
|
}
|
|
3240
3247
|
)
|
|
3241
3248
|
] }),
|
|
3242
|
-
/* @__PURE__ */ i("div", { ref:
|
|
3249
|
+
/* @__PURE__ */ i("div", { ref: r, className: Ae["rp-pages"], children: t })
|
|
3243
3250
|
] })
|
|
3244
3251
|
] }),
|
|
3245
|
-
|
|
3252
|
+
l && d ? /* @__PURE__ */ i(er, { percentage: d }) : null
|
|
3246
3253
|
] });
|
|
3247
|
-
},
|
|
3254
|
+
}, Qs = We((e, t) => {
|
|
3248
3255
|
const {
|
|
3249
3256
|
children: n,
|
|
3250
3257
|
style: o,
|
|
@@ -3253,14 +3260,13 @@ const Ie = {
|
|
|
3253
3260
|
onLoaded: l,
|
|
3254
3261
|
cleanupOnLoaded: c,
|
|
3255
3262
|
onLayoutWidthChange: d,
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
} = e, { setContainer: v } = se(), [h] = G(null), { loading: w } = X(), { LoaderImageComponent: b } = Pt();
|
|
3263
|
+
toolbar: p
|
|
3264
|
+
} = e, { setContainer: m } = se(), [v] = G(null), { loading: h } = X(), { LoaderImageComponent: w } = Tt();
|
|
3259
3265
|
return W(() => (l && l(), () => {
|
|
3260
3266
|
c && c();
|
|
3261
|
-
}), [l, c]), /* @__PURE__ */ i(
|
|
3262
|
-
/* @__PURE__ */ i(Pn, { children: /* @__PURE__ */ i(
|
|
3263
|
-
|
|
3267
|
+
}), [l, c]), /* @__PURE__ */ i(Ot, { toolbarRef: v, ref: t, children: /* @__PURE__ */ i(fn, { mobileWidth: a, onLayoutWidthChange: d, children: /* @__PURE__ */ i(Cn, { children: /* @__PURE__ */ z(mn, { getContainerRef: m, style: o, className: r, children: [
|
|
3268
|
+
/* @__PURE__ */ i(Pn, { children: /* @__PURE__ */ i(ta, { toolbar: p, children: n }) }),
|
|
3269
|
+
h ? /* @__PURE__ */ i(
|
|
3264
3270
|
"div",
|
|
3265
3271
|
{
|
|
3266
3272
|
className: ve["rp-loader"],
|
|
@@ -3283,7 +3289,7 @@ const Ie = {
|
|
|
3283
3289
|
height: "100%",
|
|
3284
3290
|
width: "100%"
|
|
3285
3291
|
},
|
|
3286
|
-
children:
|
|
3292
|
+
children: w && /* @__PURE__ */ i(w, {})
|
|
3287
3293
|
}
|
|
3288
3294
|
)
|
|
3289
3295
|
}
|
|
@@ -3295,35 +3301,35 @@ export {
|
|
|
3295
3301
|
di as B,
|
|
3296
3302
|
Oo as C,
|
|
3297
3303
|
oi as D,
|
|
3298
|
-
|
|
3304
|
+
Ri as E,
|
|
3299
3305
|
Xn as F,
|
|
3300
3306
|
Qn as G,
|
|
3301
|
-
|
|
3307
|
+
$i as H,
|
|
3302
3308
|
ln as I,
|
|
3303
3309
|
er as J,
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
+
Ki as K,
|
|
3311
|
+
Ot as L,
|
|
3312
|
+
Mi as M,
|
|
3313
|
+
Xi as N,
|
|
3314
|
+
Hi as O,
|
|
3315
|
+
qs as P,
|
|
3310
3316
|
tr as Q,
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3317
|
+
Ks as R,
|
|
3318
|
+
Zi as S,
|
|
3319
|
+
Zs as T,
|
|
3320
|
+
ea as U,
|
|
3321
|
+
ta as V,
|
|
3322
|
+
Bi as Z,
|
|
3323
|
+
Js as a,
|
|
3324
|
+
Qs as b,
|
|
3319
3325
|
Zn as c,
|
|
3320
3326
|
Be as d,
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
+
Nt as e,
|
|
3328
|
+
js as f,
|
|
3329
|
+
Bs as g,
|
|
3330
|
+
Lt as h,
|
|
3331
|
+
gt as i,
|
|
3332
|
+
De as j,
|
|
3327
3333
|
Sn as k,
|
|
3328
3334
|
Ro as l,
|
|
3329
3335
|
xn as m,
|
|
@@ -3333,10 +3339,10 @@ export {
|
|
|
3333
3339
|
Rn as q,
|
|
3334
3340
|
Eo as r,
|
|
3335
3341
|
Ln as s,
|
|
3336
|
-
|
|
3342
|
+
zo as t,
|
|
3337
3343
|
ae as u,
|
|
3338
3344
|
Mo as v,
|
|
3339
|
-
|
|
3345
|
+
Et as w,
|
|
3340
3346
|
ti as x,
|
|
3341
3347
|
ii as y,
|
|
3342
3348
|
ai as z
|