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