@pdf-viewer/react 1.7.2 → 1.8.0-beta.0
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/{RPDefaultLayout-8b0d26d6.js → RPDefaultLayout-f02500c9.js} +374 -367
- package/dist/assets/RotateTool.css +1 -1
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/OtherTool.js +1 -1
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +5 -5
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +1 -1
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/contexts/DimensionPagesContext.js +18 -18
- 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/contexts/ZoomContext.js +10 -10
- package/dist/main.js +1 -1
- package/dist/types/utils/types.d.ts +1 -0
- package/dist/utils/hooks/useFileDownload.js +1 -1
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLoadPdf.js +29 -24
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePresentPage.js +1 -1
- package/dist/utils/hooks/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as i, Fragment as
|
|
1
|
+
import { jsx as i, Fragment as me, jsxs as F } from "react/jsx-runtime";
|
|
2
2
|
import * as B from "react";
|
|
3
3
|
import { useRef as H, useEffect as W, useCallback as N, useState as $, useMemo as k, createContext as Ye, useContext as Je, forwardRef as $e, useImperativeHandle as cn, createElement as qe, PureComponent as Qn, Component as er, memo as ln } from "react";
|
|
4
4
|
import { ChevronUpIcon as He } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as re } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as dn } from "./components/ui/Input.js";
|
|
7
7
|
import { ViewMode as xe, ScrollMode as J, AnnotationSubType as zt, SelectionMode as tr, ZoomLevel as at } from "./utils/types.js";
|
|
8
|
-
import { useScrollModeContext as
|
|
8
|
+
import { useScrollModeContext as Le } from "./contexts/ScrollModeContext.js";
|
|
9
9
|
import { useDocumentContext as Q } from "./contexts/RPDocumentContext.js";
|
|
10
10
|
import { useDocumentPasswordContext as nr } from "./contexts/DocumentPasswordContext.js";
|
|
11
11
|
import { useDarkModeContext as rr } from "./contexts/DarkModeContext.js";
|
|
@@ -31,10 +31,10 @@ import { useDownloadContext as hr } from "./contexts/DownloadContext.js";
|
|
|
31
31
|
import { useSmoothScrollContext as pn } from "./contexts/SmoothScrollContext.js";
|
|
32
32
|
import { useLoaderContext as hn } from "./contexts/LoaderContext.js";
|
|
33
33
|
import "./components/RPConfig.js";
|
|
34
|
-
import { ThumbnailIcon as
|
|
34
|
+
import { ThumbnailIcon as fr } from "./components/icons/Thumbnail.js";
|
|
35
35
|
import { c as ne } from "./clsx-0c6e471a.js";
|
|
36
36
|
import { LoaderIcon as Ct } from "./components/icons/LoaderIcon.js";
|
|
37
|
-
import { useInfiniteScroll as
|
|
37
|
+
import { useInfiniteScroll as mr } from "./utils/hooks/useInfiniteScroll.js";
|
|
38
38
|
import { RPSplitter as gr } from "./components/layout/sidebar/RPSplitter.js";
|
|
39
39
|
import { useToolbarComponentContext as ve, ToolbarComponentProvider as vr } from "./contexts/ToolbarComponentContext.js";
|
|
40
40
|
import { useIconContext as pe, IconProvider as wr } from "./contexts/IconContext.js";
|
|
@@ -45,8 +45,8 @@ import { RPDropFileZone as Cr } from "./components/RPDropFileZone.js";
|
|
|
45
45
|
import { useViewportContext as Ce, ViewportProvider as Pr } from "./contexts/ViewportContext.js";
|
|
46
46
|
import { useThemeContext as Tr } from "./contexts/ThemeContext.js";
|
|
47
47
|
import * as Sr from "pdfjs-dist";
|
|
48
|
-
import { PixelsPerInch as yr, AnnotationMode as Ir, RenderingCancelledException as xr, AnnotationLayer as
|
|
49
|
-
import { SimpleLinkService as
|
|
48
|
+
import { PixelsPerInch as yr, AnnotationMode as Ir, RenderingCancelledException as xr, AnnotationLayer as Rr } from "pdfjs-dist";
|
|
49
|
+
import { SimpleLinkService as Lr } from "./utils/link_service.js";
|
|
50
50
|
import { annotationsEvents as Er, annotationEventsHandler as Nr, handleClick as At, handleAnnotationWidget as Or, handleAnnotationLink as Dr, bindLayerEvents as zr, unbindLayerEvents as Ft } from "./utils/annotations.js";
|
|
51
51
|
import { normalizeSingleKeyword as Ar, sortHighlightPosition as Fr, unwrap as Wr } from "./components/page/searchHighlight.js";
|
|
52
52
|
import { _ as kr, U as Mr } from "./Popover-b7402893.js";
|
|
@@ -61,10 +61,10 @@ import { getWordPositionInPage as Br } from "./utils/getWordPositionInPage.js";
|
|
|
61
61
|
import { getThumbnailViewport as Wt } from "./utils/getThumbnailViewport.js";
|
|
62
62
|
import { smoothScrollTo as st } from "./utils/smoothScrollTo.js";
|
|
63
63
|
import { appConsole as Zr } from "./utils/appConsole.js";
|
|
64
|
-
import { FileUploadTool as
|
|
64
|
+
import { FileUploadTool as fn } from "./components/layout/toolbar/FileUploadTool.js";
|
|
65
65
|
import { DarkModeTool as jr } from "./components/layout/toolbar/DarkModeTool.js";
|
|
66
66
|
import { ThreeDotIcon as Kr } from "./components/icons/ThreeDotIcon.js";
|
|
67
|
-
import { UIDropDown as
|
|
67
|
+
import { UIDropDown as mn } from "./components/ui/DropDown.js";
|
|
68
68
|
import { e as Xr, a as Tt, P as Ve, c as Me, g as St, i as Yr, k as Jr, f as Qr } from "./index-1cb41342.js";
|
|
69
69
|
import { D as eo, u as ct } from "./index-aa2d3884.js";
|
|
70
70
|
import { a as to, u as no, F as ro, b as oo, G as Ke } from "./index-7279fb4e.js";
|
|
@@ -76,9 +76,9 @@ import { useOtherToolContext as co, OtherToolProvider as lo } from "./contexts/O
|
|
|
76
76
|
import { DocumentProperties as uo } from "./components/layout/toolbar/DocumentProperties.js";
|
|
77
77
|
import { RotateTool as po } from "./components/layout/toolbar/RotateTool.js";
|
|
78
78
|
import { ViewModeTool as ho } from "./components/layout/toolbar/ViewModeTool.js";
|
|
79
|
-
import { ScrollModeTool as
|
|
79
|
+
import { ScrollModeTool as fo } from "./components/layout/toolbar/ScrollModeTool.js";
|
|
80
80
|
import { MenuSeparator as yt } from "./components/layout/toolbar/MenuSeparator.js";
|
|
81
|
-
import { FileDownloadDefaultIcon as
|
|
81
|
+
import { FileDownloadDefaultIcon as mo } from "./components/icons/FileDownloadDefaultIcon.js";
|
|
82
82
|
import { MenuItem as be } from "./components/layout/toolbar/MenuItem.js";
|
|
83
83
|
import { PrintDefaultTool as go } from "./components/icons/PrintDefaultIcon.js";
|
|
84
84
|
import { FullScreenTool as gn } from "./components/layout/toolbar/FullScreenTool.js";
|
|
@@ -94,11 +94,11 @@ import { UICheckbox as $t } from "./components/ui/Checkbox.js";
|
|
|
94
94
|
import { ClearIcon as Po } from "./components/icons/ClearIcon.js";
|
|
95
95
|
import { InfoIcon as Gt } from "./components/icons/InfoIcon.js";
|
|
96
96
|
import './assets/RPDefaultLayout.css';const wn = () => {
|
|
97
|
-
const { viewMode: t } = Ee(), { scrollMode: e } =
|
|
97
|
+
const { viewMode: t } = Ee(), { scrollMode: e } = Le(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = et(), { setFocusedPage: a } = ie(), l = H(), { columnCount: c } = un(), { widths: d, heights: p } = Ue(), m = H(e), _ = H(t), h = H(c), { targetScrollPage: v } = pn();
|
|
98
98
|
W(() => {
|
|
99
99
|
n != null && n.scrollToItem && (l.current = n);
|
|
100
100
|
}, [n]), W(() => {
|
|
101
|
-
|
|
101
|
+
m.current = e, _.current = t;
|
|
102
102
|
}, [e, t]);
|
|
103
103
|
const w = N(
|
|
104
104
|
(P, S) => {
|
|
@@ -114,38 +114,38 @@ import './assets/RPDefaultLayout.css';const wn = () => {
|
|
|
114
114
|
(s) => st(r, g, s)
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
|
-
const
|
|
117
|
+
const f = {
|
|
118
118
|
left: 0,
|
|
119
119
|
top: 0
|
|
120
120
|
};
|
|
121
121
|
return r == null ? void 0 : r.scrollTo({
|
|
122
|
-
...
|
|
122
|
+
...f,
|
|
123
123
|
behavior: S
|
|
124
124
|
});
|
|
125
125
|
},
|
|
126
126
|
[r, d, st]
|
|
127
127
|
);
|
|
128
128
|
return W(() => {
|
|
129
|
-
|
|
129
|
+
m.current = e, _.current = t;
|
|
130
130
|
}, [e, t]), W(() => {
|
|
131
131
|
h.current = c;
|
|
132
132
|
}, [c]), { scrollToPage: N(
|
|
133
133
|
(P, S = "smooth") => {
|
|
134
134
|
a(P);
|
|
135
135
|
const u = P - 1;
|
|
136
|
-
let
|
|
137
|
-
if (_.current === xe.DUAL_PAGE &&
|
|
136
|
+
let f = u, g = 0;
|
|
137
|
+
if (_.current === xe.DUAL_PAGE && m.current === J.PAGE_SCROLLING) {
|
|
138
138
|
w(P, S);
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
|
-
if (
|
|
141
|
+
if (m.current === J.PAGE_SCROLLING) {
|
|
142
142
|
a(P);
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
if (!l.current || !o)
|
|
146
146
|
return;
|
|
147
147
|
const s = o;
|
|
148
|
-
if (v.current = P,
|
|
148
|
+
if (v.current = P, m.current === J.HORIZONTAL_SCROLLING) {
|
|
149
149
|
g = u;
|
|
150
150
|
const y = {
|
|
151
151
|
left: Ae(d, g),
|
|
@@ -157,10 +157,10 @@ import './assets/RPDefaultLayout.css';const wn = () => {
|
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
if (_.current === xe.DUAL_PAGE) {
|
|
160
|
-
g = u % 2,
|
|
160
|
+
g = u % 2, f = Math.floor(u / 2);
|
|
161
161
|
const y = {
|
|
162
162
|
left: Ae(d, g),
|
|
163
|
-
top: Ae(p,
|
|
163
|
+
top: Ae(p, f)
|
|
164
164
|
};
|
|
165
165
|
return s.scrollTo({
|
|
166
166
|
...y,
|
|
@@ -169,7 +169,7 @@ import './assets/RPDefaultLayout.css';const wn = () => {
|
|
|
169
169
|
}
|
|
170
170
|
const C = {
|
|
171
171
|
left: 0,
|
|
172
|
-
top: Ae(p,
|
|
172
|
+
top: Ae(p, f)
|
|
173
173
|
};
|
|
174
174
|
return s.scrollTo({
|
|
175
175
|
...C,
|
|
@@ -187,34 +187,34 @@ import './assets/RPDefaultLayout.css';const wn = () => {
|
|
|
187
187
|
]
|
|
188
188
|
) };
|
|
189
189
|
}, To = (t = 1) => {
|
|
190
|
-
const [e, n] = $(t), [o, r] = $(0), { scrollToPage: a } = wn(), l = H(1), { viewMode: c } = Ee(), { scrollMode: d } =
|
|
191
|
-
(
|
|
192
|
-
if (!/^[0-9]*$/g.test(
|
|
190
|
+
const [e, n] = $(t), [o, r] = $(0), { scrollToPage: a } = wn(), l = H(1), { viewMode: c } = Ee(), { scrollMode: d } = Le(), { widths: p } = Ue(), { pagesRef: m } = ge(), _ = Pt(e, 100), h = N(
|
|
191
|
+
(f) => {
|
|
192
|
+
if (!/^[0-9]*$/g.test(f.toString()) || !f)
|
|
193
193
|
return { success: !1, currentPage: l.current };
|
|
194
|
-
const s = +
|
|
195
|
-
return s < 0 || s > o ? { success: !1, currentPage: l.current } : (n(s), l.current = s, { success: !0, currentPage: +
|
|
194
|
+
const s = +f;
|
|
195
|
+
return s < 0 || s > o ? { success: !1, currentPage: l.current } : (n(s), l.current = s, { success: !0, currentPage: +f });
|
|
196
196
|
},
|
|
197
197
|
[o]
|
|
198
198
|
), v = N(h, [h]), w = N(
|
|
199
|
-
(
|
|
200
|
-
const g = h(
|
|
199
|
+
(f) => {
|
|
200
|
+
const g = h(f);
|
|
201
201
|
return g.success && a(g.currentPage), g;
|
|
202
202
|
},
|
|
203
203
|
[h, a]
|
|
204
|
-
), T = N((
|
|
205
|
-
const g =
|
|
206
|
-
if (!
|
|
204
|
+
), T = N((f) => {
|
|
205
|
+
const g = f % 2 === 1;
|
|
206
|
+
if (!m || g)
|
|
207
207
|
return !1;
|
|
208
|
-
const s = g ? p[
|
|
209
|
-
return c === xe.DUAL_PAGE && s + C <
|
|
210
|
-
}, [c, p,
|
|
211
|
-
let
|
|
212
|
-
T(
|
|
208
|
+
const s = g ? p[f] : p[f - 1], C = g ? p[f + 1] : p[f];
|
|
209
|
+
return c === xe.DUAL_PAGE && s + C < m.clientWidth;
|
|
210
|
+
}, [c, p, m, o]), P = N(() => {
|
|
211
|
+
let f = e - 1;
|
|
212
|
+
T(f) && (f = e - 2), w(f);
|
|
213
213
|
}, [w, e, c, d, T]), S = k(() => c === xe.DUAL_PAGE && d === J.PAGE_SCROLLING ? e === o - 1 : e === o, [e, o, c, d]), u = N(() => {
|
|
214
214
|
if (S)
|
|
215
215
|
return;
|
|
216
|
-
let
|
|
217
|
-
T(
|
|
216
|
+
let f = e + 1;
|
|
217
|
+
T(f) && (f = e + 2), w(f);
|
|
218
218
|
}, [w, e, T, c, d, S]);
|
|
219
219
|
return {
|
|
220
220
|
focusedPage: _,
|
|
@@ -265,24 +265,24 @@ const So = () => {
|
|
|
265
265
|
loadedPages: 0,
|
|
266
266
|
totalPages: 0,
|
|
267
267
|
percentage: 0
|
|
268
|
-
}), [r, a] = $(!1), [l, c] = $(!1), [d, p] = $(null),
|
|
268
|
+
}), [r, a] = $(!1), [l, c] = $(!1), [d, p] = $(null), m = H(!1);
|
|
269
269
|
W(() => {
|
|
270
|
-
|
|
271
|
-
}, [
|
|
270
|
+
m.current;
|
|
271
|
+
}, [m]);
|
|
272
272
|
const _ = N(() => {
|
|
273
273
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
274
|
-
const
|
|
275
|
-
|
|
274
|
+
const f = document.querySelector(".rp-print-zone");
|
|
275
|
+
f && f.remove();
|
|
276
276
|
}, []), h = N(() => {
|
|
277
|
-
|
|
277
|
+
m.current = !1, a(!1), c(!1), p(null), o({
|
|
278
278
|
loadedPages: 0,
|
|
279
279
|
totalPages: 0,
|
|
280
280
|
percentage: 0
|
|
281
281
|
});
|
|
282
282
|
}, []), v = () => {
|
|
283
|
-
|
|
283
|
+
m.current = !0;
|
|
284
284
|
}, w = async ({
|
|
285
|
-
scratchCanvas:
|
|
285
|
+
scratchCanvas: f,
|
|
286
286
|
pdfDocument: g,
|
|
287
287
|
pageNumber: s,
|
|
288
288
|
viewerPdfPage: C,
|
|
@@ -290,24 +290,24 @@ const So = () => {
|
|
|
290
290
|
optionalContentConfigPromise: y,
|
|
291
291
|
printAnnotationStoragePromise: E
|
|
292
292
|
}) => {
|
|
293
|
-
if (
|
|
293
|
+
if (m.current) {
|
|
294
294
|
h();
|
|
295
295
|
return;
|
|
296
296
|
}
|
|
297
297
|
const I = b / yr.PDF;
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
|
|
298
|
+
f.width = Math.floor(C.width * I), f.height = Math.floor(C.height * I);
|
|
299
|
+
const R = f.getContext("2d");
|
|
300
|
+
R.save(), R.fillStyle = "rgb(255, 255, 255)", R.fillRect(0, 0, f.width, f.height), R.restore();
|
|
301
301
|
const [D, z] = await Promise.all([
|
|
302
302
|
g.getPage(s),
|
|
303
303
|
E
|
|
304
304
|
]);
|
|
305
|
-
if (
|
|
305
|
+
if (m.current) {
|
|
306
306
|
h();
|
|
307
307
|
return;
|
|
308
308
|
}
|
|
309
309
|
const A = {
|
|
310
|
-
canvasContext:
|
|
310
|
+
canvasContext: R,
|
|
311
311
|
transform: [I, 0, 0, I, 0, 0],
|
|
312
312
|
viewport: D.getViewport({ scale: 1, rotation: C.rotation }),
|
|
313
313
|
intent: "print",
|
|
@@ -317,15 +317,15 @@ const So = () => {
|
|
|
317
317
|
};
|
|
318
318
|
try {
|
|
319
319
|
return D.render(A).promise;
|
|
320
|
-
} catch (
|
|
321
|
-
throw
|
|
320
|
+
} catch (L) {
|
|
321
|
+
throw L instanceof xr || console.error(L), L;
|
|
322
322
|
}
|
|
323
323
|
}, T = N(() => {
|
|
324
|
-
const
|
|
324
|
+
const f = window.print;
|
|
325
325
|
return new Promise((g) => {
|
|
326
326
|
const s = (y) => {
|
|
327
327
|
setTimeout(() => {
|
|
328
|
-
|
|
328
|
+
f.call(window), setTimeout(() => y(), 20);
|
|
329
329
|
}, 0);
|
|
330
330
|
};
|
|
331
331
|
if (document.querySelector(".rp-print-zone")) {
|
|
@@ -337,17 +337,17 @@ const So = () => {
|
|
|
337
337
|
});
|
|
338
338
|
b.observe(document.body, { childList: !0, subtree: !0 });
|
|
339
339
|
});
|
|
340
|
-
}, []), P = async (
|
|
340
|
+
}, []), P = async (f) => {
|
|
341
341
|
const g = document.createElement("img"), s = document.createElement("div");
|
|
342
342
|
return s.classList.add("rp-print-page"), await new Promise((C, b) => {
|
|
343
|
-
|
|
343
|
+
f.toBlob((y) => {
|
|
344
344
|
y ? (g.src = URL.createObjectURL(y), g.onload = () => {
|
|
345
345
|
URL.revokeObjectURL(g.src), C();
|
|
346
346
|
}, g.onerror = b) : b(new Error("Failed to create blob"));
|
|
347
347
|
});
|
|
348
348
|
}).catch(() => {
|
|
349
349
|
}), s.appendChild(g), s;
|
|
350
|
-
}, S = (
|
|
350
|
+
}, S = (f, g) => {
|
|
351
351
|
const s = document.createElement("div");
|
|
352
352
|
s.classList.add("rp-print-zone");
|
|
353
353
|
const C = document.createElement("style"), b = g.get(1);
|
|
@@ -355,36 +355,36 @@ const So = () => {
|
|
|
355
355
|
const { width: y, height: E } = b == null ? void 0 : b.page.getViewport({ scale: 1 });
|
|
356
356
|
C.innerHTML = `@page { size: ${y}px ${E}px }`;
|
|
357
357
|
}
|
|
358
|
-
return s.appendChild(C), s.append(...
|
|
358
|
+
return s.appendChild(C), s.append(...f), s;
|
|
359
359
|
}, u = N(async () => {
|
|
360
360
|
if (!t)
|
|
361
361
|
return;
|
|
362
362
|
h();
|
|
363
|
-
const
|
|
363
|
+
const f = document.createElement("canvas"), g = [];
|
|
364
364
|
try {
|
|
365
365
|
t.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
366
366
|
const C = t.getOptionalContentConfig({ intent: "print" }), b = Promise.resolve(
|
|
367
367
|
t.annotationStorage.print ?? void 0
|
|
368
368
|
), y = e.size;
|
|
369
|
-
for (const [I,
|
|
370
|
-
if (
|
|
369
|
+
for (const [I, R] of e) {
|
|
370
|
+
if (m.current) {
|
|
371
371
|
h();
|
|
372
372
|
return;
|
|
373
373
|
}
|
|
374
|
-
const D =
|
|
374
|
+
const D = R.page.getViewport({ scale: 1 });
|
|
375
375
|
if (await w({
|
|
376
|
-
scratchCanvas:
|
|
376
|
+
scratchCanvas: f,
|
|
377
377
|
pdfDocument: t,
|
|
378
378
|
pageNumber: I,
|
|
379
379
|
viewerPdfPage: D,
|
|
380
380
|
printResolution: 150,
|
|
381
381
|
optionalContentConfigPromise: C,
|
|
382
382
|
printAnnotationStoragePromise: b
|
|
383
|
-
}),
|
|
383
|
+
}), m.current) {
|
|
384
384
|
h();
|
|
385
385
|
return;
|
|
386
386
|
}
|
|
387
|
-
const z = await P(
|
|
387
|
+
const z = await P(f);
|
|
388
388
|
g.push(z);
|
|
389
389
|
const A = parseFloat((g.length / y * 100).toFixed(2));
|
|
390
390
|
o({
|
|
@@ -393,7 +393,7 @@ const So = () => {
|
|
|
393
393
|
percentage: A
|
|
394
394
|
});
|
|
395
395
|
}
|
|
396
|
-
if (
|
|
396
|
+
if (m.current) {
|
|
397
397
|
h();
|
|
398
398
|
return;
|
|
399
399
|
}
|
|
@@ -402,15 +402,15 @@ const So = () => {
|
|
|
402
402
|
} catch (s) {
|
|
403
403
|
c(!0), s instanceof Error && p(s);
|
|
404
404
|
} finally {
|
|
405
|
-
|
|
405
|
+
f.height = 0, f.width = 0;
|
|
406
406
|
}
|
|
407
|
-
}, [t, e,
|
|
407
|
+
}, [t, e, m]);
|
|
408
408
|
return W(() => {
|
|
409
|
-
const
|
|
409
|
+
const f = () => {
|
|
410
410
|
h(), _();
|
|
411
411
|
};
|
|
412
|
-
return window.addEventListener("afterprint",
|
|
413
|
-
window.removeEventListener("afterprint",
|
|
412
|
+
return window.addEventListener("afterprint", f, !0), () => {
|
|
413
|
+
window.removeEventListener("afterprint", f, !0);
|
|
414
414
|
};
|
|
415
415
|
}, [_, h]), {
|
|
416
416
|
print: u,
|
|
@@ -438,10 +438,10 @@ const So = () => {
|
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
440
|
}), Ms = ({ children: t }) => {
|
|
441
|
-
const [e, n] = $(null), [o, r] = $(null), { print: a, cancel: l, progress: c, isComplete: d, isError: p, error:
|
|
441
|
+
const [e, n] = $(null), [o, r] = $(null), { print: a, cancel: l, progress: c, isComplete: d, isError: p, error: m } = So(), _ = N((P) => {
|
|
442
442
|
P && typeof P == "function" && r(() => P);
|
|
443
443
|
}, []), h = (P) => {
|
|
444
|
-
|
|
444
|
+
m && P(m);
|
|
445
445
|
}, v = N(
|
|
446
446
|
(P) => {
|
|
447
447
|
n(() => P);
|
|
@@ -479,20 +479,24 @@ const So = () => {
|
|
|
479
479
|
if (!n.size)
|
|
480
480
|
return;
|
|
481
481
|
const d = c > n.size ? n.size : c, p = Array.from(n.values()).slice(0, d).map((h) => {
|
|
482
|
-
const { thumbnailViewport: v, scale: w } = Wt(
|
|
482
|
+
const { thumbnailViewport: v, scale: w } = Wt(
|
|
483
|
+
h.page,
|
|
484
|
+
o + h.defaultRotation
|
|
485
|
+
);
|
|
483
486
|
return {
|
|
484
487
|
scale: w,
|
|
485
488
|
page: h.page,
|
|
486
489
|
loading: !0,
|
|
487
|
-
viewport: v
|
|
490
|
+
viewport: v,
|
|
491
|
+
defaultRotation: h.defaultRotation
|
|
488
492
|
};
|
|
489
|
-
}),
|
|
490
|
-
e(
|
|
493
|
+
}), m = p.reduce((h, v) => (h[v.page.pageNumber] = v, h), {});
|
|
494
|
+
e(m);
|
|
491
495
|
const _ = [];
|
|
492
496
|
for (const h of p) {
|
|
493
497
|
const v = document.createElement("canvas"), w = vt(h.page, v, {
|
|
494
498
|
scale: h.scale,
|
|
495
|
-
rotate: o
|
|
499
|
+
rotate: o + h.defaultRotation
|
|
496
500
|
}).promise.then(() => {
|
|
497
501
|
const T = v.toDataURL();
|
|
498
502
|
return {
|
|
@@ -524,8 +528,8 @@ const So = () => {
|
|
|
524
528
|
const d = n.get(c);
|
|
525
529
|
if (!d)
|
|
526
530
|
return;
|
|
527
|
-
e((
|
|
528
|
-
...
|
|
531
|
+
e((m) => ({
|
|
532
|
+
...m,
|
|
529
533
|
[c]: {
|
|
530
534
|
loading: !0,
|
|
531
535
|
page: d.page,
|
|
@@ -535,16 +539,16 @@ const So = () => {
|
|
|
535
539
|
}));
|
|
536
540
|
const p = document.createElement("canvas");
|
|
537
541
|
vt(d.page, p, { scale: d.thumbnailScale, rotate: o }).promise.then(() => {
|
|
538
|
-
const
|
|
542
|
+
const m = p.toDataURL(), { thumbnailViewport: _, scale: h } = Wt(d.page, o);
|
|
539
543
|
return {
|
|
540
544
|
scale: h,
|
|
541
|
-
thumbnailSrc:
|
|
545
|
+
thumbnailSrc: m,
|
|
542
546
|
page: d.page,
|
|
543
547
|
loading: !1,
|
|
544
548
|
viewport: _
|
|
545
549
|
};
|
|
546
|
-
}).then((
|
|
547
|
-
e((_) => ({ ..._, [c]:
|
|
550
|
+
}).then((m) => {
|
|
551
|
+
e((_) => ({ ..._, [c]: m }));
|
|
548
552
|
});
|
|
549
553
|
},
|
|
550
554
|
[n, o]
|
|
@@ -573,12 +577,12 @@ const So = () => {
|
|
|
573
577
|
}
|
|
574
578
|
);
|
|
575
579
|
}, Io = (t = {}, e = "") => {
|
|
576
|
-
const [n, o] = $(e), [r, a] = $(!1), { pdf: l, pages: c } = Q(), { widths: d, heights: p } = Ue(),
|
|
580
|
+
const [n, o] = $(e), [r, a] = $(!1), { pdf: l, pages: c } = Q(), { widths: d, heights: p } = Ue(), m = H(!n), { currentZoom: _ } = Qe(), [h, v] = $([]), { setFocusedPage: w } = ie(), { columnCount: T } = Ee(), { rotate: P } = Ge(), [S, u] = $(0), { pageScrollElementRef: f, virtualScrollableElementRef: g } = et(), { scrollMode: s } = Le(), { pagesRef: C } = ge(), [b, y] = $(null), E = H({}), I = k(() => S === 0 ? null : h[S - 1], [S, h]), R = k(() => h.length, [h]);
|
|
577
581
|
W(() => {
|
|
578
582
|
if (!I || !c)
|
|
579
583
|
return;
|
|
580
|
-
const
|
|
581
|
-
if (!
|
|
584
|
+
const L = g || f;
|
|
585
|
+
if (!L || !C)
|
|
582
586
|
return;
|
|
583
587
|
const x = c.get(I.page);
|
|
584
588
|
if (s === J.PAGE_SCROLLING && w(I.page), !x)
|
|
@@ -605,7 +609,7 @@ const So = () => {
|
|
|
605
609
|
left: Math.max(ee, 0),
|
|
606
610
|
top: Math.max(X, 0)
|
|
607
611
|
};
|
|
608
|
-
|
|
612
|
+
L.scrollTo({
|
|
609
613
|
...le
|
|
610
614
|
});
|
|
611
615
|
}, [
|
|
@@ -616,36 +620,36 @@ const So = () => {
|
|
|
616
620
|
I,
|
|
617
621
|
s,
|
|
618
622
|
g,
|
|
619
|
-
|
|
623
|
+
f,
|
|
620
624
|
C
|
|
621
625
|
]);
|
|
622
626
|
const D = N(() => {
|
|
623
|
-
u((
|
|
624
|
-
}, [
|
|
625
|
-
u((
|
|
626
|
-
}, [
|
|
627
|
-
if (!
|
|
627
|
+
u((L) => R ? L + 1 > R ? 1 : L + 1 : 0);
|
|
628
|
+
}, [R]), z = N(() => {
|
|
629
|
+
u((L) => R ? L - 1 <= 0 ? R : L - 1 : 0);
|
|
630
|
+
}, [R]), A = N(async (L) => {
|
|
631
|
+
if (!L)
|
|
628
632
|
return {};
|
|
629
|
-
const x =
|
|
633
|
+
const x = L.numPages, O = {};
|
|
630
634
|
for (let M = 1; M <= x; M++) {
|
|
631
|
-
if (
|
|
635
|
+
if (m.current)
|
|
632
636
|
throw "close pop over";
|
|
633
|
-
const G = await
|
|
637
|
+
const G = await L.getPage(M);
|
|
634
638
|
O[M.toString()] = await G.getTextContent();
|
|
635
639
|
}
|
|
636
640
|
return O;
|
|
637
641
|
}, []);
|
|
638
642
|
return W(() => {
|
|
639
643
|
if (!n) {
|
|
640
|
-
|
|
644
|
+
m.current = !0, v([]), u(0);
|
|
641
645
|
return;
|
|
642
646
|
}
|
|
643
|
-
|
|
644
|
-
E.current =
|
|
645
|
-
const O = Object.keys(
|
|
647
|
+
m.current = !1, a(!0), v([]), u(0), A(l).then((L) => {
|
|
648
|
+
E.current = L;
|
|
649
|
+
const O = Object.keys(L).reduce((M, G) => {
|
|
646
650
|
const Z = cr(
|
|
647
651
|
[n],
|
|
648
|
-
|
|
652
|
+
L[G],
|
|
649
653
|
Number(G) - 1,
|
|
650
654
|
t
|
|
651
655
|
).map((j, q) => ({ ...j, page: Number(G), pageMatchIdx: q }));
|
|
@@ -660,7 +664,7 @@ const So = () => {
|
|
|
660
664
|
setSearch: o,
|
|
661
665
|
loading: r,
|
|
662
666
|
matches: h,
|
|
663
|
-
totalMatches:
|
|
667
|
+
totalMatches: R,
|
|
664
668
|
currentMatchPosition: S,
|
|
665
669
|
currentMatch: I,
|
|
666
670
|
nextMatch: D,
|
|
@@ -697,7 +701,7 @@ const So = () => {
|
|
|
697
701
|
currentMatchPosition: c,
|
|
698
702
|
currentMatch: d,
|
|
699
703
|
search: p,
|
|
700
|
-
matches:
|
|
704
|
+
matches: m,
|
|
701
705
|
nextMatch: _,
|
|
702
706
|
prevMatch: h,
|
|
703
707
|
currentMatchElement: v,
|
|
@@ -717,7 +721,7 @@ const So = () => {
|
|
|
717
721
|
nextMatch: _,
|
|
718
722
|
prevMatch: h,
|
|
719
723
|
search: p,
|
|
720
|
-
matches:
|
|
724
|
+
matches: m,
|
|
721
725
|
currentMatchElement: v,
|
|
722
726
|
setCurrentMatchElement: w
|
|
723
727
|
},
|
|
@@ -744,39 +748,39 @@ const So = () => {
|
|
|
744
748
|
return;
|
|
745
749
|
const p = a.get(e);
|
|
746
750
|
if (r.current && p) {
|
|
747
|
-
const
|
|
748
|
-
|
|
751
|
+
const m = r.current;
|
|
752
|
+
m.hidden = !0;
|
|
749
753
|
const _ = c.current;
|
|
750
|
-
_ && _.cancel(), o && o(), c.current = vt(p.page,
|
|
754
|
+
_ && _.cancel(), o && o(), c.current = vt(p.page, m, {
|
|
751
755
|
scale: d,
|
|
752
|
-
rotate: l,
|
|
756
|
+
rotate: l + p.defaultRotation,
|
|
753
757
|
renderForms: !0
|
|
754
758
|
}), c.current.promise.then(() => {
|
|
755
|
-
|
|
759
|
+
m.hidden = !1;
|
|
756
760
|
}).catch(() => {
|
|
757
761
|
}).finally(() => {
|
|
758
762
|
n && n();
|
|
759
763
|
});
|
|
760
764
|
}
|
|
761
765
|
return () => {
|
|
762
|
-
var
|
|
763
|
-
(
|
|
766
|
+
var m;
|
|
767
|
+
(m = c.current) == null || m.cancel();
|
|
764
768
|
};
|
|
765
769
|
}, [a, e, l, d, o, n]), /* @__PURE__ */ i("canvas", { "data-rp": `page-${e}-canvas`, ref: r });
|
|
766
|
-
},
|
|
770
|
+
}, Ro = "_selecting_usdup_9", he = {
|
|
767
771
|
"rp-text-layer": "_rp-text-layer_usdup_1",
|
|
768
|
-
selecting:
|
|
772
|
+
selecting: Ro,
|
|
769
773
|
"rp-text-layer-text": "_rp-text-layer-text_usdup_39"
|
|
770
|
-
},
|
|
774
|
+
}, Lo = (t) => {
|
|
771
775
|
const { pageNumber: e } = t, { pages: n } = Q(), o = H(null), { matches: r, currentMatch: a, setCurrentMatchElement: l } = It(), [c, d] = $(
|
|
772
776
|
[]
|
|
773
|
-
), p = H(),
|
|
774
|
-
(
|
|
775
|
-
if (s && lr(
|
|
777
|
+
), p = H(), m = H(), _ = H([]), h = k(() => r.filter((f) => f.pageIndex === e - 1), [r, e]), v = N(
|
|
778
|
+
(f, g, s = !1) => {
|
|
779
|
+
if (s && lr(f, g), !h.length) {
|
|
776
780
|
_.current = [], d([]);
|
|
777
781
|
return;
|
|
778
782
|
}
|
|
779
|
-
const C = dr(h,
|
|
783
|
+
const C = dr(h, f, g);
|
|
780
784
|
d(C);
|
|
781
785
|
},
|
|
782
786
|
[h]
|
|
@@ -820,7 +824,7 @@ const So = () => {
|
|
|
820
824
|
document.addEventListener(
|
|
821
825
|
"selectionchange",
|
|
822
826
|
() => {
|
|
823
|
-
var A,
|
|
827
|
+
var A, L;
|
|
824
828
|
const b = document.getSelection();
|
|
825
829
|
if (!b)
|
|
826
830
|
return;
|
|
@@ -844,12 +848,12 @@ const So = () => {
|
|
|
844
848
|
}
|
|
845
849
|
});
|
|
846
850
|
const E = b.getRangeAt(0);
|
|
847
|
-
let
|
|
848
|
-
|
|
849
|
-
const D = (A =
|
|
851
|
+
let R = C && (E.compareBoundaryPoints(Range.END_TO_END, C) === 0 || E.compareBoundaryPoints(Range.START_TO_END, C) === 0) ? E.startContainer : E.endContainer;
|
|
852
|
+
R.nodeType === Node.TEXT_NODE && (R = R.parentNode);
|
|
853
|
+
const D = (A = R.parentElement) == null ? void 0 : A.closest(
|
|
850
854
|
he["rp-text-layer"]
|
|
851
855
|
), z = D == null ? void 0 : D.querySelector(".endOfContent");
|
|
852
|
-
z && D && (z.style.width = D.style.width, z.style.height = D.style.height, (
|
|
856
|
+
z && D && (z.style.width = D.style.width, z.style.height = D.style.height, (L = R.parentElement) == null || L.insertBefore(z, R.nextSibling)), C = E.cloneRange();
|
|
853
857
|
},
|
|
854
858
|
{ signal: g }
|
|
855
859
|
);
|
|
@@ -867,34 +871,34 @@ const So = () => {
|
|
|
867
871
|
s.classList.remove("selected");
|
|
868
872
|
}), !c.length || !a || a.pageIndex !== e - 1)
|
|
869
873
|
return;
|
|
870
|
-
const
|
|
874
|
+
const f = h.findIndex(
|
|
871
875
|
(s) => JSON.stringify(s) === JSON.stringify(a)
|
|
872
876
|
);
|
|
873
|
-
if (
|
|
877
|
+
if (f === -1)
|
|
874
878
|
return;
|
|
875
|
-
const g = c.filter((s) => s.index ===
|
|
879
|
+
const g = c.filter((s) => s.index === f);
|
|
876
880
|
g.length && (_.current = g.map((s) => s.element), l(g[0].element), g.forEach((s) => {
|
|
877
881
|
s.element.classList.add("selected");
|
|
878
882
|
}));
|
|
879
883
|
}, [a, c, h]), W(() => {
|
|
880
|
-
const
|
|
881
|
-
if (!
|
|
884
|
+
const f = n.get(e);
|
|
885
|
+
if (!f || !o.current)
|
|
882
886
|
return;
|
|
883
887
|
const g = o.current;
|
|
884
|
-
return p.current && p.current.cancel(),
|
|
885
|
-
const C =
|
|
888
|
+
return p.current && p.current.cancel(), f.page.getTextContent().then((s) => {
|
|
889
|
+
const C = f.page.getViewport({ scale: 1 });
|
|
886
890
|
return p.current = new Sr.TextLayer({
|
|
887
891
|
viewport: C,
|
|
888
892
|
textContentSource: s,
|
|
889
893
|
container: g
|
|
890
|
-
}),
|
|
894
|
+
}), m.current = s, g && (g.innerText = ""), p.current.render();
|
|
891
895
|
}).then(() => {
|
|
892
896
|
var y, E;
|
|
893
897
|
[].slice.call(g.children).forEach((I) => {
|
|
894
898
|
I.classList.add(he["rp-text-layer-text"]), I.setAttribute("data-rp", "rp-text-layer-text");
|
|
895
899
|
});
|
|
896
900
|
const C = (y = p.current) == null ? void 0 : y.textDivs;
|
|
897
|
-
C &&
|
|
901
|
+
C && m.current && v(m.current, C);
|
|
898
902
|
const b = document.createElement("div");
|
|
899
903
|
b.className = "endOfContent", (E = o.current) == null || E.appendChild(b);
|
|
900
904
|
}).catch(() => {
|
|
@@ -908,7 +912,7 @@ const So = () => {
|
|
|
908
912
|
C.classList.add(he["rp-text-layer-text"]);
|
|
909
913
|
});
|
|
910
914
|
const g = (s = p.current) == null ? void 0 : s.textDivs;
|
|
911
|
-
g &&
|
|
915
|
+
g && m.current && v(m.current, g, !0);
|
|
912
916
|
}, [v]), /* @__PURE__ */ i(
|
|
913
917
|
"div",
|
|
914
918
|
{
|
|
@@ -924,7 +928,7 @@ const So = () => {
|
|
|
924
928
|
};
|
|
925
929
|
let No = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
926
930
|
const Oo = (t) => {
|
|
927
|
-
const { pageNumber: e } = t, n = H(null), { pages: o, pdf: r } = Q(), a = H(), [l, c] = $(), { setFocusedPage: d, goToPage: p } = ie(), { scrollMode:
|
|
931
|
+
const { pageNumber: e } = t, n = H(null), { pages: o, pdf: r } = Q(), a = H(), [l, c] = $(), { setFocusedPage: d, goToPage: p } = ie(), { scrollMode: m } = Le(), { print: _ } = tt(), { download: h } = $n(), v = k(() => o.get(e), [o, e]), w = k(() => v == null ? void 0 : v.page.getViewport(), [v]);
|
|
928
932
|
W(() => {
|
|
929
933
|
a.current && (a.current.div.replaceChildren(), a.current = void 0);
|
|
930
934
|
}, [r]), W(() => {
|
|
@@ -935,11 +939,11 @@ const Oo = (t) => {
|
|
|
935
939
|
const T = N(
|
|
936
940
|
(P) => {
|
|
937
941
|
!l || !r || (Er(P), Nr(P, r, l).then((S) => {
|
|
938
|
-
var u,
|
|
939
|
-
((u = S == null ? void 0 : S.data) == null ? void 0 : u.action) === "Print" ? _() : ((
|
|
940
|
-
}),
|
|
942
|
+
var u, f;
|
|
943
|
+
((u = S == null ? void 0 : S.data) == null ? void 0 : u.action) === "Print" ? _() : ((f = S == null ? void 0 : S.data) == null ? void 0 : f.action) === "SaveAs" && h();
|
|
944
|
+
}), m === J.PAGE_SCROLLING ? At(P, l, r, (S) => d(S.pageIndex + 1)) : At(P, l, r, (S) => p(S.pageIndex + 1)));
|
|
941
945
|
},
|
|
942
|
-
[r, l, p, d,
|
|
946
|
+
[r, l, p, d, m, _, h]
|
|
943
947
|
);
|
|
944
948
|
return W(() => {
|
|
945
949
|
if (!v || !l)
|
|
@@ -966,7 +970,7 @@ const Oo = (t) => {
|
|
|
966
970
|
const u = new AbortController();
|
|
967
971
|
return (async () => {
|
|
968
972
|
var C;
|
|
969
|
-
a.current && (a.current.div.replaceChildren(), a.current = void 0), n.current && (n.current.innerText = ""), a.current = new
|
|
973
|
+
a.current && (a.current.div.replaceChildren(), a.current = void 0), n.current && (n.current.innerText = ""), a.current = new Rr({
|
|
970
974
|
div: n.current,
|
|
971
975
|
accessibilityManager: void 0,
|
|
972
976
|
annotationCanvasMap: void 0,
|
|
@@ -988,7 +992,7 @@ const Oo = (t) => {
|
|
|
988
992
|
page: v.page,
|
|
989
993
|
imageResourcesPath: No,
|
|
990
994
|
renderForms: !0,
|
|
991
|
-
linkService: new
|
|
995
|
+
linkService: new Lr(),
|
|
992
996
|
downloadManager: null,
|
|
993
997
|
enableScripting: !1
|
|
994
998
|
});
|
|
@@ -1012,29 +1016,29 @@ const Oo = (t) => {
|
|
|
1012
1016
|
}, Do = {
|
|
1013
1017
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1014
1018
|
}, zo = ({ pageNumber: t, viewport: e }) => {
|
|
1015
|
-
const [n, o] = $(), { pages: r } = Q(), { highlightKeywords: a } = pr(), l = !0, c = H(null), [d, p] = $(null), [
|
|
1019
|
+
const [n, o] = $(), { pages: r } = Q(), { highlightKeywords: a } = pr(), l = !0, c = H(null), [d, p] = $(null), [m, _] = $([]);
|
|
1016
1020
|
W(() => {
|
|
1017
1021
|
c.current && p(c.current.parentElement);
|
|
1018
1022
|
}, [c]), W(() => {
|
|
1019
1023
|
(async () => {
|
|
1020
|
-
const
|
|
1021
|
-
if (!
|
|
1024
|
+
const f = r.get(t);
|
|
1025
|
+
if (!f || !c.current)
|
|
1022
1026
|
return;
|
|
1023
|
-
const g = await
|
|
1027
|
+
const g = await f.page.getTextContent();
|
|
1024
1028
|
o(g);
|
|
1025
1029
|
})();
|
|
1026
1030
|
}, [r, t]);
|
|
1027
1031
|
const h = k(() => a ? a.map((u) => {
|
|
1028
|
-
var
|
|
1032
|
+
var f, g;
|
|
1029
1033
|
return {
|
|
1030
|
-
...Ar(u.keyword, (
|
|
1034
|
+
...Ar(u.keyword, (f = u.options) == null ? void 0 : f.matchCase, (g = u.options) == null ? void 0 : g.wholeWords),
|
|
1031
1035
|
color: u.highlightColor
|
|
1032
1036
|
};
|
|
1033
1037
|
}) : [], [a]);
|
|
1034
|
-
function v(u,
|
|
1038
|
+
function v(u, f) {
|
|
1035
1039
|
if (!u)
|
|
1036
1040
|
return;
|
|
1037
|
-
const g = `[data-rp="page-${
|
|
1041
|
+
const g = `[data-rp="page-${f}-textLayer"]`;
|
|
1038
1042
|
return new Promise((s) => {
|
|
1039
1043
|
const C = u.querySelector(g);
|
|
1040
1044
|
if (C) {
|
|
@@ -1048,23 +1052,23 @@ const Oo = (t) => {
|
|
|
1048
1052
|
});
|
|
1049
1053
|
}
|
|
1050
1054
|
function w(u) {
|
|
1051
|
-
return new Promise((
|
|
1055
|
+
return new Promise((f) => {
|
|
1052
1056
|
const g = u.querySelectorAll(
|
|
1053
1057
|
'[data-rp="rp-text-layer-text"]'
|
|
1054
1058
|
);
|
|
1055
1059
|
if (g.length) {
|
|
1056
|
-
|
|
1060
|
+
f(Array.from(g));
|
|
1057
1061
|
return;
|
|
1058
1062
|
}
|
|
1059
1063
|
new MutationObserver((C, b) => {
|
|
1060
1064
|
const y = u.querySelectorAll(
|
|
1061
1065
|
".vpv-text-layer-text"
|
|
1062
1066
|
);
|
|
1063
|
-
y.length && (
|
|
1067
|
+
y.length && (f(Array.from(y)), b.disconnect());
|
|
1064
1068
|
}).observe(u, { childList: !0, subtree: !0 });
|
|
1065
1069
|
});
|
|
1066
1070
|
}
|
|
1067
|
-
const T = (u,
|
|
1071
|
+
const T = (u, f, g, s) => {
|
|
1068
1072
|
var Z;
|
|
1069
1073
|
const C = document.createRange(), b = g.firstChild;
|
|
1070
1074
|
if (!b || b.nodeType !== Node.TEXT_NODE)
|
|
@@ -1073,20 +1077,20 @@ const Oo = (t) => {
|
|
|
1073
1077
|
if (E > y || I + 1 > y)
|
|
1074
1078
|
return null;
|
|
1075
1079
|
C.setStart(b, E), C.setEnd(b, I + 1);
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1078
|
-
const D =
|
|
1079
|
-
return Wr(
|
|
1080
|
-
keywordStr:
|
|
1080
|
+
const R = document.createElement("span");
|
|
1081
|
+
R.style.width = "auto", C.surroundContents(R);
|
|
1082
|
+
const D = R.getBoundingClientRect(), z = u.getBoundingClientRect(), A = z.height, L = z.width, x = 100 * (D.left - z.left) / L, O = 100 * (D.top - z.top) / A, M = 100 * D.height / A, G = 100 * D.width / L;
|
|
1083
|
+
return Wr(R), {
|
|
1084
|
+
keywordStr: f,
|
|
1081
1085
|
left: x,
|
|
1082
1086
|
top: O,
|
|
1083
1087
|
height: M,
|
|
1084
1088
|
width: G,
|
|
1085
1089
|
pageHeight: A,
|
|
1086
|
-
pageWidth:
|
|
1090
|
+
pageWidth: L
|
|
1087
1091
|
};
|
|
1088
1092
|
};
|
|
1089
|
-
async function P(u,
|
|
1093
|
+
async function P(u, f) {
|
|
1090
1094
|
const g = await v(d, u);
|
|
1091
1095
|
if (!g)
|
|
1092
1096
|
return;
|
|
@@ -1094,8 +1098,8 @@ const Oo = (t) => {
|
|
|
1094
1098
|
if (s.length) {
|
|
1095
1099
|
const C = s.map((y) => y.tagName === "BR" ? " " : y.textContent).reduce(
|
|
1096
1100
|
(y, E, I) => y.concat(
|
|
1097
|
-
E.split("").map((
|
|
1098
|
-
char:
|
|
1101
|
+
E.split("").map((R, D) => ({
|
|
1102
|
+
char: R,
|
|
1099
1103
|
charIdxInSpan: D,
|
|
1100
1104
|
spanIdx: I
|
|
1101
1105
|
}))
|
|
@@ -1107,27 +1111,27 @@ const Oo = (t) => {
|
|
|
1107
1111
|
spanIdx: 0
|
|
1108
1112
|
}
|
|
1109
1113
|
]
|
|
1110
|
-
).slice(1), b = S(g,
|
|
1114
|
+
).slice(1), b = S(g, f, s, C);
|
|
1111
1115
|
_(b);
|
|
1112
1116
|
}
|
|
1113
1117
|
}
|
|
1114
|
-
const S = (u,
|
|
1115
|
-
const C =
|
|
1118
|
+
const S = (u, f, g, s) => {
|
|
1119
|
+
const C = f.length;
|
|
1116
1120
|
if (!s.length || !C)
|
|
1117
1121
|
return [];
|
|
1118
1122
|
const b = [], y = s.map((E) => E.char).join("");
|
|
1119
1123
|
return h.forEach((E) => {
|
|
1120
|
-
const { keyword: I, regExp:
|
|
1124
|
+
const { keyword: I, regExp: R, wholeWords: D, color: z } = E, A = I;
|
|
1121
1125
|
if (!A.trim())
|
|
1122
1126
|
return;
|
|
1123
|
-
const
|
|
1127
|
+
const L = R.flags.indexOf("g") === -1 ? new RegExp(R, `${R.flags}g`) : R;
|
|
1124
1128
|
let x;
|
|
1125
1129
|
const O = [];
|
|
1126
|
-
for (; (x =
|
|
1130
|
+
for (; (x = L.exec(y)) !== null; )
|
|
1127
1131
|
D && !ur(y, x.index, x[0].length) || O.push({
|
|
1128
|
-
keyword:
|
|
1132
|
+
keyword: L,
|
|
1129
1133
|
startIndex: x.index,
|
|
1130
|
-
endIndex:
|
|
1134
|
+
endIndex: L.lastIndex
|
|
1131
1135
|
});
|
|
1132
1136
|
const M = O.map((G) => ({
|
|
1133
1137
|
keyword: G.keyword,
|
|
@@ -1162,11 +1166,11 @@ const Oo = (t) => {
|
|
|
1162
1166
|
if (!(!a || a.length === 0))
|
|
1163
1167
|
try {
|
|
1164
1168
|
await P(t, a);
|
|
1165
|
-
} catch (
|
|
1166
|
-
console.error(
|
|
1169
|
+
} catch (f) {
|
|
1170
|
+
console.error(f);
|
|
1167
1171
|
}
|
|
1168
1172
|
})();
|
|
1169
|
-
}, [l, a, t, n, e]), /* @__PURE__ */ i(
|
|
1173
|
+
}, [l, a, t, n, e]), /* @__PURE__ */ i(me, { children: /* @__PURE__ */ i("div", { ref: c, "data-rp": `page-${t}-textHighlightLayer`, children: m.map((u, f) => /* @__PURE__ */ i(
|
|
1170
1174
|
"div",
|
|
1171
1175
|
{
|
|
1172
1176
|
className: Do["rp-text-highlight"],
|
|
@@ -1178,16 +1182,19 @@ const Oo = (t) => {
|
|
|
1178
1182
|
backgroundColor: u.highlightColor
|
|
1179
1183
|
}
|
|
1180
1184
|
},
|
|
1181
|
-
|
|
1185
|
+
f
|
|
1182
1186
|
)) }) });
|
|
1183
1187
|
}, xt = $e((t, e) => {
|
|
1184
|
-
const { pageNumber: n, style: o, ...r } = t, { pages: a } = Q(), { rotate: l } = Ge(), { textLayer: c } = or(), { currentZoom: d } = Qe(), p = H(a.get(n)), [
|
|
1188
|
+
const { pageNumber: n, style: o, ...r } = t, { pages: a } = Q(), { rotate: l } = Ge(), { textLayer: c } = or(), { currentZoom: d } = Qe(), p = H(a.get(n)), [m, _] = $(!1), h = H(null), [v, w] = $({
|
|
1185
1189
|
width: 0,
|
|
1186
1190
|
height: 0
|
|
1187
1191
|
});
|
|
1188
1192
|
cn(e, () => h.current), W(() => {
|
|
1189
1193
|
if (a && (p.current = a.get(n), p.current)) {
|
|
1190
|
-
const u = p.current.page.getViewport({
|
|
1194
|
+
const u = p.current.page.getViewport({
|
|
1195
|
+
scale: d,
|
|
1196
|
+
rotation: l + p.current.defaultRotation
|
|
1197
|
+
});
|
|
1191
1198
|
w(u);
|
|
1192
1199
|
}
|
|
1193
1200
|
}, [a, n, l, d]);
|
|
@@ -1230,8 +1237,8 @@ const Oo = (t) => {
|
|
|
1230
1237
|
className: lt["rp-page"],
|
|
1231
1238
|
children: [
|
|
1232
1239
|
/* @__PURE__ */ i(xo, { onLoading: P, onLoaded: S, pageNumber: n }),
|
|
1233
|
-
|
|
1234
|
-
c && /* @__PURE__ */ i(
|
|
1240
|
+
m && /* @__PURE__ */ i("div", { className: lt["rp-loader-wrapper"], children: /* @__PURE__ */ i(Ct, {}) }),
|
|
1241
|
+
c && /* @__PURE__ */ i(Lo, { pageNumber: n }),
|
|
1235
1242
|
/* @__PURE__ */ i(zo, { pageNumber: n, viewport: v }),
|
|
1236
1243
|
/* @__PURE__ */ i(Oo, { pageNumber: n })
|
|
1237
1244
|
]
|
|
@@ -1333,7 +1340,7 @@ var $o = 150, Go = function(e) {
|
|
|
1333
1340
|
}, Be = null, Ze = null, je = null;
|
|
1334
1341
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Be = /* @__PURE__ */ new WeakSet(), Ze = /* @__PURE__ */ new WeakSet(), je = /* @__PURE__ */ new WeakSet());
|
|
1335
1342
|
function Uo(t) {
|
|
1336
|
-
var e, n = t.getColumnOffset, o = t.getColumnStartIndexForOffset, r = t.getColumnStopIndexForStartIndex, a = t.getColumnWidth, l = t.getEstimatedTotalHeight, c = t.getEstimatedTotalWidth, d = t.getOffsetForColumnAndAlignment, p = t.getOffsetForRowAndAlignment,
|
|
1343
|
+
var e, n = t.getColumnOffset, o = t.getColumnStartIndexForOffset, r = t.getColumnStopIndexForStartIndex, a = t.getColumnWidth, l = t.getEstimatedTotalHeight, c = t.getEstimatedTotalWidth, d = t.getOffsetForColumnAndAlignment, p = t.getOffsetForRowAndAlignment, m = t.getRowHeight, _ = t.getRowOffset, h = t.getRowStartIndexForOffset, v = t.getRowStopIndexForStartIndex, w = t.initInstanceProps, T = t.shouldResetStyleCacheOnItemSizeChange, P = t.validateProps;
|
|
1337
1344
|
return e = /* @__PURE__ */ function(S) {
|
|
1338
1345
|
Ao(u, S);
|
|
1339
1346
|
function u(g) {
|
|
@@ -1346,14 +1353,14 @@ function Uo(t) {
|
|
|
1346
1353
|
scrollTop: typeof s.props.initialScrollTop == "number" ? s.props.initialScrollTop : 0,
|
|
1347
1354
|
scrollUpdateWasRequested: !1,
|
|
1348
1355
|
verticalScrollDirection: "forward"
|
|
1349
|
-
}, s._callOnItemsRendered = void 0, s._callOnItemsRendered = dt(function(C, b, y, E, I,
|
|
1356
|
+
}, s._callOnItemsRendered = void 0, s._callOnItemsRendered = dt(function(C, b, y, E, I, R, D, z) {
|
|
1350
1357
|
return s.props.onItemsRendered({
|
|
1351
1358
|
overscanColumnStartIndex: C,
|
|
1352
1359
|
overscanColumnStopIndex: b,
|
|
1353
1360
|
overscanRowStartIndex: y,
|
|
1354
1361
|
overscanRowStopIndex: E,
|
|
1355
1362
|
visibleColumnStartIndex: I,
|
|
1356
|
-
visibleColumnStopIndex:
|
|
1363
|
+
visibleColumnStopIndex: R,
|
|
1357
1364
|
visibleRowStartIndex: D,
|
|
1358
1365
|
visibleRowStopIndex: z
|
|
1359
1366
|
});
|
|
@@ -1366,17 +1373,17 @@ function Uo(t) {
|
|
|
1366
1373
|
scrollUpdateWasRequested: I
|
|
1367
1374
|
});
|
|
1368
1375
|
}), s._getItemStyle = void 0, s._getItemStyle = function(C, b) {
|
|
1369
|
-
var y = s.props, E = y.columnWidth, I = y.direction,
|
|
1376
|
+
var y = s.props, E = y.columnWidth, I = y.direction, R = y.rowHeight, D = s._getItemStyleCache(T && E, T && I, T && R), z = C + ":" + b, A;
|
|
1370
1377
|
if (D.hasOwnProperty(z))
|
|
1371
1378
|
A = D[z];
|
|
1372
1379
|
else {
|
|
1373
|
-
var
|
|
1380
|
+
var L = n(s.props, b, s._instanceProps), x = I === "rtl";
|
|
1374
1381
|
D[z] = A = {
|
|
1375
1382
|
position: "absolute",
|
|
1376
|
-
left: x ? void 0 :
|
|
1377
|
-
right: x ?
|
|
1383
|
+
left: x ? void 0 : L,
|
|
1384
|
+
right: x ? L : void 0,
|
|
1378
1385
|
top: _(s.props, C, s._instanceProps),
|
|
1379
|
-
height:
|
|
1386
|
+
height: m(s.props, C, s._instanceProps),
|
|
1380
1387
|
width: a(s.props, b, s._instanceProps)
|
|
1381
1388
|
};
|
|
1382
1389
|
}
|
|
@@ -1384,12 +1391,12 @@ function Uo(t) {
|
|
|
1384
1391
|
}, s._getItemStyleCache = void 0, s._getItemStyleCache = dt(function(C, b, y) {
|
|
1385
1392
|
return {};
|
|
1386
1393
|
}), s._onScroll = function(C) {
|
|
1387
|
-
var b = C.currentTarget, y = b.clientHeight, E = b.clientWidth, I = b.scrollLeft,
|
|
1394
|
+
var b = C.currentTarget, y = b.clientHeight, E = b.clientWidth, I = b.scrollLeft, R = b.scrollTop, D = b.scrollHeight, z = b.scrollWidth;
|
|
1388
1395
|
s.setState(function(A) {
|
|
1389
|
-
if (A.scrollLeft === I && A.scrollTop ===
|
|
1396
|
+
if (A.scrollLeft === I && A.scrollTop === R)
|
|
1390
1397
|
return null;
|
|
1391
|
-
var
|
|
1392
|
-
if (
|
|
1398
|
+
var L = s.props.direction, x = I;
|
|
1399
|
+
if (L === "rtl")
|
|
1393
1400
|
switch (jt()) {
|
|
1394
1401
|
case "negative":
|
|
1395
1402
|
x = -I;
|
|
@@ -1399,13 +1406,13 @@ function Uo(t) {
|
|
|
1399
1406
|
break;
|
|
1400
1407
|
}
|
|
1401
1408
|
x = Math.max(0, Math.min(x, z - E));
|
|
1402
|
-
var O = Math.max(0, Math.min(
|
|
1409
|
+
var O = Math.max(0, Math.min(R, D - y));
|
|
1403
1410
|
return {
|
|
1404
1411
|
isScrolling: !0,
|
|
1405
1412
|
horizontalScrollDirection: A.scrollLeft < I ? "forward" : "backward",
|
|
1406
1413
|
scrollLeft: x,
|
|
1407
1414
|
scrollTop: O,
|
|
1408
|
-
verticalScrollDirection: A.scrollTop <
|
|
1415
|
+
verticalScrollDirection: A.scrollTop < R ? "forward" : "backward",
|
|
1409
1416
|
scrollUpdateWasRequested: !1
|
|
1410
1417
|
};
|
|
1411
1418
|
}, s._resetIsScrollingDebounced);
|
|
@@ -1425,8 +1432,8 @@ function Uo(t) {
|
|
|
1425
1432
|
u.getDerivedStateFromProps = function(s, C) {
|
|
1426
1433
|
return Vo(s, C), P(s), null;
|
|
1427
1434
|
};
|
|
1428
|
-
var
|
|
1429
|
-
return
|
|
1435
|
+
var f = u.prototype;
|
|
1436
|
+
return f.scrollTo = function(s) {
|
|
1430
1437
|
var C = s.scrollLeft, b = s.scrollTop;
|
|
1431
1438
|
C !== void 0 && (C = Math.max(0, C)), b !== void 0 && (b = Math.max(0, b)), this.setState(function(y) {
|
|
1432
1439
|
return C === void 0 && (C = y.scrollLeft), b === void 0 && (b = y.scrollTop), y.scrollLeft === C && y.scrollTop === b ? null : {
|
|
@@ -1437,22 +1444,22 @@ function Uo(t) {
|
|
|
1437
1444
|
verticalScrollDirection: y.scrollTop < b ? "forward" : "backward"
|
|
1438
1445
|
};
|
|
1439
1446
|
}, this._resetIsScrollingDebounced);
|
|
1440
|
-
},
|
|
1441
|
-
var C = s.align, b = C === void 0 ? "auto" : C, y = s.columnIndex, E = s.rowIndex, I = this.props,
|
|
1442
|
-
y !== void 0 && (y = Math.max(0, Math.min(y,
|
|
1447
|
+
}, f.scrollToItem = function(s) {
|
|
1448
|
+
var C = s.align, b = C === void 0 ? "auto" : C, y = s.columnIndex, E = s.rowIndex, I = this.props, R = I.columnCount, D = I.height, z = I.rowCount, A = I.width, L = this.state, x = L.scrollLeft, O = L.scrollTop, M = Ho();
|
|
1449
|
+
y !== void 0 && (y = Math.max(0, Math.min(y, R - 1))), E !== void 0 && (E = Math.max(0, Math.min(E, z - 1)));
|
|
1443
1450
|
var G = l(this.props, this._instanceProps), Z = c(this.props, this._instanceProps), j = Z > A ? M : 0, q = G > D ? M : 0;
|
|
1444
1451
|
this.scrollTo({
|
|
1445
1452
|
scrollLeft: y !== void 0 ? d(this.props, y, b, x, this._instanceProps, q) : x,
|
|
1446
1453
|
scrollTop: E !== void 0 ? p(this.props, E, b, O, this._instanceProps, j) : O
|
|
1447
1454
|
});
|
|
1448
|
-
},
|
|
1455
|
+
}, f.componentDidMount = function() {
|
|
1449
1456
|
var s = this.props, C = s.initialScrollLeft, b = s.initialScrollTop;
|
|
1450
1457
|
if (this._outerRef != null) {
|
|
1451
1458
|
var y = this._outerRef;
|
|
1452
1459
|
typeof C == "number" && (y.scrollLeft = C), typeof b == "number" && (y.scrollTop = b);
|
|
1453
1460
|
}
|
|
1454
1461
|
this._callPropsCallbacks();
|
|
1455
|
-
},
|
|
1462
|
+
}, f.componentDidUpdate = function() {
|
|
1456
1463
|
var s = this.props.direction, C = this.state, b = C.scrollLeft, y = C.scrollTop, E = C.scrollUpdateWasRequested;
|
|
1457
1464
|
if (E && this._outerRef != null) {
|
|
1458
1465
|
var I = this._outerRef;
|
|
@@ -1465,8 +1472,8 @@ function Uo(t) {
|
|
|
1465
1472
|
I.scrollLeft = b;
|
|
1466
1473
|
break;
|
|
1467
1474
|
default:
|
|
1468
|
-
var
|
|
1469
|
-
I.scrollLeft = D -
|
|
1475
|
+
var R = I.clientWidth, D = I.scrollWidth;
|
|
1476
|
+
I.scrollLeft = D - R - b;
|
|
1470
1477
|
break;
|
|
1471
1478
|
}
|
|
1472
1479
|
else
|
|
@@ -1474,10 +1481,10 @@ function Uo(t) {
|
|
|
1474
1481
|
I.scrollTop = Math.max(0, y);
|
|
1475
1482
|
}
|
|
1476
1483
|
this._callPropsCallbacks();
|
|
1477
|
-
},
|
|
1484
|
+
}, f.componentWillUnmount = function() {
|
|
1478
1485
|
this._resetIsScrollingTimeoutId !== null && Zt(this._resetIsScrollingTimeoutId);
|
|
1479
|
-
},
|
|
1480
|
-
var s = this.props, C = s.children, b = s.className, y = s.columnCount, E = s.direction, I = s.height,
|
|
1486
|
+
}, f.render = function() {
|
|
1487
|
+
var s = this.props, C = s.children, b = s.className, y = s.columnCount, E = s.direction, I = s.height, R = s.innerRef, D = s.innerElementType, z = s.innerTagName, A = s.itemData, L = s.itemKey, x = L === void 0 ? Go : L, O = s.outerElementType, M = s.outerTagName, G = s.rowCount, Z = s.style, j = s.useIsScrolling, q = s.width, ee = this.state.isScrolling, X = this._getHorizontalRangeToRender(), le = X[0], ae = X[1], de = this._getVerticalRangeToRender(), te = de[0], Fe = de[1], Ne = [];
|
|
1481
1488
|
if (y > 0 && G)
|
|
1482
1489
|
for (var Pe = te; Pe <= Fe; Pe++)
|
|
1483
1490
|
for (var we = le; we <= ae; we++)
|
|
@@ -1509,34 +1516,34 @@ function Uo(t) {
|
|
|
1509
1516
|
}, Z)
|
|
1510
1517
|
}, qe(D || z || "div", {
|
|
1511
1518
|
children: Ne,
|
|
1512
|
-
ref:
|
|
1519
|
+
ref: R,
|
|
1513
1520
|
style: {
|
|
1514
1521
|
height: nt,
|
|
1515
1522
|
pointerEvents: ee ? "none" : void 0,
|
|
1516
1523
|
width: rt
|
|
1517
1524
|
}
|
|
1518
1525
|
}));
|
|
1519
|
-
},
|
|
1526
|
+
}, f._callPropsCallbacks = function() {
|
|
1520
1527
|
var s = this.props, C = s.columnCount, b = s.onItemsRendered, y = s.onScroll, E = s.rowCount;
|
|
1521
1528
|
if (typeof b == "function" && C > 0 && E > 0) {
|
|
1522
|
-
var I = this._getHorizontalRangeToRender(),
|
|
1523
|
-
this._callOnItemsRendered(
|
|
1529
|
+
var I = this._getHorizontalRangeToRender(), R = I[0], D = I[1], z = I[2], A = I[3], L = this._getVerticalRangeToRender(), x = L[0], O = L[1], M = L[2], G = L[3];
|
|
1530
|
+
this._callOnItemsRendered(R, D, x, O, z, A, M, G);
|
|
1524
1531
|
}
|
|
1525
1532
|
if (typeof y == "function") {
|
|
1526
1533
|
var Z = this.state, j = Z.horizontalScrollDirection, q = Z.scrollLeft, ee = Z.scrollTop, X = Z.scrollUpdateWasRequested, le = Z.verticalScrollDirection;
|
|
1527
1534
|
this._callOnScroll(q, ee, j, le, X);
|
|
1528
1535
|
}
|
|
1529
|
-
},
|
|
1530
|
-
var s = this.props, C = s.columnCount, b = s.overscanColumnCount, y = s.overscanColumnsCount, E = s.overscanCount, I = s.rowCount,
|
|
1536
|
+
}, f._getHorizontalRangeToRender = function() {
|
|
1537
|
+
var s = this.props, C = s.columnCount, b = s.overscanColumnCount, y = s.overscanColumnsCount, E = s.overscanCount, I = s.rowCount, R = this.state, D = R.horizontalScrollDirection, z = R.isScrolling, A = R.scrollLeft, L = b || y || E || 1;
|
|
1531
1538
|
if (C === 0 || I === 0)
|
|
1532
1539
|
return [0, 0, 0, 0];
|
|
1533
|
-
var x = o(this.props, A, this._instanceProps), O = r(this.props, x, A, this._instanceProps), M = !z || D === "backward" ? Math.max(1,
|
|
1540
|
+
var x = o(this.props, A, this._instanceProps), O = r(this.props, x, A, this._instanceProps), M = !z || D === "backward" ? Math.max(1, L) : 1, G = !z || D === "forward" ? Math.max(1, L) : 1;
|
|
1534
1541
|
return [Math.max(0, x - M), Math.max(0, Math.min(C - 1, O + G)), x, O];
|
|
1535
|
-
},
|
|
1536
|
-
var s = this.props, C = s.columnCount, b = s.overscanCount, y = s.overscanRowCount, E = s.overscanRowsCount, I = s.rowCount,
|
|
1542
|
+
}, f._getVerticalRangeToRender = function() {
|
|
1543
|
+
var s = this.props, C = s.columnCount, b = s.overscanCount, y = s.overscanRowCount, E = s.overscanRowsCount, I = s.rowCount, R = this.state, D = R.isScrolling, z = R.verticalScrollDirection, A = R.scrollTop, L = y || E || b || 1;
|
|
1537
1544
|
if (C === 0 || I === 0)
|
|
1538
1545
|
return [0, 0, 0, 0];
|
|
1539
|
-
var x = h(this.props, A, this._instanceProps), O = v(this.props, x, A, this._instanceProps), M = !D || z === "backward" ? Math.max(1,
|
|
1546
|
+
var x = h(this.props, A, this._instanceProps), O = v(this.props, x, A, this._instanceProps), M = !D || z === "backward" ? Math.max(1, L) : 1, G = !D || z === "forward" ? Math.max(1, L) : 1;
|
|
1540
1547
|
return [Math.max(0, x - M), Math.max(0, Math.min(I - 1, O + G)), x, O];
|
|
1541
1548
|
}, u;
|
|
1542
1549
|
}(Qn), e.defaultProps = {
|
|
@@ -1546,9 +1553,9 @@ function Uo(t) {
|
|
|
1546
1553
|
}, e;
|
|
1547
1554
|
}
|
|
1548
1555
|
var Vo = function(e, n) {
|
|
1549
|
-
var o = e.children, r = e.direction, a = e.height, l = e.innerTagName, c = e.outerTagName, d = e.overscanColumnsCount, p = e.overscanCount,
|
|
1556
|
+
var o = e.children, r = e.direction, a = e.height, l = e.innerTagName, c = e.outerTagName, d = e.overscanColumnsCount, p = e.overscanCount, m = e.overscanRowsCount, _ = e.width, h = n.instance;
|
|
1550
1557
|
if (process.env.NODE_ENV !== "production") {
|
|
1551
|
-
if (typeof p == "number" && Be && !Be.has(h) && (Be.add(h), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof d == "number" || typeof
|
|
1558
|
+
if (typeof p == "number" && Be && !Be.has(h) && (Be.add(h), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof d == "number" || typeof m == "number") && Ze && !Ze.has(h) && (Ze.add(h), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (l != null || c != null) && je && !je.has(h) && (je.add(h), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), o == null)
|
|
1552
1559
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
1553
1560
|
switch (r) {
|
|
1554
1561
|
case "ltr":
|
|
@@ -1568,17 +1575,17 @@ var Vo = function(e, n) {
|
|
|
1568
1575
|
var d = r[l];
|
|
1569
1576
|
c = d.offset + d.size;
|
|
1570
1577
|
}
|
|
1571
|
-
var p = o - l - 1,
|
|
1572
|
-
return c +
|
|
1578
|
+
var p = o - l - 1, m = p * a;
|
|
1579
|
+
return c + m;
|
|
1573
1580
|
}, yn = function(e, n) {
|
|
1574
1581
|
var o = e.columnCount, r = n.columnMetadataMap, a = n.estimatedColumnWidth, l = n.lastMeasuredColumnIndex, c = 0;
|
|
1575
1582
|
if (l >= o && (l = o - 1), l >= 0) {
|
|
1576
1583
|
var d = r[l];
|
|
1577
1584
|
c = d.offset + d.size;
|
|
1578
1585
|
}
|
|
1579
|
-
var p = o - l - 1,
|
|
1580
|
-
return c +
|
|
1581
|
-
},
|
|
1586
|
+
var p = o - l - 1, m = p * a;
|
|
1587
|
+
return c + m;
|
|
1588
|
+
}, fe = function(e, n, o, r) {
|
|
1582
1589
|
var a, l, c;
|
|
1583
1590
|
if (e === "column" ? (a = r.columnMetadataMap, l = n.columnWidth, c = r.lastMeasuredColumnIndex) : (a = r.rowMetadataMap, l = n.rowHeight, c = r.lastMeasuredRowIndex), o > c) {
|
|
1584
1591
|
var d = 0;
|
|
@@ -1586,9 +1593,9 @@ var Vo = function(e, n) {
|
|
|
1586
1593
|
var p = a[c];
|
|
1587
1594
|
d = p.offset + p.size;
|
|
1588
1595
|
}
|
|
1589
|
-
for (var
|
|
1590
|
-
var _ = l(
|
|
1591
|
-
a[
|
|
1596
|
+
for (var m = c + 1; m <= o; m++) {
|
|
1597
|
+
var _ = l(m);
|
|
1598
|
+
a[m] = {
|
|
1592
1599
|
offset: d,
|
|
1593
1600
|
size: _
|
|
1594
1601
|
}, d += _;
|
|
@@ -1603,18 +1610,18 @@ var Vo = function(e, n) {
|
|
|
1603
1610
|
return c >= r ? In(e, n, o, l, 0, r) : qo(e, n, o, Math.max(0, l), r);
|
|
1604
1611
|
}, In = function(e, n, o, r, a, l) {
|
|
1605
1612
|
for (; a <= r; ) {
|
|
1606
|
-
var c = a + Math.floor((r - a) / 2), d =
|
|
1613
|
+
var c = a + Math.floor((r - a) / 2), d = fe(e, n, c, o).offset;
|
|
1607
1614
|
if (d === l)
|
|
1608
1615
|
return c;
|
|
1609
1616
|
d < l ? a = c + 1 : d > l && (r = c - 1);
|
|
1610
1617
|
}
|
|
1611
1618
|
return a > 0 ? a - 1 : 0;
|
|
1612
1619
|
}, qo = function(e, n, o, r, a) {
|
|
1613
|
-
for (var l = e === "column" ? n.columnCount : n.rowCount, c = 1; r < l &&
|
|
1620
|
+
for (var l = e === "column" ? n.columnCount : n.rowCount, c = 1; r < l && fe(e, n, r, o).offset < a; )
|
|
1614
1621
|
r += c, c *= 2;
|
|
1615
1622
|
return In(e, n, o, Math.min(r, l - 1), Math.floor(r / 2), a);
|
|
1616
1623
|
}, Yt = function(e, n, o, r, a, l, c) {
|
|
1617
|
-
var d = e === "column" ? n.width : n.height, p =
|
|
1624
|
+
var d = e === "column" ? n.width : n.height, p = fe(e, n, o, l), m = e === "column" ? yn(n, l) : Sn(n, l), _ = Math.max(0, Math.min(m - d, p.offset)), h = Math.max(0, p.offset - d + c + p.size);
|
|
1618
1625
|
switch (r === "smart" && (a >= h - d && a <= _ + d ? r = "auto" : r = "center"), r) {
|
|
1619
1626
|
case "start":
|
|
1620
1627
|
return _;
|
|
@@ -1628,15 +1635,15 @@ var Vo = function(e, n) {
|
|
|
1628
1635
|
}
|
|
1629
1636
|
}, Bo = /* @__PURE__ */ Uo({
|
|
1630
1637
|
getColumnOffset: function(e, n, o) {
|
|
1631
|
-
return
|
|
1638
|
+
return fe("column", e, n, o).offset;
|
|
1632
1639
|
},
|
|
1633
1640
|
getColumnStartIndexForOffset: function(e, n, o) {
|
|
1634
1641
|
return Xt("column", e, o, n);
|
|
1635
1642
|
},
|
|
1636
1643
|
getColumnStopIndexForStartIndex: function(e, n, o, r) {
|
|
1637
|
-
for (var a = e.columnCount, l = e.width, c =
|
|
1638
|
-
|
|
1639
|
-
return
|
|
1644
|
+
for (var a = e.columnCount, l = e.width, c = fe("column", e, n, r), d = o + l, p = c.offset + c.size, m = n; m < a - 1 && p < d; )
|
|
1645
|
+
m++, p += fe("column", e, m, r).size;
|
|
1646
|
+
return m;
|
|
1640
1647
|
},
|
|
1641
1648
|
getColumnWidth: function(e, n, o) {
|
|
1642
1649
|
return o.columnMetadataMap[n].size;
|
|
@@ -1650,7 +1657,7 @@ var Vo = function(e, n) {
|
|
|
1650
1657
|
return Yt("row", e, n, o, r, a, l);
|
|
1651
1658
|
},
|
|
1652
1659
|
getRowOffset: function(e, n, o) {
|
|
1653
|
-
return
|
|
1660
|
+
return fe("row", e, n, o).offset;
|
|
1654
1661
|
},
|
|
1655
1662
|
getRowHeight: function(e, n, o) {
|
|
1656
1663
|
return o.rowMetadataMap[n].size;
|
|
@@ -1659,9 +1666,9 @@ var Vo = function(e, n) {
|
|
|
1659
1666
|
return Xt("row", e, o, n);
|
|
1660
1667
|
},
|
|
1661
1668
|
getRowStopIndexForStartIndex: function(e, n, o, r) {
|
|
1662
|
-
for (var a = e.rowCount, l = e.height, c =
|
|
1663
|
-
|
|
1664
|
-
return
|
|
1669
|
+
for (var a = e.rowCount, l = e.height, c = fe("row", e, n, r), d = o + l, p = c.offset + c.size, m = n; m < a - 1 && p < d; )
|
|
1670
|
+
m++, p += fe("row", e, m, r).size;
|
|
1671
|
+
return m;
|
|
1665
1672
|
},
|
|
1666
1673
|
initInstanceProps: function(e, n) {
|
|
1667
1674
|
var o = e, r = o.estimatedColumnWidth, a = o.estimatedRowHeight, l = {
|
|
@@ -1683,7 +1690,7 @@ var Vo = function(e, n) {
|
|
|
1683
1690
|
shouldForceUpdate: d
|
|
1684
1691
|
});
|
|
1685
1692
|
}, n.resetAfterIndices = function(c) {
|
|
1686
|
-
var d = c.columnIndex, p = c.rowIndex,
|
|
1693
|
+
var d = c.columnIndex, p = c.rowIndex, m = c.shouldForceUpdate, _ = m === void 0 ? !0 : m;
|
|
1687
1694
|
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), _ && n.forceUpdate();
|
|
1688
1695
|
}, l;
|
|
1689
1696
|
},
|
|
@@ -1714,7 +1721,7 @@ function Ko(t, e) {
|
|
|
1714
1721
|
return !Jt(n, r) && !Jt(o, a);
|
|
1715
1722
|
}
|
|
1716
1723
|
const Xo = () => {
|
|
1717
|
-
const { viewMode: t } = Ee(), { scrollMode: e } =
|
|
1724
|
+
const { viewMode: t } = Ee(), { scrollMode: e } = Le(), { setColumnCount: n } = un(), { virtualScrollableElementRef: o } = et(), r = Ue(), a = k(() => r.heights.length, [r.heights]), l = k(() => e === J.HORIZONTAL_SCROLLING ? a : t === xe.DUAL_PAGE ? 2 : 1, [t, e, e, a, o]), c = k(() => r.widths.reduce((w, T, P) => {
|
|
1718
1725
|
const S = P % l;
|
|
1719
1726
|
return (!w[S] || T > w[S]) && (w[S] = T), w;
|
|
1720
1727
|
}, []), [r.widths, l]), d = N(
|
|
@@ -1730,9 +1737,9 @@ const Xo = () => {
|
|
|
1730
1737
|
W(() => {
|
|
1731
1738
|
n(l);
|
|
1732
1739
|
}, [l, n]);
|
|
1733
|
-
const
|
|
1740
|
+
const m = k(() => e === J.HORIZONTAL_SCROLLING || e === J.PAGE_SCROLLING ? 1 : Math.round(a / l), [l, a, e]), _ = k(() => r.heights.reduce((v, w) => v + w, 0) / r.heights.length || 0, [r]), h = k(() => r.widths.reduce((v, w) => v + w, 0) / r.heights.length || 0, [r]);
|
|
1734
1741
|
return {
|
|
1735
|
-
rowCount:
|
|
1742
|
+
rowCount: m,
|
|
1736
1743
|
rowHeight: p,
|
|
1737
1744
|
columnCount: l,
|
|
1738
1745
|
columnWidth: d,
|
|
@@ -1762,8 +1769,8 @@ function Yo(t) {
|
|
|
1762
1769
|
const d = typeof document < "u" && document.attachEvent;
|
|
1763
1770
|
if (!d) {
|
|
1764
1771
|
l = function(S) {
|
|
1765
|
-
const u = S.__resizeTriggers__,
|
|
1766
|
-
g.scrollLeft = g.scrollWidth, g.scrollTop = g.scrollHeight, s.style.width =
|
|
1772
|
+
const u = S.__resizeTriggers__, f = u.firstElementChild, g = u.lastElementChild, s = f.firstElementChild;
|
|
1773
|
+
g.scrollLeft = g.scrollWidth, g.scrollTop = g.scrollHeight, s.style.width = f.offsetWidth + 1 + "px", s.style.height = f.offsetHeight + 1 + "px", f.scrollLeft = f.scrollWidth, f.scrollTop = f.scrollHeight;
|
|
1767
1774
|
}, a = function(S) {
|
|
1768
1775
|
return S.offsetWidth !== S.__resizeLast__.width || S.offsetHeight !== S.__resizeLast__.height;
|
|
1769
1776
|
}, c = function(S) {
|
|
@@ -1809,8 +1816,8 @@ function Yo(t) {
|
|
|
1809
1816
|
const P = w.createElement("div");
|
|
1810
1817
|
P.className = "expand-trigger", P.appendChild(w.createElement("div"));
|
|
1811
1818
|
const S = w.createElement("div");
|
|
1812
|
-
S.className = "contract-trigger", h.__resizeTriggers__.appendChild(P), h.__resizeTriggers__.appendChild(S), h.appendChild(h.__resizeTriggers__), l(h), h.addEventListener("scroll", c, !0), o && (h.__resizeTriggers__.__animationListener__ = function(
|
|
1813
|
-
|
|
1819
|
+
S.className = "contract-trigger", h.__resizeTriggers__.appendChild(P), h.__resizeTriggers__.appendChild(S), h.appendChild(h.__resizeTriggers__), l(h), h.addEventListener("scroll", c, !0), o && (h.__resizeTriggers__.__animationListener__ = function(f) {
|
|
1820
|
+
f.animationName === n && l(h);
|
|
1814
1821
|
}, h.__resizeTriggers__.addEventListener(o, h.__resizeTriggers__.__animationListener__));
|
|
1815
1822
|
}
|
|
1816
1823
|
h.__resizeListeners__.push(v);
|
|
@@ -1844,7 +1851,7 @@ class Jo extends er {
|
|
|
1844
1851
|
onResize: r
|
|
1845
1852
|
} = this.props;
|
|
1846
1853
|
if (this._parentNode) {
|
|
1847
|
-
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"),
|
|
1854
|
+
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(), _ = m.height - d - p, h = m.width - l - c, v = this._parentNode.offsetHeight - d - p, w = this._parentNode.offsetWidth - l - c;
|
|
1848
1855
|
(!n && (this.state.height !== v || this.state.scaledHeight !== _) || !o && (this.state.width !== w || this.state.scaledWidth !== h)) && (this.setState({
|
|
1849
1856
|
height: v,
|
|
1850
1857
|
width: w,
|
|
@@ -1887,7 +1894,7 @@ class Jo extends er {
|
|
|
1887
1894
|
nonce: c,
|
|
1888
1895
|
onResize: d,
|
|
1889
1896
|
style: p = {},
|
|
1890
|
-
tagName:
|
|
1897
|
+
tagName: m = "div",
|
|
1891
1898
|
..._
|
|
1892
1899
|
} = this.props, {
|
|
1893
1900
|
height: h,
|
|
@@ -1898,7 +1905,7 @@ class Jo extends er {
|
|
|
1898
1905
|
overflow: "visible"
|
|
1899
1906
|
}, S = {};
|
|
1900
1907
|
let u = !1;
|
|
1901
|
-
return r || (h === 0 && (u = !0), P.height = 0, S.height = h, S.scaledHeight = v), a || (T === 0 && (u = !0), P.width = 0, S.width = T, S.scaledWidth = w), l && (u = !1), qe(
|
|
1908
|
+
return r || (h === 0 && (u = !0), P.height = 0, S.height = h, S.scaledHeight = v), a || (T === 0 && (u = !0), P.width = 0, S.width = T, S.scaledWidth = w), l && (u = !1), qe(m, {
|
|
1902
1909
|
ref: this._setRef,
|
|
1903
1910
|
style: {
|
|
1904
1911
|
...P,
|
|
@@ -1917,7 +1924,7 @@ const Qo = ln(({ widths: t, heights: e }) => {
|
|
|
1917
1924
|
}
|
|
1918
1925
|
return c;
|
|
1919
1926
|
}, [n, o]), a = k(() => {
|
|
1920
|
-
const c = n % 2 === 1 ? n - 1 : n - 2, d = t(c), p = e(c),
|
|
1927
|
+
const c = n % 2 === 1 ? n - 1 : n - 2, d = t(c), p = e(c), m = t(c + 1), _ = e(c + 1), h = p > _ ? p : _, v = p < _ ? p : _, w = h / 2 - v / 2;
|
|
1921
1928
|
return [
|
|
1922
1929
|
{
|
|
1923
1930
|
position: "absolute",
|
|
@@ -1930,7 +1937,7 @@ const Qo = ln(({ widths: t, heights: e }) => {
|
|
|
1930
1937
|
position: "absolute",
|
|
1931
1938
|
left: d,
|
|
1932
1939
|
top: h === _ ? 0 : w,
|
|
1933
|
-
width:
|
|
1940
|
+
width: m,
|
|
1934
1941
|
height: _
|
|
1935
1942
|
}
|
|
1936
1943
|
];
|
|
@@ -1953,25 +1960,25 @@ const Qo = ln(({ widths: t, heights: e }) => {
|
|
|
1953
1960
|
}
|
|
1954
1961
|
);
|
|
1955
1962
|
}, ti = (t, e, n) => {
|
|
1956
|
-
const o = H(), { contentRef: r } = ge(), { heights: a, widths: l } = Ue(), { setFocusedPage: c } = ie(), [d, p] = $([]), { targetScrollPage:
|
|
1957
|
-
const P = l[T], S = Vr(T + 1, t), u = P * S.columnIndex,
|
|
1963
|
+
const o = H(), { contentRef: r } = ge(), { heights: a, widths: l } = Ue(), { setFocusedPage: c } = ie(), [d, p] = $([]), { targetScrollPage: m } = pn(), _ = Pt(d, 0, 500), h = k(() => a.map((w, T) => {
|
|
1964
|
+
const P = l[T], S = Vr(T + 1, t), u = P * S.columnIndex, f = w * S.rowIndex, g = u + P, s = f + w;
|
|
1958
1965
|
return {
|
|
1959
1966
|
pageNumber: T + 1,
|
|
1960
1967
|
...S,
|
|
1961
1968
|
width: P,
|
|
1962
1969
|
height: w,
|
|
1963
1970
|
startX: u,
|
|
1964
|
-
startY:
|
|
1971
|
+
startY: f,
|
|
1965
1972
|
endX: g,
|
|
1966
1973
|
endY: s
|
|
1967
1974
|
};
|
|
1968
1975
|
}), [a, l, t, e]);
|
|
1969
1976
|
W(() => {
|
|
1970
1977
|
var T;
|
|
1971
|
-
_.length > 0 && !
|
|
1978
|
+
_.length > 0 && !m.current && c(_[0].pageNumber);
|
|
1972
1979
|
let w = (T = _[0]) == null ? void 0 : T.ratio;
|
|
1973
|
-
w && _.filter((P) => Math.round(P.ratio) === Math.round(w)).some((P) => P.pageNumber ===
|
|
1974
|
-
|
|
1980
|
+
w && _.filter((P) => Math.round(P.ratio) === Math.round(w)).some((P) => P.pageNumber === m.current) && setTimeout(() => {
|
|
1981
|
+
m.current = void 0;
|
|
1975
1982
|
}, 500);
|
|
1976
1983
|
}, [_, c]);
|
|
1977
1984
|
const v = N(
|
|
@@ -1983,15 +1990,15 @@ const Qo = ln(({ widths: t, heights: e }) => {
|
|
|
1983
1990
|
endTop: T.scrollTop + T.clientHeight,
|
|
1984
1991
|
endLeft: T.scrollLeft + T.clientWidth
|
|
1985
1992
|
}, S = h.filter((u) => {
|
|
1986
|
-
const
|
|
1987
|
-
return
|
|
1993
|
+
const f = u.endX >= P.startLeft && u.endY >= P.startTop, g = u.startX <= P.endLeft && u.startY <= P.endTop;
|
|
1994
|
+
return f && g;
|
|
1988
1995
|
}).map((u) => {
|
|
1989
|
-
const
|
|
1996
|
+
const f = P.startLeft > u.startX ? P.startLeft : u.startX, g = P.startTop > u.startY ? P.startTop : u.startY, s = P.endLeft < u.endX ? P.endLeft : u.endX, C = P.endTop < u.endY ? P.endTop : u.endY, b = s - f, y = C - g, I = +(b * y / (u.width * u.height) * 100).toFixed(2);
|
|
1990
1997
|
return {
|
|
1991
1998
|
pageNumber: u.pageNumber,
|
|
1992
1999
|
ratio: I
|
|
1993
2000
|
};
|
|
1994
|
-
}).sort((u,
|
|
2001
|
+
}).sort((u, f) => f.ratio - u.ratio);
|
|
1995
2002
|
p(S);
|
|
1996
2003
|
});
|
|
1997
2004
|
},
|
|
@@ -2012,25 +2019,25 @@ const Qo = ln(({ widths: t, heights: e }) => {
|
|
|
2012
2019
|
getVirtualScrollRef: c,
|
|
2013
2020
|
getPageScrollElementRef: d,
|
|
2014
2021
|
getVirtualScrollableElementRef: p,
|
|
2015
|
-
setTotalInnerDimensions:
|
|
2022
|
+
setTotalInnerDimensions: m,
|
|
2016
2023
|
virtualScrollableElementRef: _,
|
|
2017
2024
|
totalInnerDimensions: h,
|
|
2018
2025
|
pageScrollElementRef: v
|
|
2019
|
-
} = et(), w = H(!0), { nextPage: T, prevPage: P, setFocusedPage: S, focusedPage: u } = ie(), { scrollMode:
|
|
2026
|
+
} = et(), w = H(!0), { nextPage: T, prevPage: P, setFocusedPage: S, focusedPage: u } = ie(), { scrollMode: f } = Le(), { viewMode: g } = Ee(), s = H(null), { loading: C } = Q(), { passwordRequired: b } = nr(), { LoaderImageComponent: y } = hn(), E = H(
|
|
2020
2027
|
h
|
|
2021
2028
|
), I = H({
|
|
2022
2029
|
viewMode: g,
|
|
2023
|
-
scrollMode:
|
|
2024
|
-
}),
|
|
2030
|
+
scrollMode: f
|
|
2031
|
+
}), R = H(!1), D = H(), { isFullScreen: z } = sr(), {
|
|
2025
2032
|
pageDimension: A,
|
|
2026
|
-
rowCount:
|
|
2033
|
+
rowCount: L,
|
|
2027
2034
|
rowHeight: x,
|
|
2028
2035
|
columnCount: O,
|
|
2029
2036
|
columnWidth: M,
|
|
2030
2037
|
estimatedColumnWidth: G,
|
|
2031
2038
|
estimatedRowHeight: Z
|
|
2032
2039
|
} = Xo(), j = Pt(h, 100), q = H();
|
|
2033
|
-
ti(O,
|
|
2040
|
+
ti(O, L, _);
|
|
2034
2041
|
const ee = H({
|
|
2035
2042
|
scrollTop: 0,
|
|
2036
2043
|
scrollLeft: 0
|
|
@@ -2045,20 +2052,20 @@ const Qo = ln(({ widths: t, heights: e }) => {
|
|
|
2045
2052
|
const V = document.activeElement !== o;
|
|
2046
2053
|
!z && V || (["ArrowUp", "ArrowLeft"].includes(U.key) ? (U.preventDefault(), P()) : ["ArrowDown", "ArrowRight"].includes(U.key) && (U.preventDefault(), T()));
|
|
2047
2054
|
},
|
|
2048
|
-
[T, P, z,
|
|
2055
|
+
[T, P, z, f]
|
|
2049
2056
|
);
|
|
2050
2057
|
W(() => (window.addEventListener("keydown", Ne), () => {
|
|
2051
2058
|
window.removeEventListener("keydown", Ne);
|
|
2052
2059
|
}), [Ne]), W(() => {
|
|
2053
2060
|
if (s.current && (s.current.style.position = "relative"), !!l)
|
|
2054
|
-
for (let U = 0; U <
|
|
2061
|
+
for (let U = 0; U < L; U++)
|
|
2055
2062
|
for (let V = 0; V < O; V++)
|
|
2056
2063
|
l.resetAfterIndices({
|
|
2057
2064
|
columnIndex: V,
|
|
2058
2065
|
rowIndex: U,
|
|
2059
2066
|
shouldForceUpdate: !0
|
|
2060
2067
|
});
|
|
2061
|
-
}, [
|
|
2068
|
+
}, [L, O, A, l]);
|
|
2062
2069
|
const Pe = N(
|
|
2063
2070
|
(U, V) => {
|
|
2064
2071
|
if (!_)
|
|
@@ -2072,10 +2079,10 @@ const Qo = ln(({ widths: t, heights: e }) => {
|
|
|
2072
2079
|
[_]
|
|
2073
2080
|
), we = N(
|
|
2074
2081
|
(U, V) => {
|
|
2075
|
-
if (I.current.viewMode !== g || I.current.scrollMode !==
|
|
2076
|
-
q.current && clearTimeout(q.current),
|
|
2082
|
+
if (I.current.viewMode !== g || I.current.scrollMode !== f) {
|
|
2083
|
+
q.current && clearTimeout(q.current), R.current = !0, a(u, "auto"), q.current = setTimeout(() => {
|
|
2077
2084
|
requestAnimationFrame(() => {
|
|
2078
|
-
I.current = { viewMode: g, scrollMode:
|
|
2085
|
+
I.current = { viewMode: g, scrollMode: f };
|
|
2079
2086
|
});
|
|
2080
2087
|
}, 100);
|
|
2081
2088
|
return;
|
|
@@ -2083,7 +2090,7 @@ const Qo = ln(({ widths: t, heights: e }) => {
|
|
|
2083
2090
|
const Se = U.scrollTop, ot = U.scrollLeft;
|
|
2084
2091
|
if (!V.height || !V.width)
|
|
2085
2092
|
return;
|
|
2086
|
-
|
|
2093
|
+
R.current = !0;
|
|
2087
2094
|
const { height: ye, width: it } = V, { height: Ot, width: Dt } = E.current;
|
|
2088
2095
|
if (Ot === ye && Dt === it)
|
|
2089
2096
|
return;
|
|
@@ -2100,22 +2107,22 @@ const Qo = ln(({ widths: t, heights: e }) => {
|
|
|
2100
2107
|
width: V.width
|
|
2101
2108
|
};
|
|
2102
2109
|
},
|
|
2103
|
-
[l, g,
|
|
2110
|
+
[l, g, f, a]
|
|
2104
2111
|
);
|
|
2105
2112
|
W(() => {
|
|
2106
2113
|
clearTimeout(D.current);
|
|
2107
|
-
const U = Array.from({ length:
|
|
2114
|
+
const U = Array.from({ length: L }).reduce(
|
|
2108
2115
|
(Se, ot, ye) => Se + x(ye),
|
|
2109
2116
|
0
|
|
2110
2117
|
), V = Array.from({ length: O }).reduce(
|
|
2111
2118
|
(Se, ot, ye) => Se + M(ye),
|
|
2112
2119
|
0
|
|
2113
2120
|
), Te = Pe(V, U);
|
|
2114
|
-
ee.current = Te, we(Te, { height: U, width: V }),
|
|
2121
|
+
ee.current = Te, we(Te, { height: U, width: V }), m({
|
|
2115
2122
|
height: U,
|
|
2116
2123
|
width: V
|
|
2117
2124
|
});
|
|
2118
|
-
}, [A,
|
|
2125
|
+
}, [A, L, O, we]);
|
|
2119
2126
|
const nt = N(
|
|
2120
2127
|
(U) => {
|
|
2121
2128
|
ee.current = {
|
|
@@ -2156,8 +2163,8 @@ const Qo = ln(({ widths: t, heights: e }) => {
|
|
|
2156
2163
|
v,
|
|
2157
2164
|
S,
|
|
2158
2165
|
j
|
|
2159
|
-
]), /* @__PURE__ */ F(
|
|
2160
|
-
/* @__PURE__ */ i("div", { id: n, ref: r, tabIndex: -1, className: rt, children: /* @__PURE__ */ i(Jo, { style: { minHeight: "50px" }, children: ({ width: U, height: V }) => /* @__PURE__ */ i("div", { "data-rp": "pages", ref: jn, style: { width: U, height: V }, children:
|
|
2166
|
+
]), /* @__PURE__ */ F(me, { children: [
|
|
2167
|
+
/* @__PURE__ */ i("div", { id: n, ref: r, tabIndex: -1, className: rt, children: /* @__PURE__ */ i(Jo, { style: { minHeight: "50px" }, children: ({ width: U, height: V }) => /* @__PURE__ */ i("div", { "data-rp": "pages", ref: jn, style: { width: U, height: V }, children: f === J.PAGE_SCROLLING ? /* @__PURE__ */ i(
|
|
2161
2168
|
"div",
|
|
2162
2169
|
{
|
|
2163
2170
|
ref: d,
|
|
@@ -2180,10 +2187,10 @@ const Qo = ln(({ widths: t, heights: e }) => {
|
|
|
2180
2187
|
width: U,
|
|
2181
2188
|
estimatedColumnWidth: G,
|
|
2182
2189
|
estimatedRowHeight: Z,
|
|
2183
|
-
rowCount:
|
|
2190
|
+
rowCount: L,
|
|
2184
2191
|
className: ne(
|
|
2185
2192
|
ue["rp-pages"],
|
|
2186
|
-
|
|
2193
|
+
f === J.HORIZONTAL_SCROLLING ? ue["rp-pages-horizontal-scroll"] : ""
|
|
2187
2194
|
),
|
|
2188
2195
|
children: ni
|
|
2189
2196
|
}
|
|
@@ -2209,7 +2216,7 @@ const Qo = ln(({ widths: t, heights: e }) => {
|
|
|
2209
2216
|
"rp-toolbar-start": "_rp-toolbar-start_sz31z_33",
|
|
2210
2217
|
"rp-toolbar-middle": "_rp-toolbar-middle_sz31z_39",
|
|
2211
2218
|
"rp-toolbar-end": "_rp-toolbar-end_sz31z_46"
|
|
2212
|
-
},
|
|
2219
|
+
}, ft = {
|
|
2213
2220
|
"rp-paginate": "_rp-paginate_1y9vo_1",
|
|
2214
2221
|
"rp-page-input": "_rp-page-input_1y9vo_6",
|
|
2215
2222
|
"rp-total-page": "_rp-total-page_1y9vo_11"
|
|
@@ -2220,13 +2227,13 @@ const Qo = ln(({ widths: t, heights: e }) => {
|
|
|
2220
2227
|
const { nextIcon: t } = pe();
|
|
2221
2228
|
return t || /* @__PURE__ */ i(He, { style: { transform: "rotate(180deg" } });
|
|
2222
2229
|
}, ii = () => {
|
|
2223
|
-
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: a } = ie(), [l, c] = $(t.toString()), { pageNavigationTool: d = !0 } = ve(), { isSmallScreen: p } = Ce(), { localeMessages:
|
|
2230
|
+
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: a } = ie(), [l, c] = $(t.toString()), { pageNavigationTool: d = !0 } = ve(), { isSmallScreen: p } = Ce(), { localeMessages: m } = se(), { viewMode: _ } = Ee(), { scrollMode: h } = Le();
|
|
2224
2231
|
W(() => {
|
|
2225
2232
|
c(t.toString());
|
|
2226
2233
|
}, [t]);
|
|
2227
2234
|
const v = N((u) => {
|
|
2228
|
-
const
|
|
2229
|
-
c(
|
|
2235
|
+
const f = u.target.value;
|
|
2236
|
+
c(f);
|
|
2230
2237
|
}, []), w = N(async () => {
|
|
2231
2238
|
const u = a(l);
|
|
2232
2239
|
u.success || c(u.currentPage.toString());
|
|
@@ -2248,42 +2255,42 @@ const Qo = ln(({ widths: t, heights: e }) => {
|
|
|
2248
2255
|
goToPage: a,
|
|
2249
2256
|
changePage: n
|
|
2250
2257
|
}
|
|
2251
|
-
) : d ? /* @__PURE__ */ F("div", { className:
|
|
2252
|
-
!p && /* @__PURE__ */ i(K, { content:
|
|
2258
|
+
) : d ? /* @__PURE__ */ F("div", { className: ft["rp-paginate"], children: [
|
|
2259
|
+
!p && /* @__PURE__ */ i(K, { content: m == null ? void 0 : m.previousPageTooltip, children: /* @__PURE__ */ i(
|
|
2253
2260
|
re,
|
|
2254
2261
|
{
|
|
2255
2262
|
onClick: r,
|
|
2256
|
-
"aria-label":
|
|
2263
|
+
"aria-label": m == null ? void 0 : m.previousPageTooltip,
|
|
2257
2264
|
"aria-disabled": t === 1,
|
|
2258
2265
|
children: /* @__PURE__ */ i(ri, {})
|
|
2259
2266
|
}
|
|
2260
2267
|
) }),
|
|
2261
|
-
/* @__PURE__ */ i(K, { content:
|
|
2268
|
+
/* @__PURE__ */ i(K, { content: m == null ? void 0 : m.currentPageTooltip, children: /* @__PURE__ */ i(
|
|
2262
2269
|
dn,
|
|
2263
2270
|
{
|
|
2264
2271
|
onKeyDown: P,
|
|
2265
2272
|
onBlur: T,
|
|
2266
2273
|
onChange: v,
|
|
2267
2274
|
value: l,
|
|
2268
|
-
className:
|
|
2275
|
+
className: ft["rp-page-input"]
|
|
2269
2276
|
}
|
|
2270
2277
|
) }),
|
|
2271
|
-
/* @__PURE__ */ F("span", { className:
|
|
2278
|
+
/* @__PURE__ */ F("span", { className: ft["rp-total-page"], children: [
|
|
2272
2279
|
"/",
|
|
2273
2280
|
e
|
|
2274
2281
|
] }),
|
|
2275
|
-
!p && /* @__PURE__ */ i(K, { content:
|
|
2282
|
+
!p && /* @__PURE__ */ i(K, { content: m == null ? void 0 : m.nextPageTooltip, children: /* @__PURE__ */ i(
|
|
2276
2283
|
re,
|
|
2277
2284
|
{
|
|
2278
2285
|
onClick: o,
|
|
2279
|
-
"aria-label":
|
|
2286
|
+
"aria-label": m == null ? void 0 : m.nextPageTooltip,
|
|
2280
2287
|
"aria-disabled": S,
|
|
2281
2288
|
children: /* @__PURE__ */ i(oi, {})
|
|
2282
2289
|
}
|
|
2283
2290
|
) })
|
|
2284
2291
|
] }) : null;
|
|
2285
2292
|
};
|
|
2286
|
-
var
|
|
2293
|
+
var Rt = "Dialog", [xn, Us] = Xr(Rt), [ai, ce] = xn(Rt), Rn = (t) => {
|
|
2287
2294
|
const {
|
|
2288
2295
|
__scopeDialog: e,
|
|
2289
2296
|
children: n,
|
|
@@ -2291,7 +2298,7 @@ var Lt = "Dialog", [xn, Us] = Xr(Lt), [ai, ce] = xn(Lt), Ln = (t) => {
|
|
|
2291
2298
|
defaultOpen: r,
|
|
2292
2299
|
onOpenChange: a,
|
|
2293
2300
|
modal: l = !0
|
|
2294
|
-
} = t, c = B.useRef(null), d = B.useRef(null), [p = !1,
|
|
2301
|
+
} = t, c = B.useRef(null), d = B.useRef(null), [p = !1, m] = Qr({
|
|
2295
2302
|
prop: o,
|
|
2296
2303
|
defaultProp: r,
|
|
2297
2304
|
onChange: a
|
|
@@ -2306,17 +2313,17 @@ var Lt = "Dialog", [xn, Us] = Xr(Lt), [ai, ce] = xn(Lt), Ln = (t) => {
|
|
|
2306
2313
|
titleId: ct(),
|
|
2307
2314
|
descriptionId: ct(),
|
|
2308
2315
|
open: p,
|
|
2309
|
-
onOpenChange:
|
|
2310
|
-
onOpenToggle: B.useCallback(() =>
|
|
2316
|
+
onOpenChange: m,
|
|
2317
|
+
onOpenToggle: B.useCallback(() => m((_) => !_), [m]),
|
|
2311
2318
|
modal: l,
|
|
2312
2319
|
children: n
|
|
2313
2320
|
}
|
|
2314
2321
|
);
|
|
2315
2322
|
};
|
|
2316
|
-
|
|
2317
|
-
var
|
|
2323
|
+
Rn.displayName = Rt;
|
|
2324
|
+
var Ln = "DialogTrigger", si = B.forwardRef(
|
|
2318
2325
|
(t, e) => {
|
|
2319
|
-
const { __scopeDialog: n, ...o } = t, r = ce(
|
|
2326
|
+
const { __scopeDialog: n, ...o } = t, r = ce(Ln, n), a = Tt(e, r.triggerRef);
|
|
2320
2327
|
return /* @__PURE__ */ i(
|
|
2321
2328
|
Ve.button,
|
|
2322
2329
|
{
|
|
@@ -2332,14 +2339,14 @@ var Rn = "DialogTrigger", si = B.forwardRef(
|
|
|
2332
2339
|
);
|
|
2333
2340
|
}
|
|
2334
2341
|
);
|
|
2335
|
-
si.displayName =
|
|
2336
|
-
var
|
|
2342
|
+
si.displayName = Ln;
|
|
2343
|
+
var Lt = "DialogPortal", [ci, En] = xn(Lt, {
|
|
2337
2344
|
forceMount: void 0
|
|
2338
2345
|
}), Nn = (t) => {
|
|
2339
|
-
const { __scopeDialog: e, forceMount: n, children: o, container: r } = t, a = ce(
|
|
2346
|
+
const { __scopeDialog: e, forceMount: n, children: o, container: r } = t, a = ce(Lt, e);
|
|
2340
2347
|
return /* @__PURE__ */ i(ci, { scope: e, forceMount: n, children: B.Children.map(o, (l) => /* @__PURE__ */ i(St, { present: n || a.open, children: /* @__PURE__ */ i(oo, { asChild: !0, container: r, children: l }) })) });
|
|
2341
2348
|
};
|
|
2342
|
-
Nn.displayName =
|
|
2349
|
+
Nn.displayName = Lt;
|
|
2343
2350
|
var Xe = "DialogOverlay", On = B.forwardRef(
|
|
2344
2351
|
(t, e) => {
|
|
2345
2352
|
const n = En(Xe, t.__scopeDialog), { forceMount: o = n.forceMount, ...r } = t, a = ce(Xe, t.__scopeDialog);
|
|
@@ -2364,16 +2371,16 @@ var li = B.forwardRef(
|
|
|
2364
2371
|
) })
|
|
2365
2372
|
);
|
|
2366
2373
|
}
|
|
2367
|
-
),
|
|
2374
|
+
), Re = "DialogContent", Dn = B.forwardRef(
|
|
2368
2375
|
(t, e) => {
|
|
2369
|
-
const n = En(
|
|
2376
|
+
const n = En(Re, t.__scopeDialog), { forceMount: o = n.forceMount, ...r } = t, a = ce(Re, t.__scopeDialog);
|
|
2370
2377
|
return /* @__PURE__ */ i(St, { present: o || a.open, children: a.modal ? /* @__PURE__ */ i(di, { ...r, ref: e }) : /* @__PURE__ */ i(ui, { ...r, ref: e }) });
|
|
2371
2378
|
}
|
|
2372
2379
|
);
|
|
2373
|
-
Dn.displayName =
|
|
2380
|
+
Dn.displayName = Re;
|
|
2374
2381
|
var di = B.forwardRef(
|
|
2375
2382
|
(t, e) => {
|
|
2376
|
-
const n = ce(
|
|
2383
|
+
const n = ce(Re, t.__scopeDialog), o = B.useRef(null), r = Tt(e, n.contentRef, o);
|
|
2377
2384
|
return B.useEffect(() => {
|
|
2378
2385
|
const a = o.current;
|
|
2379
2386
|
if (a)
|
|
@@ -2402,7 +2409,7 @@ var di = B.forwardRef(
|
|
|
2402
2409
|
}
|
|
2403
2410
|
), ui = B.forwardRef(
|
|
2404
2411
|
(t, e) => {
|
|
2405
|
-
const n = ce(
|
|
2412
|
+
const n = ce(Re, t.__scopeDialog), o = B.useRef(!1), r = B.useRef(!1);
|
|
2406
2413
|
return /* @__PURE__ */ i(
|
|
2407
2414
|
zn,
|
|
2408
2415
|
{
|
|
@@ -2425,8 +2432,8 @@ var di = B.forwardRef(
|
|
|
2425
2432
|
}
|
|
2426
2433
|
), zn = B.forwardRef(
|
|
2427
2434
|
(t, e) => {
|
|
2428
|
-
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: a, ...l } = t, c = ce(
|
|
2429
|
-
return no(), /* @__PURE__ */ F(
|
|
2435
|
+
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: a, ...l } = t, c = ce(Re, n), d = B.useRef(null), p = Tt(e, d);
|
|
2436
|
+
return no(), /* @__PURE__ */ F(me, { children: [
|
|
2430
2437
|
/* @__PURE__ */ i(
|
|
2431
2438
|
ro,
|
|
2432
2439
|
{
|
|
@@ -2450,9 +2457,9 @@ var di = B.forwardRef(
|
|
|
2450
2457
|
)
|
|
2451
2458
|
}
|
|
2452
2459
|
),
|
|
2453
|
-
/* @__PURE__ */ F(
|
|
2460
|
+
/* @__PURE__ */ F(me, { children: [
|
|
2454
2461
|
/* @__PURE__ */ i(hi, { titleId: c.titleId }),
|
|
2455
|
-
/* @__PURE__ */ i(
|
|
2462
|
+
/* @__PURE__ */ i(mi, { contentRef: d, descriptionId: c.descriptionId })
|
|
2456
2463
|
] })
|
|
2457
2464
|
] });
|
|
2458
2465
|
}
|
|
@@ -2489,7 +2496,7 @@ function Nt(t) {
|
|
|
2489
2496
|
return t ? "open" : "closed";
|
|
2490
2497
|
}
|
|
2491
2498
|
var Mn = "DialogTitleWarning", [Vs, Hn] = Jr(Mn, {
|
|
2492
|
-
contentName:
|
|
2499
|
+
contentName: Re,
|
|
2493
2500
|
titleName: Et,
|
|
2494
2501
|
docsSlug: "dialog"
|
|
2495
2502
|
}), hi = ({ titleId: t }) => {
|
|
@@ -2501,14 +2508,14 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
|
|
|
2501
2508
|
return B.useEffect(() => {
|
|
2502
2509
|
t && (document.getElementById(t) || console.error(n));
|
|
2503
2510
|
}, [n, t]), null;
|
|
2504
|
-
},
|
|
2505
|
-
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Hn(
|
|
2511
|
+
}, fi = "DialogDescriptionWarning", mi = ({ contentRef: t, descriptionId: e }) => {
|
|
2512
|
+
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Hn(fi).contentName}}.`;
|
|
2506
2513
|
return B.useEffect(() => {
|
|
2507
2514
|
var a;
|
|
2508
2515
|
const r = (a = t.current) == null ? void 0 : a.getAttribute("aria-describedby");
|
|
2509
2516
|
e && r && (document.getElementById(e) || console.warn(o));
|
|
2510
2517
|
}, [o, t, e]), null;
|
|
2511
|
-
}, gi =
|
|
2518
|
+
}, gi = Rn, vi = Nn, wi = On, _i = Dn, bi = An, Ci = kn;
|
|
2512
2519
|
const Ie = {
|
|
2513
2520
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2514
2521
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
@@ -2526,7 +2533,7 @@ const Ie = {
|
|
|
2526
2533
|
filename: c,
|
|
2527
2534
|
title: d,
|
|
2528
2535
|
author: p,
|
|
2529
|
-
subject:
|
|
2536
|
+
subject: m,
|
|
2530
2537
|
createdOn: _,
|
|
2531
2538
|
creator: h,
|
|
2532
2539
|
keywords: v,
|
|
@@ -2541,7 +2548,7 @@ const Ie = {
|
|
|
2541
2548
|
{ separate: !0 },
|
|
2542
2549
|
{ label: r == null ? void 0 : r.propertiesTitleLabel, value: d },
|
|
2543
2550
|
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value: p },
|
|
2544
|
-
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value:
|
|
2551
|
+
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value: m },
|
|
2545
2552
|
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value: v },
|
|
2546
2553
|
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value: h },
|
|
2547
2554
|
{
|
|
@@ -2584,7 +2591,7 @@ const Ie = {
|
|
|
2584
2591
|
}, [t, e]) };
|
|
2585
2592
|
}, Gn = () => {
|
|
2586
2593
|
const { downloadIcon: t } = pe();
|
|
2587
|
-
return t || /* @__PURE__ */ i(
|
|
2594
|
+
return t || /* @__PURE__ */ i(mo, {});
|
|
2588
2595
|
}, Un = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ i(K, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }), Ii = ({ download: t, localeMessages: e }) => /* @__PURE__ */ i(Un, { localeMessages: e, children: /* @__PURE__ */ i(re, { onClick: t, "aria-label": e == null ? void 0 : e.downloadFileTooltip, children: /* @__PURE__ */ i(Gn, {}) }) }), xi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ i(be, { onClick: t, children: /* @__PURE__ */ F(Un, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2589
2596
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Gn, {}) }),
|
|
2590
2597
|
e == null ? void 0 : e.downloadFileLabel
|
|
@@ -2594,12 +2601,12 @@ const Ie = {
|
|
|
2594
2601
|
}, qn = () => {
|
|
2595
2602
|
const { printIcon: t } = pe();
|
|
2596
2603
|
return t || /* @__PURE__ */ i(go, {});
|
|
2597
|
-
}, Bn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ i(K, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }),
|
|
2604
|
+
}, Bn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ i(K, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }), Ri = ({ print: t, localeMessages: e }) => /* @__PURE__ */ i(Bn, { localeMessages: e, children: /* @__PURE__ */ i(re, { onClick: t, "aria-label": e == null ? void 0 : e.printTooltip, children: /* @__PURE__ */ i(qn, {}) }) }), Li = ({ print: t, localeMessages: e }) => /* @__PURE__ */ i(be, { onClick: t, children: /* @__PURE__ */ F(Bn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2598
2605
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(qn, {}) }),
|
|
2599
2606
|
e == null ? void 0 : e.printLabel
|
|
2600
2607
|
] }) }), Zn = () => {
|
|
2601
2608
|
const { print: t, cancel: e, setOnProgress: n, setOnComplete: o, setOnError: r, progress: a } = tt(), { printTool: l = !0 } = ve(), { isSmallScreen: c } = Ce(), { localeMessages: d } = se();
|
|
2602
|
-
return l ? c ? /* @__PURE__ */ i(
|
|
2609
|
+
return l ? c ? /* @__PURE__ */ i(Li, { print: t, localeMessages: d }) : typeof l == "function" ? /* @__PURE__ */ i(
|
|
2603
2610
|
l,
|
|
2604
2611
|
{
|
|
2605
2612
|
print: t,
|
|
@@ -2609,7 +2616,7 @@ const Ie = {
|
|
|
2609
2616
|
setOnComplete: o,
|
|
2610
2617
|
progress: a
|
|
2611
2618
|
}
|
|
2612
|
-
) : l ? /* @__PURE__ */ i(
|
|
2619
|
+
) : l ? /* @__PURE__ */ i(Ri, { print: t, localeMessages: d }) : null : null;
|
|
2613
2620
|
}, Ei = {
|
|
2614
2621
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2615
2622
|
}, Ni = () => {
|
|
@@ -2645,12 +2652,12 @@ const Ie = {
|
|
|
2645
2652
|
selectionModeTool: c,
|
|
2646
2653
|
jumpNavigationTool: d,
|
|
2647
2654
|
printTool: p,
|
|
2648
|
-
fullscreenTool:
|
|
2655
|
+
fullscreenTool: m
|
|
2649
2656
|
} = ve(), { localeMessages: _ } = se();
|
|
2650
2657
|
return k(() => {
|
|
2651
2658
|
const v = d || l || c || a || r;
|
|
2652
2659
|
let w = !1;
|
|
2653
|
-
return e && (w = !(!n && !o && !p && !
|
|
2660
|
+
return e && (w = !(!n && !o && !p && !m)), v || w;
|
|
2654
2661
|
}, [
|
|
2655
2662
|
n,
|
|
2656
2663
|
o,
|
|
@@ -2662,13 +2669,13 @@ const Ie = {
|
|
|
2662
2669
|
e
|
|
2663
2670
|
]) ? /* @__PURE__ */ F(lo, { children: [
|
|
2664
2671
|
/* @__PURE__ */ i(
|
|
2665
|
-
|
|
2672
|
+
mn,
|
|
2666
2673
|
{
|
|
2667
2674
|
container: t,
|
|
2668
2675
|
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content: _ == null ? void 0 : _.moreOptionTooltip, children: /* @__PURE__ */ i(re, { "aria-label": _ == null ? void 0 : _.moreOptionTooltip, children: /* @__PURE__ */ i(Kr, {}) }) }) }),
|
|
2669
2676
|
children: /* @__PURE__ */ F("div", { className: Ti["rp-other-tool-content"], "data-rp": "moreOptionsDropdown", children: [
|
|
2670
2677
|
e && /* @__PURE__ */ F(Ke, { children: [
|
|
2671
|
-
/* @__PURE__ */ i(
|
|
2678
|
+
/* @__PURE__ */ i(fn, {}),
|
|
2672
2679
|
/* @__PURE__ */ i(Vn, {}),
|
|
2673
2680
|
/* @__PURE__ */ i(Zn, {}),
|
|
2674
2681
|
/* @__PURE__ */ i(gn, {}),
|
|
@@ -2678,7 +2685,7 @@ const Ie = {
|
|
|
2678
2685
|
/* @__PURE__ */ i(po, {}),
|
|
2679
2686
|
/* @__PURE__ */ i(vo, {}),
|
|
2680
2687
|
/* @__PURE__ */ i(ho, {}),
|
|
2681
|
-
/* @__PURE__ */ i(
|
|
2688
|
+
/* @__PURE__ */ i(fo, {}),
|
|
2682
2689
|
/* @__PURE__ */ i(uo, {})
|
|
2683
2690
|
] })
|
|
2684
2691
|
}
|
|
@@ -2687,10 +2694,10 @@ const Ie = {
|
|
|
2687
2694
|
] }) : null;
|
|
2688
2695
|
}, Ai = () => {
|
|
2689
2696
|
const { isSmallScreen: t } = Ce();
|
|
2690
|
-
return /* @__PURE__ */ F(
|
|
2697
|
+
return /* @__PURE__ */ F(me, { children: [
|
|
2691
2698
|
/* @__PURE__ */ i(jr, {}),
|
|
2692
|
-
!t && /* @__PURE__ */ F(
|
|
2693
|
-
/* @__PURE__ */ i(
|
|
2699
|
+
!t && /* @__PURE__ */ F(me, { children: [
|
|
2700
|
+
/* @__PURE__ */ i(fn, {}),
|
|
2694
2701
|
/* @__PURE__ */ i(Vn, {}),
|
|
2695
2702
|
/* @__PURE__ */ i(Zn, {}),
|
|
2696
2703
|
/* @__PURE__ */ i(gn, {})
|
|
@@ -2703,35 +2710,35 @@ const Ie = {
|
|
|
2703
2710
|
"rp-current-zoom-icon": "_rp-current-zoom-icon_cocqs_11",
|
|
2704
2711
|
"rp-current-zoom-text": "_rp-current-zoom-text_cocqs_16",
|
|
2705
2712
|
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_cocqs_20"
|
|
2706
|
-
}, Fi = 25,
|
|
2713
|
+
}, Fi = 25, mt = 1e3, Wi = [50, 75, 100, 125, 150, 200, 300, 400], ki = () => {
|
|
2707
2714
|
const { zoomInIcon: t } = pe();
|
|
2708
2715
|
return t || /* @__PURE__ */ i(wo, {});
|
|
2709
2716
|
}, Mi = () => {
|
|
2710
2717
|
const { zoomOutIcon: t } = pe();
|
|
2711
2718
|
return t || /* @__PURE__ */ i(_o, {});
|
|
2712
2719
|
}, Hi = () => {
|
|
2713
|
-
const { zoomLevel: t, setZoomLevel: e } = Qe(), { container: n, pagesRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: a } = ie(), { rotate: l } = Ge(), { pages: c } = Q(), { isSmallScreen: d } = Ce(), { localeMessages: p } = se(), { viewMode:
|
|
2720
|
+
const { zoomLevel: t, setZoomLevel: e } = Qe(), { container: n, pagesRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: a } = ie(), { rotate: l } = Ge(), { pages: c } = Q(), { isSmallScreen: d } = Ce(), { localeMessages: p } = se(), { viewMode: m } = Ee(), _ = N(() => {
|
|
2714
2721
|
e((u) => {
|
|
2715
|
-
const
|
|
2716
|
-
return Math.min(
|
|
2722
|
+
const f = Math.floor(u / 25) * 25;
|
|
2723
|
+
return Math.min(f + 25, mt);
|
|
2717
2724
|
});
|
|
2718
2725
|
}, [e]), h = N(() => {
|
|
2719
2726
|
e((u) => {
|
|
2720
|
-
const
|
|
2721
|
-
return Math.min(
|
|
2727
|
+
const f = Math.ceil(u / 25) * 25;
|
|
2728
|
+
return Math.min(f - 25, mt);
|
|
2722
2729
|
});
|
|
2723
|
-
}, [e]), v = k(() => t === Fi, [t]), w = k(() => t ===
|
|
2724
|
-
|
|
2725
|
-
return
|
|
2730
|
+
}, [e]), v = k(() => t === Fi, [t]), w = k(() => t === mt, [t]), T = k(() => {
|
|
2731
|
+
const u = c.get(a);
|
|
2732
|
+
return u ? u.page.getViewport({ scale: 1, rotation: l + u.defaultRotation }) : null;
|
|
2726
2733
|
}, [c, a, l]), P = N(
|
|
2727
2734
|
(u) => {
|
|
2728
|
-
const
|
|
2735
|
+
const f = ((T == null ? void 0 : T.width) || 0) + 2 * Mt, g = ((T == null ? void 0 : T.height) || 0) + 2 * Mt, s = (o == null ? void 0 : o.clientWidth) || 0, C = (o == null ? void 0 : o.clientHeight) || 0, b = bo(
|
|
2729
2736
|
u,
|
|
2730
2737
|
s,
|
|
2731
2738
|
C,
|
|
2732
|
-
|
|
2739
|
+
f,
|
|
2733
2740
|
g,
|
|
2734
|
-
|
|
2741
|
+
m
|
|
2735
2742
|
);
|
|
2736
2743
|
e(b);
|
|
2737
2744
|
},
|
|
@@ -2753,7 +2760,7 @@ const Ie = {
|
|
|
2753
2760
|
}
|
|
2754
2761
|
) }),
|
|
2755
2762
|
!d && /* @__PURE__ */ i(
|
|
2756
|
-
|
|
2763
|
+
mn,
|
|
2757
2764
|
{
|
|
2758
2765
|
container: n,
|
|
2759
2766
|
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content: p == null ? void 0 : p.zoomSelectTooltip, children: /* @__PURE__ */ F(
|
|
@@ -2800,7 +2807,7 @@ const Ie = {
|
|
|
2800
2807
|
nextMatch: e,
|
|
2801
2808
|
prevMatch: n
|
|
2802
2809
|
} = It(), { localeMessages: o } = se();
|
|
2803
|
-
return /* @__PURE__ */ F(
|
|
2810
|
+
return /* @__PURE__ */ F(me, { children: [
|
|
2804
2811
|
/* @__PURE__ */ i(K, { content: o == null ? void 0 : o.searchPrevTooltip, className: Y["rp-search-tool-result-navigator"], children: /* @__PURE__ */ i(re, { onClick: n, "aria-label": o == null ? void 0 : o.searchPrevTooltip, children: /* @__PURE__ */ i(
|
|
2805
2812
|
He,
|
|
2806
2813
|
{
|
|
@@ -2826,12 +2833,12 @@ const Ie = {
|
|
|
2826
2833
|
setSearchOptions: c,
|
|
2827
2834
|
loading: d,
|
|
2828
2835
|
setSearch: p,
|
|
2829
|
-
totalMatches:
|
|
2836
|
+
totalMatches: m,
|
|
2830
2837
|
currentMatchPosition: _,
|
|
2831
2838
|
nextMatch: h,
|
|
2832
2839
|
prevMatch: v,
|
|
2833
2840
|
search: w
|
|
2834
|
-
} = It(), { searchTool: T = !0 } = ve(), [P, S] = $(w), { localeMessages: u } = se(), { isSmallScreen:
|
|
2841
|
+
} = It(), { searchTool: T = !0 } = ve(), [P, S] = $(w), { localeMessages: u } = se(), { isSmallScreen: f } = Ce(), g = N(() => {
|
|
2835
2842
|
n(!0);
|
|
2836
2843
|
}, []), s = N(() => {
|
|
2837
2844
|
p(""), S(""), n(!1);
|
|
@@ -2858,12 +2865,12 @@ const Ie = {
|
|
|
2858
2865
|
S(x.target.value);
|
|
2859
2866
|
}, []), I = N(() => {
|
|
2860
2867
|
S(""), p("");
|
|
2861
|
-
}, [p]),
|
|
2868
|
+
}, [p]), R = k(() => `${_} / ${m}`, [_, m]), { wholeWords: D, matchCase: z } = k(() => l, [l]), A = N(
|
|
2862
2869
|
(x) => {
|
|
2863
2870
|
c((O) => ({ ...O, matchCase: x }));
|
|
2864
2871
|
},
|
|
2865
2872
|
[c]
|
|
2866
|
-
),
|
|
2873
|
+
), L = N(
|
|
2867
2874
|
(x) => {
|
|
2868
2875
|
c((O) => ({ ...O, wholeWords: x }));
|
|
2869
2876
|
},
|
|
@@ -2871,7 +2878,7 @@ const Ie = {
|
|
|
2871
2878
|
);
|
|
2872
2879
|
return W(() => {
|
|
2873
2880
|
s();
|
|
2874
|
-
}, [o, s]), T ? /* @__PURE__ */ i(
|
|
2881
|
+
}, [o, s]), T ? /* @__PURE__ */ i(me, { children: /* @__PURE__ */ i(
|
|
2875
2882
|
Mr,
|
|
2876
2883
|
{
|
|
2877
2884
|
open: e,
|
|
@@ -2893,18 +2900,18 @@ const Ie = {
|
|
|
2893
2900
|
children: !!P && /* @__PURE__ */ i("span", { className: Y["rp-search-tool-input-clear"], onClick: I, children: /* @__PURE__ */ i(Po, {}) })
|
|
2894
2901
|
}
|
|
2895
2902
|
) }),
|
|
2896
|
-
d ? /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(Ct, { className: Y["rp-search-loader-icon"] }) }) : /* @__PURE__ */ i("span", { children:
|
|
2897
|
-
|
|
2903
|
+
d ? /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(Ct, { className: Y["rp-search-loader-icon"] }) }) : /* @__PURE__ */ i("span", { children: R }),
|
|
2904
|
+
f && /* @__PURE__ */ i("div", { className: Y["rp-search-tool-controls"], children: /* @__PURE__ */ i(Ht, { onKeyPress: C, handleClose: s }) })
|
|
2898
2905
|
] }),
|
|
2899
2906
|
/* @__PURE__ */ F("div", { className: Y["rp-search-tool-input-checkboxes"], children: [
|
|
2900
|
-
|
|
2907
|
+
f && /* @__PURE__ */ i(on, {}),
|
|
2901
2908
|
/* @__PURE__ */ i($t, { name: "matchCase", value: z, onChange: A, children: u == null ? void 0 : u.searchMatchCaseLabel }),
|
|
2902
|
-
!
|
|
2903
|
-
/* @__PURE__ */ i($t, { name: "wholeWord", value: D, onChange:
|
|
2904
|
-
!
|
|
2909
|
+
!f && /* @__PURE__ */ i(K, { content: u == null ? void 0 : u.searchMatchCaseTooltip, children: /* @__PURE__ */ i("div", { className: Y["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(Gt, {}) }) }),
|
|
2910
|
+
/* @__PURE__ */ i($t, { name: "wholeWord", value: D, onChange: L, children: u == null ? void 0 : u.searchWholeWordsLabel }),
|
|
2911
|
+
!f && /* @__PURE__ */ i(K, { content: u == null ? void 0 : u.searchWholeWordsTooltip, children: /* @__PURE__ */ i("div", { className: Y["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(Gt, {}) }) })
|
|
2905
2912
|
] })
|
|
2906
2913
|
] }),
|
|
2907
|
-
!
|
|
2914
|
+
!f && /* @__PURE__ */ F("div", { className: Y["rp-search-tool-controls"], children: [
|
|
2908
2915
|
/* @__PURE__ */ i(on, {}),
|
|
2909
2916
|
/* @__PURE__ */ i(Ht, { onKeyPress: C, handleClose: s })
|
|
2910
2917
|
] })
|
|
@@ -3003,15 +3010,15 @@ const Ie = {
|
|
|
3003
3010
|
const n = t == null ? void 0 : t.querySelector(`#page-${e}`);
|
|
3004
3011
|
t && (n != null && n.offsetTop) && (t.scrollTop = (n == null ? void 0 : n.offsetTop) - Bi);
|
|
3005
3012
|
}, ji = $e((t, e) => {
|
|
3006
|
-
const { show: n } = t, { focusedPage: o, totalPages: r } = ie(), { thumbnailPages: a, addPage: l, thumbnailLength: c, addToPage: d } = Pn(), p = H(null),
|
|
3013
|
+
const { show: n } = t, { focusedPage: o, totalPages: r } = ie(), { thumbnailPages: a, addPage: l, thumbnailLength: c, addToPage: d } = Pn(), p = H(null), m = H(1);
|
|
3007
3014
|
cn(e, () => p.current);
|
|
3008
3015
|
const _ = k(() => Object.values(a), [a]), h = N(() => {
|
|
3009
3016
|
const v = c + 1;
|
|
3010
3017
|
v <= r && l(v);
|
|
3011
3018
|
}, [l, r, c]);
|
|
3012
3019
|
return W(() => {
|
|
3013
|
-
o > c ? d(o) : n &&
|
|
3014
|
-
}, [o, c, d, n, _]),
|
|
3020
|
+
o > c ? d(o) : n && m.current !== o && (Zi(p.current, o), m.current = o);
|
|
3021
|
+
}, [o, c, d, n, _]), mr(p.current, h), /* @__PURE__ */ i("div", { ref: p, className: sn["rp-thumbnails-container"], children: /* @__PURE__ */ i("div", { className: sn["rp-thumbnails"], children: n ? _.map((v, w) => {
|
|
3015
3022
|
var T, P;
|
|
3016
3023
|
return /* @__PURE__ */ i(
|
|
3017
3024
|
qi,
|
|
@@ -3027,10 +3034,10 @@ const Ie = {
|
|
|
3027
3034
|
}) : null }) });
|
|
3028
3035
|
}), Ki = () => {
|
|
3029
3036
|
const { thumbnailIcon: t } = pe();
|
|
3030
|
-
return t || /* @__PURE__ */ i(
|
|
3037
|
+
return t || /* @__PURE__ */ i(fr, {});
|
|
3031
3038
|
}, Xi = () => {
|
|
3032
3039
|
const { active: t, setActive: e } = Pn(), [n, o] = $(200), r = H(null), { thumbnailTool: a, sidebarEnable: l } = ve(), { localeMessages: c } = se(), d = N(() => {
|
|
3033
|
-
e((
|
|
3040
|
+
e((m) => !m);
|
|
3034
3041
|
}, []), p = k(() => typeof a != "boolean" && a ? /* @__PURE__ */ i(a, { onClick: d, active: t }) : a ? /* @__PURE__ */ i(K, { content: c == null ? void 0 : c.thumbnailTooltip, children: /* @__PURE__ */ i(
|
|
3035
3042
|
re,
|
|
3036
3043
|
{
|
|
@@ -3040,7 +3047,7 @@ const Ie = {
|
|
|
3040
3047
|
children: /* @__PURE__ */ i(Ki, {})
|
|
3041
3048
|
}
|
|
3042
3049
|
) }) : null, [a, t, d, c]);
|
|
3043
|
-
return /* @__PURE__ */ i(
|
|
3050
|
+
return /* @__PURE__ */ i(me, { children: l && /* @__PURE__ */ F(
|
|
3044
3051
|
"div",
|
|
3045
3052
|
{
|
|
3046
3053
|
style: { "--rp-thumbnail-width": `${n}px` },
|
|
@@ -3104,11 +3111,11 @@ const Ie = {
|
|
|
3104
3111
|
mobileWidth: c,
|
|
3105
3112
|
onLoaded: d,
|
|
3106
3113
|
cleanupOnLoaded: p,
|
|
3107
|
-
onLayoutWidthChange:
|
|
3114
|
+
onLayoutWidthChange: m
|
|
3108
3115
|
} = t, [_, h] = $(null), { setContainer: v, setContentRef: w } = ge(), { loading: T } = Q(), { LoaderImageComponent: P } = hn();
|
|
3109
3116
|
return W(() => (d && d(), () => {
|
|
3110
3117
|
p && p();
|
|
3111
|
-
}), [d, p]), /* @__PURE__ */ i(Yi, { toolbarRef: _, ref: e, children: /* @__PURE__ */ i(Pr, { mobileWidth: c, onLayoutWidthChange:
|
|
3118
|
+
}), [d, p]), /* @__PURE__ */ i(Yi, { toolbarRef: _, ref: e, children: /* @__PURE__ */ i(Pr, { mobileWidth: c, onLayoutWidthChange: m, children: /* @__PURE__ */ i(vr, { slots: o, children: /* @__PURE__ */ i(wr, { icons: r, children: /* @__PURE__ */ F(_r, { getContainerRef: v, style: a, className: l, children: [
|
|
3112
3119
|
/* @__PURE__ */ F(br, { children: [
|
|
3113
3120
|
/* @__PURE__ */ F("div", { className: _e["rp-layout"], children: [
|
|
3114
3121
|
/* @__PURE__ */ i(Vi, { ref: h }),
|
|
@@ -3184,7 +3191,7 @@ export {
|
|
|
3184
3191
|
Pn as m,
|
|
3185
3192
|
Io as n,
|
|
3186
3193
|
Tn as o,
|
|
3187
|
-
|
|
3194
|
+
Lo as p,
|
|
3188
3195
|
zo as q,
|
|
3189
3196
|
xt as r,
|
|
3190
3197
|
Xo as s,
|