@pdf-viewer/react 1.5.0-beta.9 → 1.5.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RPDefaultLayout-36b2f311.js +2973 -0
- package/dist/assets/RPDefaultLayout.css +1 -1
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +15 -18
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +3 -3
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +1 -1
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +2 -2
- 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/Checkbox.js +13 -14
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/RPTooltip.js +331 -689
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/index-1cb41342.js +307 -0
- package/dist/index-7279fb4e.js +1557 -0
- package/dist/index-aa2d3884.js +140 -0
- package/dist/main.js +1 -1
- package/dist/utils/hooks/useFileDownload.js +2 -2
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLoadWorker.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
- package/dist/RPDefaultLayout-e1e07d65.js +0 -2960
- package/dist/index-2e540713.js +0 -23
- package/dist/index-353ec0a6.js +0 -172
- package/dist/index-5ff5dbd0.js +0 -1675
- package/dist/index-71898eb9.js +0 -139
|
@@ -0,0 +1,2973 @@
|
|
|
1
|
+
import { jsx as a, Fragment as Se, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import * as U from "react";
|
|
3
|
+
import { useRef as M, useEffect as A, useCallback as L, useState as $, createContext as Ke, useContext as Xe, useMemo as F, forwardRef as We, useImperativeHandle as ln, createElement as Ge, PureComponent as nr, Component as rr, memo as or } from "react";
|
|
4
|
+
import { ChevronUpIcon as Me } from "./components/icons/ChevronUpIcon.js";
|
|
5
|
+
import { UIButton as ee } from "./components/ui/Button.js";
|
|
6
|
+
import { UIInput as dn } from "./components/ui/Input.js";
|
|
7
|
+
import { useScrollModeContext as Ee } from "./contexts/ScrollModeContext.js";
|
|
8
|
+
import { useDocumentContext as K } from "./contexts/RPDocumentContext.js";
|
|
9
|
+
import { useDarkModeContext as ir } from "./contexts/DarkModeContext.js";
|
|
10
|
+
import { ViewMode as Ze, ScrollMode as X, AnnotationSubType as kt, SelectionMode as ar, ZoomLevel as it } from "./utils/types.js";
|
|
11
|
+
import { useRotationContext as Ye } from "./contexts/RotationContext.js";
|
|
12
|
+
import { useLayerContext as sr } from "./contexts/LayerContext.js";
|
|
13
|
+
import { useZoomContext as Je } from "./contexts/ZoomContext.js";
|
|
14
|
+
import { useViewModeContext as Qe } from "./contexts/ViewModeContext.js";
|
|
15
|
+
import { useVirtualScrollContext as et } from "./contexts/VirtualScrollContext.js";
|
|
16
|
+
import { useVirtualGridContext as un } from "./contexts/VirtualGridContext.js";
|
|
17
|
+
import { useSelectionModeContext as cr } from "./contexts/SelectionModeContext.js";
|
|
18
|
+
import { useInitialStateContext as lr } from "./contexts/InitialStateContext.js";
|
|
19
|
+
import { useFullScreenContext as dr } from "./contexts/FullScreenContext.js";
|
|
20
|
+
import "./contexts/FileInputContext.js";
|
|
21
|
+
import "./contexts/DropFileZoneContext.js";
|
|
22
|
+
import { renderPage as wt } from "./utils/renderPage.js";
|
|
23
|
+
import { highlightMatches as pn, findMatches as ur, resetDivs as hn, highlightMultipleColorMatches as pr } from "./utils/highlight.js";
|
|
24
|
+
import * as Pt from "pdfjs-dist";
|
|
25
|
+
import { PixelsPerInch as hr, AnnotationMode as mr, RenderingCancelledException as fr, AnnotationLayer as gr } from "pdfjs-dist";
|
|
26
|
+
import { useLayoutContainer as Te } from "./contexts/LayoutContainerContext.js";
|
|
27
|
+
import { useDimensionPagesContext as tt } from "./contexts/DimensionPagesContext.js";
|
|
28
|
+
import { useLocalizationContext as ue } from "./contexts/LocalizationContext.js";
|
|
29
|
+
import { useHighlightContext as vr } from "./contexts/HighlightContext.js";
|
|
30
|
+
import { useDownloadContext as _r } from "./contexts/DownloadContext.js";
|
|
31
|
+
import { useSmoothScrollContext as xt } from "./contexts/SmoothScrollContext.js";
|
|
32
|
+
import { useLoaderContext as mn } from "./contexts/LoaderContext.js";
|
|
33
|
+
import "./contexts/LicenseContext.js";
|
|
34
|
+
import "./components/RPConfig.js";
|
|
35
|
+
import { ThumbnailIcon as wr } from "./components/icons/Thumbnail.js";
|
|
36
|
+
import { c as re } from "./clsx-0c6e471a.js";
|
|
37
|
+
import { LoaderIcon as St } from "./components/icons/LoaderIcon.js";
|
|
38
|
+
import { useInfiniteScroll as br } from "./utils/hooks/useInfiniteScroll.js";
|
|
39
|
+
import { RPSplitter as Cr } from "./components/layout/sidebar/RPSplitter.js";
|
|
40
|
+
import { useToolbarComponentContext as _e, ToolbarComponentProvider as Tr } from "./contexts/ToolbarComponentContext.js";
|
|
41
|
+
import { useIconContext as pe, IconProvider as Pr } from "./contexts/IconContext.js";
|
|
42
|
+
import q from "./components/ui/RPTooltip.js";
|
|
43
|
+
import { Container as xr } from "./components/layout/Container.js";
|
|
44
|
+
import { WrapperLayout as Sr } from "./components/layout/WrapperLayout.js";
|
|
45
|
+
import { RPDropFileZone as Ir } from "./components/RPDropFileZone.js";
|
|
46
|
+
import { useViewportContext as ye, ViewportProvider as yr } from "./contexts/ViewportContext.js";
|
|
47
|
+
import { useThemeContext as Lr } from "./contexts/ThemeContext.js";
|
|
48
|
+
import { SimpleLinkService as Rr } from "./utils/link_service.js";
|
|
49
|
+
import { annotationsEvents as Nr, annotationEventsHandler as Er, handleClick as Mt, handleAnnotationWidget as Or, handleAnnotationLink as Dr, bindLayerEvents as zr, unbindLayerEvents as Wt } from "./utils/annotations.js";
|
|
50
|
+
import { _ as Ar, U as Fr } from "./Popover-b7402893.js";
|
|
51
|
+
import { useMousePressed as kr } from "./utils/hooks/useMousePressed.js";
|
|
52
|
+
import { useGrabScroll as Mr } from "./utils/hooks/useGrabScroll.js";
|
|
53
|
+
import { usePinch as Wr } from "./utils/hooks/usePinch.js";
|
|
54
|
+
import { useDebounce as It } from "./utils/hooks/useDebounce.js";
|
|
55
|
+
import { getPositionFromPage as Hr, getPageFromPosition as $r } from "./utils/calculatePage.js";
|
|
56
|
+
import { getThumbnailViewport as Ht } from "./utils/getThumbnailViewport.js";
|
|
57
|
+
import { smoothScrollTo as at } from "./utils/smoothScrollTo.js";
|
|
58
|
+
import { appConsole as Gr } from "./utils/appConsole.js";
|
|
59
|
+
import { FileUploadTool as fn } from "./components/layout/toolbar/FileUploadTool.js";
|
|
60
|
+
import { DarkModeTool as Vr } from "./components/layout/toolbar/DarkModeTool.js";
|
|
61
|
+
import { ThreeDotIcon as Ur } from "./components/icons/ThreeDotIcon.js";
|
|
62
|
+
import { UIDropDown as gn } from "./components/ui/DropDown.js";
|
|
63
|
+
import { e as qr, a as yt, P as He, c as ke, g as Lt, i as Zr, k as Br, f as jr } from "./index-1cb41342.js";
|
|
64
|
+
import { D as Kr, u as st } from "./index-aa2d3884.js";
|
|
65
|
+
import { a as Xr, u as Yr, F as Jr, b as Qr, G as Be } from "./index-7279fb4e.js";
|
|
66
|
+
import { h as eo } from "./component-1da194e8.js";
|
|
67
|
+
import { CloseIcon as vn } from "./components/icons/CloseIcon.js";
|
|
68
|
+
import { dateFormatter as $t } from "./utils/dateFormatter.js";
|
|
69
|
+
import { PropertyItem as to } from "./components/layout/toolbar/PropertyItem.js";
|
|
70
|
+
import { useOtherToolContext as no, OtherToolProvider as ro } from "./contexts/OtherToolContext.js";
|
|
71
|
+
import { DocumentProperties as oo } from "./components/layout/toolbar/DocumentProperties.js";
|
|
72
|
+
import { RotateTool as io } from "./components/layout/toolbar/RotateTool.js";
|
|
73
|
+
import { ScrollModeTool as ao } from "./components/layout/toolbar/ScrollModeTool.js";
|
|
74
|
+
import { MenuSeparator as Rt } from "./components/layout/toolbar/MenuSeparator.js";
|
|
75
|
+
import { FileDownloadDefaultIcon as so } from "./components/icons/FileDownloadDefaultIcon.js";
|
|
76
|
+
import { MenuItem as Ce } from "./components/layout/toolbar/MenuItem.js";
|
|
77
|
+
import { PrintDefaultTool as co } from "./components/icons/PrintDefaultIcon.js";
|
|
78
|
+
import { FullScreenTool as _n } from "./components/layout/toolbar/FullScreenTool.js";
|
|
79
|
+
import { GoToDownIcon as wn } from "./components/icons/GoToDownIcon.js";
|
|
80
|
+
import { SelectionModeTool as lo } from "./components/layout/toolbar/SelectionModeTool.js";
|
|
81
|
+
import { ZoomInIcon as uo } from "./components/icons/ZoomInIcon.js";
|
|
82
|
+
import { ZoomOutIcon as po } from "./components/icons/ZoomOutIcon.js";
|
|
83
|
+
import { PAGE_PADDING as Gt } from "./utils/constants.js";
|
|
84
|
+
import { getZoomLevel as ho } from "./utils/getZoomLevel.js";
|
|
85
|
+
import { SearchIcon as mo } from "./components/icons/SearchIcon.js";
|
|
86
|
+
import { UICheckbox as Vt } from "./components/ui/Checkbox.js";
|
|
87
|
+
import { ClearIcon as fo } from "./components/icons/ClearIcon.js";
|
|
88
|
+
import { InfoIcon as Ut } from "./components/icons/InfoIcon.js";
|
|
89
|
+
import './assets/RPDefaultLayout.css';const $e = (e, t) => e.reduce((n, o, r) => r < t ? n + o : n, 0), ct = (e, t) => Math.round(e.left) === Math.round(t.left) && Math.round(e.top) === Math.round(t.top), bn = () => {
|
|
90
|
+
const { viewMode: e } = Qe(), { scrollMode: t } = Ee(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = et(), { setFocusedPage: i } = ie(), c = M(), { columnCount: s } = un(), { widths: l, heights: u } = tt(), d = M(t), f = M(e), h = M(s), { targetScrollPosition: g, smoothScrolling: w } = xt();
|
|
91
|
+
A(() => {
|
|
92
|
+
n != null && n.scrollToItem && (c.current = n);
|
|
93
|
+
}, [n]), A(() => {
|
|
94
|
+
d.current = t, f.current = e;
|
|
95
|
+
}, [t, e]);
|
|
96
|
+
const b = L(
|
|
97
|
+
(_, m) => {
|
|
98
|
+
if (!r)
|
|
99
|
+
return;
|
|
100
|
+
const P = Math.ceil(_ / 2) * 2 - 1;
|
|
101
|
+
if (_ === P + 1) {
|
|
102
|
+
const p = {
|
|
103
|
+
left: l[P],
|
|
104
|
+
top: 0
|
|
105
|
+
};
|
|
106
|
+
return g.current = p, new Promise(
|
|
107
|
+
(T) => at(r, p, T)
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
const x = {
|
|
111
|
+
left: 0,
|
|
112
|
+
top: 0
|
|
113
|
+
};
|
|
114
|
+
return g.current = x, r == null ? void 0 : r.scrollTo({
|
|
115
|
+
...x,
|
|
116
|
+
behavior: m
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
[r, l, at]
|
|
120
|
+
);
|
|
121
|
+
return A(() => {
|
|
122
|
+
d.current = t, f.current = e;
|
|
123
|
+
}, [t, e]), A(() => {
|
|
124
|
+
h.current = s;
|
|
125
|
+
}, [s]), { scrollToPage: L(
|
|
126
|
+
(_, m = "smooth") => {
|
|
127
|
+
const P = _ - 1;
|
|
128
|
+
let x = P, p = 0;
|
|
129
|
+
if (f.current === Ze.DUAL_PAGE && d.current === X.PAGE_SCROLLING) {
|
|
130
|
+
b(_, m);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (d.current === X.PAGE_SCROLLING) {
|
|
134
|
+
i(_);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (!c.current || !o)
|
|
138
|
+
return;
|
|
139
|
+
const T = o;
|
|
140
|
+
if (w.current = !0, d.current === X.HORIZONTAL_SCROLLING) {
|
|
141
|
+
p = P;
|
|
142
|
+
const N = {
|
|
143
|
+
left: $e(l, p),
|
|
144
|
+
top: 0
|
|
145
|
+
};
|
|
146
|
+
return ct(N, {
|
|
147
|
+
left: T.scrollLeft,
|
|
148
|
+
top: T.scrollTop
|
|
149
|
+
}) && (w.current = !1), g.current = N, T.scrollTo({
|
|
150
|
+
...N,
|
|
151
|
+
behavior: m
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
if (f.current === Ze.DUAL_PAGE) {
|
|
155
|
+
p = P % 2, x = Math.floor(P / 2);
|
|
156
|
+
const N = {
|
|
157
|
+
left: $e(l, p),
|
|
158
|
+
top: $e(u, x)
|
|
159
|
+
};
|
|
160
|
+
return ct(N, {
|
|
161
|
+
left: T.scrollLeft,
|
|
162
|
+
top: T.scrollTop
|
|
163
|
+
}) && (w.current = !1), g.current = N, T.scrollTo({
|
|
164
|
+
...N,
|
|
165
|
+
behavior: m
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
const C = {
|
|
169
|
+
left: 0,
|
|
170
|
+
top: $e(u, x)
|
|
171
|
+
};
|
|
172
|
+
return g.current = C, ct(C, {
|
|
173
|
+
left: T.scrollLeft,
|
|
174
|
+
top: T.scrollTop
|
|
175
|
+
}) && (w.current = !1), T.scrollTo({
|
|
176
|
+
...C,
|
|
177
|
+
behavior: m
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
[
|
|
181
|
+
o,
|
|
182
|
+
s,
|
|
183
|
+
b,
|
|
184
|
+
i,
|
|
185
|
+
at,
|
|
186
|
+
u,
|
|
187
|
+
l
|
|
188
|
+
]
|
|
189
|
+
) };
|
|
190
|
+
}, go = (e = 1) => {
|
|
191
|
+
const [t, n] = $(e), [o, r] = $(0), { scrollToPage: i } = bn(), c = M(1), { viewMode: s } = Qe(), { scrollMode: l } = Ee(), u = It(t, 100), d = L(
|
|
192
|
+
(b) => {
|
|
193
|
+
if (!/^[0-9]*$/g.test(b.toString()) || !b)
|
|
194
|
+
return { success: !1, currentPage: c.current };
|
|
195
|
+
const _ = +b;
|
|
196
|
+
return _ < 0 || _ > o ? { success: !1, currentPage: c.current } : (n(_), c.current = _, { success: !0, currentPage: +b });
|
|
197
|
+
},
|
|
198
|
+
[o]
|
|
199
|
+
), f = L(d, [d]), h = L(
|
|
200
|
+
(b) => {
|
|
201
|
+
const v = d(b);
|
|
202
|
+
return v.success && i(v.currentPage), v;
|
|
203
|
+
},
|
|
204
|
+
[d, i]
|
|
205
|
+
), g = L(() => {
|
|
206
|
+
let b = t - 1;
|
|
207
|
+
h(b);
|
|
208
|
+
}, [h, t, s, l]), w = L(() => {
|
|
209
|
+
let b = t + 1;
|
|
210
|
+
h(b);
|
|
211
|
+
}, [h, t, s, l]);
|
|
212
|
+
return {
|
|
213
|
+
focusedPage: u,
|
|
214
|
+
totalPages: o,
|
|
215
|
+
setFocusedPage: f,
|
|
216
|
+
setTotalPages: r,
|
|
217
|
+
nextPage: w,
|
|
218
|
+
prevPage: g,
|
|
219
|
+
goToPage: h
|
|
220
|
+
};
|
|
221
|
+
}, Cn = Ke({
|
|
222
|
+
focusedPage: 0,
|
|
223
|
+
setFocusedPage: (e) => {
|
|
224
|
+
},
|
|
225
|
+
goToPage: (e) => ({ success: !!e, currentPage: +e }),
|
|
226
|
+
totalPages: 0,
|
|
227
|
+
setTotalPages: (e) => {
|
|
228
|
+
},
|
|
229
|
+
prevPage: () => {
|
|
230
|
+
},
|
|
231
|
+
nextPage: () => {
|
|
232
|
+
}
|
|
233
|
+
}), ie = () => {
|
|
234
|
+
const e = Xe(Cn);
|
|
235
|
+
return typeof (e == null ? void 0 : e.focusedPage) > "u" && Gr.error("Please use this hooks inside children component of RPProvider"), e;
|
|
236
|
+
}, Ts = ({ children: e }) => {
|
|
237
|
+
const { pdf: t } = K(), { focusedPage: n, totalPages: o, setFocusedPage: r, setTotalPages: i, goToPage: c, nextPage: s, prevPage: l } = go();
|
|
238
|
+
return A(() => {
|
|
239
|
+
t != null && t.numPages && (i(t.numPages), r(1));
|
|
240
|
+
}, [t, i, r]), /* @__PURE__ */ a(
|
|
241
|
+
Cn.Provider,
|
|
242
|
+
{
|
|
243
|
+
value: {
|
|
244
|
+
focusedPage: n,
|
|
245
|
+
totalPages: o,
|
|
246
|
+
setFocusedPage: r,
|
|
247
|
+
setTotalPages: i,
|
|
248
|
+
nextPage: s,
|
|
249
|
+
prevPage: l,
|
|
250
|
+
goToPage: c
|
|
251
|
+
},
|
|
252
|
+
children: e
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
};
|
|
256
|
+
const vo = () => {
|
|
257
|
+
const { pdf: e, pages: t } = K(), [n, o] = $({
|
|
258
|
+
loadedPages: 0,
|
|
259
|
+
totalPages: 0,
|
|
260
|
+
percentage: 0
|
|
261
|
+
}), [r, i] = $(!1), [c, s] = $(!1), [l, u] = $(null), d = M(!1);
|
|
262
|
+
A(() => {
|
|
263
|
+
d.current;
|
|
264
|
+
}, [d]);
|
|
265
|
+
const f = L(() => {
|
|
266
|
+
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
267
|
+
const P = document.querySelector(".rp-print-zone");
|
|
268
|
+
P && P.remove();
|
|
269
|
+
}, []), h = L(() => {
|
|
270
|
+
d.current = !1, i(!1), s(!1), u(null), o({
|
|
271
|
+
loadedPages: 0,
|
|
272
|
+
totalPages: 0,
|
|
273
|
+
percentage: 0
|
|
274
|
+
});
|
|
275
|
+
}, []), g = () => {
|
|
276
|
+
d.current = !0;
|
|
277
|
+
}, w = async ({
|
|
278
|
+
scratchCanvas: P,
|
|
279
|
+
pdfDocument: x,
|
|
280
|
+
pageNumber: p,
|
|
281
|
+
viewerPdfPage: T,
|
|
282
|
+
printResolution: C,
|
|
283
|
+
optionalContentConfigPromise: S,
|
|
284
|
+
printAnnotationStoragePromise: N
|
|
285
|
+
}) => {
|
|
286
|
+
if (d.current) {
|
|
287
|
+
h();
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
const y = C / hr.PDF;
|
|
291
|
+
P.width = Math.floor(T.width * y), P.height = Math.floor(T.height * y);
|
|
292
|
+
const O = P.getContext("2d");
|
|
293
|
+
O.save(), O.fillStyle = "rgb(255, 255, 255)", O.fillRect(0, 0, P.width, P.height), O.restore();
|
|
294
|
+
const [R, k] = await Promise.all([
|
|
295
|
+
x.getPage(p),
|
|
296
|
+
N
|
|
297
|
+
]);
|
|
298
|
+
if (d.current) {
|
|
299
|
+
h();
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
const z = {
|
|
303
|
+
canvasContext: O,
|
|
304
|
+
transform: [y, 0, 0, y, 0, 0],
|
|
305
|
+
viewport: R.getViewport({ scale: 1, rotation: T.rotation }),
|
|
306
|
+
intent: "print",
|
|
307
|
+
annotationMode: mr.ENABLE_STORAGE,
|
|
308
|
+
optionalContentConfigPromise: S,
|
|
309
|
+
printAnnotationStorage: k
|
|
310
|
+
};
|
|
311
|
+
try {
|
|
312
|
+
return R.render(z).promise;
|
|
313
|
+
} catch (I) {
|
|
314
|
+
throw I instanceof fr || console.error(I), I;
|
|
315
|
+
}
|
|
316
|
+
}, b = L(() => {
|
|
317
|
+
const P = window.print;
|
|
318
|
+
return new Promise((x) => {
|
|
319
|
+
const p = (S) => {
|
|
320
|
+
setTimeout(() => {
|
|
321
|
+
P.call(window), setTimeout(() => S(), 20);
|
|
322
|
+
}, 0);
|
|
323
|
+
};
|
|
324
|
+
if (document.querySelector(".rp-print-zone")) {
|
|
325
|
+
p(x);
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
const C = new MutationObserver(() => {
|
|
329
|
+
document.querySelector(".rp-print-zone") && (p(x), C.disconnect());
|
|
330
|
+
});
|
|
331
|
+
C.observe(document.body, { childList: !0, subtree: !0 });
|
|
332
|
+
});
|
|
333
|
+
}, []), v = async (P) => {
|
|
334
|
+
const x = document.createElement("img"), p = document.createElement("div");
|
|
335
|
+
return p.classList.add("rp-print-page"), await new Promise((T, C) => {
|
|
336
|
+
P.toBlob((S) => {
|
|
337
|
+
S ? (x.src = URL.createObjectURL(S), x.onload = () => {
|
|
338
|
+
URL.revokeObjectURL(x.src), T();
|
|
339
|
+
}, x.onerror = C) : C(new Error("Failed to create blob"));
|
|
340
|
+
});
|
|
341
|
+
}).catch(() => {
|
|
342
|
+
}), p.appendChild(x), p;
|
|
343
|
+
}, _ = (P, x) => {
|
|
344
|
+
const p = document.createElement("div");
|
|
345
|
+
p.classList.add("rp-print-zone");
|
|
346
|
+
const T = document.createElement("style"), C = x.get(1);
|
|
347
|
+
if (C) {
|
|
348
|
+
const { width: S, height: N } = C == null ? void 0 : C.page.getViewport({ scale: 1 });
|
|
349
|
+
T.innerHTML = `@page { size: ${S}px ${N}px }`;
|
|
350
|
+
}
|
|
351
|
+
return p.appendChild(T), p.append(...P), p;
|
|
352
|
+
}, m = L(async () => {
|
|
353
|
+
if (!e)
|
|
354
|
+
return;
|
|
355
|
+
h();
|
|
356
|
+
const P = document.createElement("canvas"), x = [];
|
|
357
|
+
try {
|
|
358
|
+
e.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
359
|
+
const T = e.getOptionalContentConfig({ intent: "print" }), C = Promise.resolve(
|
|
360
|
+
e.annotationStorage.print ?? void 0
|
|
361
|
+
), S = t.size;
|
|
362
|
+
for (const [y, O] of t) {
|
|
363
|
+
if (d.current) {
|
|
364
|
+
h();
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
const R = O.page.getViewport({ scale: 1 });
|
|
368
|
+
if (await w({
|
|
369
|
+
scratchCanvas: P,
|
|
370
|
+
pdfDocument: e,
|
|
371
|
+
pageNumber: y,
|
|
372
|
+
viewerPdfPage: R,
|
|
373
|
+
printResolution: 150,
|
|
374
|
+
optionalContentConfigPromise: T,
|
|
375
|
+
printAnnotationStoragePromise: C
|
|
376
|
+
}), d.current) {
|
|
377
|
+
h();
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
const k = await v(P);
|
|
381
|
+
x.push(k);
|
|
382
|
+
const z = parseFloat((x.length / S * 100).toFixed(2));
|
|
383
|
+
o({
|
|
384
|
+
loadedPages: y,
|
|
385
|
+
totalPages: S,
|
|
386
|
+
percentage: z
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
if (d.current) {
|
|
390
|
+
h();
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
const N = _(x, t);
|
|
394
|
+
document.body.appendChild(N), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), i(!0), await b();
|
|
395
|
+
} catch (p) {
|
|
396
|
+
s(!0), p instanceof Error && u(p);
|
|
397
|
+
} finally {
|
|
398
|
+
P.height = 0, P.width = 0;
|
|
399
|
+
}
|
|
400
|
+
}, [e, t, d]);
|
|
401
|
+
return A(() => {
|
|
402
|
+
const P = () => {
|
|
403
|
+
h(), f();
|
|
404
|
+
};
|
|
405
|
+
return window.addEventListener("afterprint", P, !0), () => {
|
|
406
|
+
window.removeEventListener("afterprint", P, !0);
|
|
407
|
+
};
|
|
408
|
+
}, [f, h]), {
|
|
409
|
+
print: m,
|
|
410
|
+
cancel: g,
|
|
411
|
+
progress: n,
|
|
412
|
+
isComplete: r,
|
|
413
|
+
isError: c,
|
|
414
|
+
error: l
|
|
415
|
+
};
|
|
416
|
+
}, Tn = Ke({
|
|
417
|
+
print: () => {
|
|
418
|
+
},
|
|
419
|
+
cancel: () => {
|
|
420
|
+
},
|
|
421
|
+
setOnProgress: (e) => {
|
|
422
|
+
},
|
|
423
|
+
progress: {},
|
|
424
|
+
setOnComplete: (e) => e(),
|
|
425
|
+
setOnError: (e) => {
|
|
426
|
+
try {
|
|
427
|
+
const t = new Error("Print error occurred");
|
|
428
|
+
e(t);
|
|
429
|
+
} catch (t) {
|
|
430
|
+
console.error("Error in setOnError callback:", t);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}), Ps = ({ children: e }) => {
|
|
434
|
+
const [t, n] = $(null), [o, r] = $(null), { print: i, cancel: c, progress: s, isComplete: l, isError: u, error: d } = vo(), f = L((v) => {
|
|
435
|
+
v && typeof v == "function" && r(() => v);
|
|
436
|
+
}, []), h = (v) => {
|
|
437
|
+
d && v(d);
|
|
438
|
+
}, g = L(
|
|
439
|
+
(v) => {
|
|
440
|
+
n(() => v);
|
|
441
|
+
},
|
|
442
|
+
[s, t]
|
|
443
|
+
);
|
|
444
|
+
A(() => {
|
|
445
|
+
l && o && w();
|
|
446
|
+
}, [l, o]), A(() => {
|
|
447
|
+
u && h((v) => {
|
|
448
|
+
console.error(v);
|
|
449
|
+
});
|
|
450
|
+
}, [u]), A(() => {
|
|
451
|
+
s && t && t(s);
|
|
452
|
+
}, [s, t]);
|
|
453
|
+
const w = () => {
|
|
454
|
+
o && (o(), r(null));
|
|
455
|
+
}, b = {
|
|
456
|
+
print: i,
|
|
457
|
+
cancel: c,
|
|
458
|
+
setOnProgress: g,
|
|
459
|
+
setOnComplete: f,
|
|
460
|
+
setOnError: h,
|
|
461
|
+
progress: s
|
|
462
|
+
};
|
|
463
|
+
return /* @__PURE__ */ a(Tn.Provider, { value: b, children: e });
|
|
464
|
+
}, nt = () => {
|
|
465
|
+
const e = Xe(Tn);
|
|
466
|
+
if (!e)
|
|
467
|
+
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
468
|
+
return e;
|
|
469
|
+
}, _o = () => {
|
|
470
|
+
const [e, t] = $({}), { pages: n } = K(), { rotate: o } = Ye(), r = F(() => Object.keys(e).length, [e]), i = L(
|
|
471
|
+
(s) => {
|
|
472
|
+
if (!n.size || s > n.size)
|
|
473
|
+
return;
|
|
474
|
+
const l = Array.from(n.values()).slice(0, s).map((f) => {
|
|
475
|
+
const { thumbnailViewport: h, scale: g } = Ht(f.page, o);
|
|
476
|
+
return {
|
|
477
|
+
scale: g,
|
|
478
|
+
page: f.page,
|
|
479
|
+
loading: !0,
|
|
480
|
+
viewport: h
|
|
481
|
+
};
|
|
482
|
+
}), u = l.reduce((f, h) => (f[h.page.pageNumber] = h, f), {});
|
|
483
|
+
t(u);
|
|
484
|
+
const d = [];
|
|
485
|
+
for (const f of l) {
|
|
486
|
+
const h = document.createElement("canvas"), g = wt(f.page, h, {
|
|
487
|
+
scale: f.scale,
|
|
488
|
+
rotate: o
|
|
489
|
+
}).promise.then(() => {
|
|
490
|
+
const w = h.toDataURL();
|
|
491
|
+
return {
|
|
492
|
+
...f,
|
|
493
|
+
thumbnailSrc: w,
|
|
494
|
+
loading: !1
|
|
495
|
+
};
|
|
496
|
+
});
|
|
497
|
+
d.push(g);
|
|
498
|
+
}
|
|
499
|
+
Promise.all(d).then((f) => {
|
|
500
|
+
const h = f.reduce(
|
|
501
|
+
(g, w) => (g[w.page.pageNumber] = w, g),
|
|
502
|
+
{}
|
|
503
|
+
);
|
|
504
|
+
t((g) => ({ ...g, ...h }));
|
|
505
|
+
}).catch(() => {
|
|
506
|
+
});
|
|
507
|
+
},
|
|
508
|
+
[n, o]
|
|
509
|
+
);
|
|
510
|
+
A(() => {
|
|
511
|
+
i(10);
|
|
512
|
+
}, [i]);
|
|
513
|
+
const c = L(
|
|
514
|
+
(s) => {
|
|
515
|
+
if (!n)
|
|
516
|
+
return;
|
|
517
|
+
const l = n.get(s);
|
|
518
|
+
if (!l)
|
|
519
|
+
return;
|
|
520
|
+
t((d) => ({
|
|
521
|
+
...d,
|
|
522
|
+
[s]: {
|
|
523
|
+
loading: !0,
|
|
524
|
+
page: l.page,
|
|
525
|
+
viewport: l.thumbnailViewport,
|
|
526
|
+
scale: l.thumbnailScale
|
|
527
|
+
}
|
|
528
|
+
}));
|
|
529
|
+
const u = document.createElement("canvas");
|
|
530
|
+
wt(l.page, u, { scale: l.thumbnailScale, rotate: o }).promise.then(() => {
|
|
531
|
+
const d = u.toDataURL(), { thumbnailViewport: f, scale: h } = Ht(l.page, o);
|
|
532
|
+
return {
|
|
533
|
+
scale: h,
|
|
534
|
+
thumbnailSrc: d,
|
|
535
|
+
page: l.page,
|
|
536
|
+
loading: !1,
|
|
537
|
+
viewport: f
|
|
538
|
+
};
|
|
539
|
+
}).then((d) => {
|
|
540
|
+
t((f) => ({ ...f, [s]: d }));
|
|
541
|
+
});
|
|
542
|
+
},
|
|
543
|
+
[n, o]
|
|
544
|
+
);
|
|
545
|
+
return { thumbnailPages: e, addPage: c, addToPage: i, thumbnailLength: r };
|
|
546
|
+
}, Pn = Ke({
|
|
547
|
+
thumbnailPages: {},
|
|
548
|
+
addPage: (e) => {
|
|
549
|
+
},
|
|
550
|
+
addToPage: (e) => {
|
|
551
|
+
},
|
|
552
|
+
thumbnailLength: 0,
|
|
553
|
+
setActive: (e) => {
|
|
554
|
+
},
|
|
555
|
+
active: !1
|
|
556
|
+
}), xn = () => Xe(Pn), xs = ({
|
|
557
|
+
children: e,
|
|
558
|
+
initialThumbnailsVisible: t
|
|
559
|
+
}) => {
|
|
560
|
+
const { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: i } = _o(), [c, s] = $(t);
|
|
561
|
+
return /* @__PURE__ */ a(
|
|
562
|
+
Pn.Provider,
|
|
563
|
+
{
|
|
564
|
+
value: { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: i, active: c, setActive: s },
|
|
565
|
+
children: e
|
|
566
|
+
}
|
|
567
|
+
);
|
|
568
|
+
}, wo = (e = {}, t = "") => {
|
|
569
|
+
const [n, o] = $(t), [r, i] = $(!1), { pdf: c, pages: s } = K(), l = tt(), u = M(!n), { currentZoom: d } = Je(), [f, h] = $([]), { setFocusedPage: g } = ie(), [w, b] = $(0), { pageScrollElementRef: v, virtualScrollableElementRef: _ } = et(), { scrollMode: m } = Ee(), { pagesRef: P } = Te(), [x, p] = $(null), T = M({}), C = F(() => w === 0 ? null : f[w - 1], [w, f]), S = F(() => f.length, [f]);
|
|
570
|
+
A(() => {
|
|
571
|
+
if (!C || !s)
|
|
572
|
+
return;
|
|
573
|
+
const R = _ || v;
|
|
574
|
+
if (!R || !P)
|
|
575
|
+
return;
|
|
576
|
+
const k = s.get(C.page), z = P.clientHeight / 2, I = P.clientWidth / 2;
|
|
577
|
+
let E = 0, W = 0;
|
|
578
|
+
m === X.PAGE_SCROLLING && g(C.page), m === X.VERTICAL_SCROLLING && (E = l.heights.slice(0, C.page - 1).reduce((j, B) => j + B, 0)), m === X.HORIZONTAL_SCROLLING && (W = l.widths.slice(0, C.page - 1).reduce((j, B) => j + B, 0));
|
|
579
|
+
let V;
|
|
580
|
+
if (!k)
|
|
581
|
+
return;
|
|
582
|
+
const Z = T.current[C.page], Y = k.page.getViewport({ scale: 1 });
|
|
583
|
+
V = new Pt.TextLayer({
|
|
584
|
+
viewport: Y,
|
|
585
|
+
textContentSource: Z,
|
|
586
|
+
container: document.createElement("div")
|
|
587
|
+
}), V.render().then(() => {
|
|
588
|
+
const j = V.textDivs[C.start.idx], [B] = pn([C], Z, V.textDivs), te = l.widths[C.page - 1], ae = l.heights[C.page - 1], J = document.createElement("div"), ne = document.createElement("div");
|
|
589
|
+
j.style.position = "absolute", j.style.color = "transparent", ne.style.position = "absolute", ne.style.top = "0", ne.style.setProperty("--scale-factor", `${d}`), J.style.position = "relative", J.style.width = `${te}px`, J.style.height = `${ae}px`, J.style.zIndex = "-1", J.appendChild(j), ne.appendChild(J), P.prepend(ne);
|
|
590
|
+
const he = B.element.getBoundingClientRect(), ce = ne.getBoundingClientRect(), Oe = he.top - ce.top, we = he.left - ce.left, me = E + Oe - z + he.height / 2, le = W + we - I + he.width / 2, De = {
|
|
591
|
+
left: Math.max(le, 0),
|
|
592
|
+
top: Math.max(me, 0)
|
|
593
|
+
};
|
|
594
|
+
P.removeChild(ne), R.scrollTo({
|
|
595
|
+
...De
|
|
596
|
+
});
|
|
597
|
+
});
|
|
598
|
+
}, [
|
|
599
|
+
s,
|
|
600
|
+
g,
|
|
601
|
+
l,
|
|
602
|
+
C,
|
|
603
|
+
m,
|
|
604
|
+
_,
|
|
605
|
+
v,
|
|
606
|
+
P
|
|
607
|
+
]);
|
|
608
|
+
const N = L(() => {
|
|
609
|
+
b((R) => S ? R + 1 > S ? 1 : R + 1 : 0);
|
|
610
|
+
}, [S]), y = L(() => {
|
|
611
|
+
b((R) => S ? R - 1 <= 0 ? S : R - 1 : 0);
|
|
612
|
+
}, [S]), O = L(async (R) => {
|
|
613
|
+
if (!R)
|
|
614
|
+
return {};
|
|
615
|
+
const k = R.numPages, z = {};
|
|
616
|
+
for (let I = 1; I <= k; I++) {
|
|
617
|
+
if (u.current)
|
|
618
|
+
throw "close pop over";
|
|
619
|
+
const E = await R.getPage(I);
|
|
620
|
+
z[I.toString()] = await E.getTextContent();
|
|
621
|
+
}
|
|
622
|
+
return z;
|
|
623
|
+
}, []);
|
|
624
|
+
return A(() => {
|
|
625
|
+
if (!n) {
|
|
626
|
+
u.current = !0, h([]), b(0);
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
u.current = !1, i(!0), h([]), b(0), O(c).then((R) => {
|
|
630
|
+
T.current = R;
|
|
631
|
+
const z = Object.keys(R).reduce((I, E) => {
|
|
632
|
+
const W = ur(
|
|
633
|
+
[n],
|
|
634
|
+
R[E],
|
|
635
|
+
Number(E) - 1,
|
|
636
|
+
e
|
|
637
|
+
).map((V, Z) => ({ ...V, page: Number(E), pageMatchIdx: Z }));
|
|
638
|
+
return [...I, ...W];
|
|
639
|
+
}, []);
|
|
640
|
+
h(z), b(z.length ? 1 : 0);
|
|
641
|
+
}).catch(() => {
|
|
642
|
+
h([]), b(0);
|
|
643
|
+
}).finally(() => i(!1));
|
|
644
|
+
}, [n, O, c, e]), {
|
|
645
|
+
search: n,
|
|
646
|
+
setSearch: o,
|
|
647
|
+
loading: r,
|
|
648
|
+
matches: f,
|
|
649
|
+
totalMatches: S,
|
|
650
|
+
currentMatchPosition: w,
|
|
651
|
+
currentMatch: C,
|
|
652
|
+
nextMatch: N,
|
|
653
|
+
prevMatch: y,
|
|
654
|
+
currentMatchElement: x,
|
|
655
|
+
setCurrentMatchElement: p
|
|
656
|
+
};
|
|
657
|
+
}, Sn = Ke({
|
|
658
|
+
search: "",
|
|
659
|
+
setSearch: (e) => {
|
|
660
|
+
},
|
|
661
|
+
loading: !1,
|
|
662
|
+
matches: [],
|
|
663
|
+
totalMatches: 0,
|
|
664
|
+
currentMatchPosition: 0,
|
|
665
|
+
currentMatch: null,
|
|
666
|
+
nextMatch: () => {
|
|
667
|
+
},
|
|
668
|
+
prevMatch: () => {
|
|
669
|
+
},
|
|
670
|
+
searchOptions: {},
|
|
671
|
+
setSearchOptions: (e) => e,
|
|
672
|
+
currentMatchElement: null,
|
|
673
|
+
setCurrentMatchElement: (e) => {
|
|
674
|
+
}
|
|
675
|
+
}), Ss = ({
|
|
676
|
+
children: e,
|
|
677
|
+
initialSearch: t
|
|
678
|
+
}) => {
|
|
679
|
+
const [n, o] = $({}), {
|
|
680
|
+
loading: r,
|
|
681
|
+
setSearch: i,
|
|
682
|
+
totalMatches: c,
|
|
683
|
+
currentMatchPosition: s,
|
|
684
|
+
currentMatch: l,
|
|
685
|
+
search: u,
|
|
686
|
+
matches: d,
|
|
687
|
+
nextMatch: f,
|
|
688
|
+
prevMatch: h,
|
|
689
|
+
currentMatchElement: g,
|
|
690
|
+
setCurrentMatchElement: w
|
|
691
|
+
} = wo(n, t);
|
|
692
|
+
return /* @__PURE__ */ a(
|
|
693
|
+
Sn.Provider,
|
|
694
|
+
{
|
|
695
|
+
value: {
|
|
696
|
+
searchOptions: n,
|
|
697
|
+
setSearchOptions: o,
|
|
698
|
+
loading: r,
|
|
699
|
+
setSearch: i,
|
|
700
|
+
totalMatches: c,
|
|
701
|
+
currentMatchPosition: s,
|
|
702
|
+
currentMatch: l,
|
|
703
|
+
nextMatch: f,
|
|
704
|
+
prevMatch: h,
|
|
705
|
+
search: u,
|
|
706
|
+
matches: d,
|
|
707
|
+
currentMatchElement: g,
|
|
708
|
+
setCurrentMatchElement: w
|
|
709
|
+
},
|
|
710
|
+
children: e
|
|
711
|
+
}
|
|
712
|
+
);
|
|
713
|
+
}, In = () => Xe(Sn), de = {
|
|
714
|
+
"rp-pages": "_rp-pages_1776r_1",
|
|
715
|
+
"rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_1776r_7",
|
|
716
|
+
"rp-pages-container": "_rp-pages-container_1776r_11",
|
|
717
|
+
"rp-page-scrolling-wrapper": "_rp-page-scrolling-wrapper_1776r_17",
|
|
718
|
+
"rp-viewer": "_rp-viewer_1776r_22",
|
|
719
|
+
"rp-cursor-grab": "_rp-cursor-grab_1776r_27",
|
|
720
|
+
"rp-cursor-grabbing": "_rp-cursor-grabbing_1776r_35",
|
|
721
|
+
"rp-loader": "_rp-loader_1776r_43"
|
|
722
|
+
}, lt = {
|
|
723
|
+
"rp-page-wrapper": "_rp-page-wrapper_h7a2q_1",
|
|
724
|
+
"rp-page": "_rp-page_h7a2q_1",
|
|
725
|
+
"rp-loader-wrapper": "_rp-loader-wrapper_h7a2q_14"
|
|
726
|
+
}, bo = (e) => {
|
|
727
|
+
const { pageNumber: t, onLoaded: n, onLoading: o } = e, r = M(null), { pages: i } = K(), { rotate: c } = Ye(), s = M(), { currentZoom: l } = Je();
|
|
728
|
+
return A(() => {
|
|
729
|
+
if (!i || l === 0)
|
|
730
|
+
return;
|
|
731
|
+
const u = i.get(t);
|
|
732
|
+
if (r.current && u) {
|
|
733
|
+
const d = r.current;
|
|
734
|
+
d.hidden = !0;
|
|
735
|
+
const f = s.current;
|
|
736
|
+
f && f.cancel(), o && o(), s.current = wt(u.page, d, {
|
|
737
|
+
scale: l,
|
|
738
|
+
rotate: c,
|
|
739
|
+
renderForms: !0
|
|
740
|
+
}), s.current.promise.then(() => {
|
|
741
|
+
d.hidden = !1;
|
|
742
|
+
}).catch(() => {
|
|
743
|
+
}).finally(() => {
|
|
744
|
+
n && n();
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
return () => {
|
|
748
|
+
var d;
|
|
749
|
+
(d = s.current) == null || d.cancel();
|
|
750
|
+
};
|
|
751
|
+
}, [i, t, c, l, o, n]), /* @__PURE__ */ a("canvas", { "data-rp": `page-${t}-canvas`, ref: r });
|
|
752
|
+
}, dt = {
|
|
753
|
+
"rp-text-layer": "_rp-text-layer_kwwfn_1",
|
|
754
|
+
"rp-text-layer-text": "_rp-text-layer-text_kwwfn_9"
|
|
755
|
+
}, Co = (e) => {
|
|
756
|
+
const { pageNumber: t } = e, { pages: n } = K(), o = M(null), { matches: r, currentMatch: i, setCurrentMatchElement: c } = In(), [s, l] = $(
|
|
757
|
+
[]
|
|
758
|
+
), u = M(), d = M(), f = M(), h = F(() => r.filter((w) => w.pageIndex === t - 1), [r, t]), g = L(
|
|
759
|
+
(w, b, v = !1) => {
|
|
760
|
+
if (v && hn(w, b), !h.length) {
|
|
761
|
+
f.current = void 0, l([]);
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
764
|
+
const _ = pn(h, w, b);
|
|
765
|
+
l(_);
|
|
766
|
+
},
|
|
767
|
+
[h]
|
|
768
|
+
);
|
|
769
|
+
return A(() => {
|
|
770
|
+
var v;
|
|
771
|
+
if ((v = f.current) == null || v.classList.remove("selected"), !s.length || !i || i.pageIndex !== t - 1)
|
|
772
|
+
return;
|
|
773
|
+
const w = h.findIndex(
|
|
774
|
+
(_) => JSON.stringify(_) === JSON.stringify(i)
|
|
775
|
+
);
|
|
776
|
+
if (w === -1)
|
|
777
|
+
return;
|
|
778
|
+
const b = s.find((_) => _.index === w);
|
|
779
|
+
b && (f.current = b.element, c(b.element), b.element.classList.add("selected"));
|
|
780
|
+
}, [i, s, h]), A(() => {
|
|
781
|
+
const w = n.get(t);
|
|
782
|
+
if (!w || !o.current)
|
|
783
|
+
return;
|
|
784
|
+
const b = o.current;
|
|
785
|
+
return u.current && u.current.cancel(), w.page.getTextContent().then((v) => {
|
|
786
|
+
const _ = w.page.getViewport({ scale: 1 });
|
|
787
|
+
return u.current = new Pt.TextLayer({
|
|
788
|
+
viewport: _,
|
|
789
|
+
textContentSource: v,
|
|
790
|
+
container: b
|
|
791
|
+
}), d.current = v, b && (b.innerText = ""), u.current.render();
|
|
792
|
+
}).then(() => {
|
|
793
|
+
var m;
|
|
794
|
+
[].slice.call(b.children).forEach((P) => {
|
|
795
|
+
P.classList.add(dt["rp-text-layer-text"]);
|
|
796
|
+
});
|
|
797
|
+
const _ = (m = u.current) == null ? void 0 : m.textDivs;
|
|
798
|
+
_ && d.current && g(d.current, _);
|
|
799
|
+
}).catch(() => {
|
|
800
|
+
}), () => {
|
|
801
|
+
var v;
|
|
802
|
+
(v = u.current) == null || v.cancel();
|
|
803
|
+
};
|
|
804
|
+
}, [n, t]), A(() => {
|
|
805
|
+
var v;
|
|
806
|
+
[].slice.call(o.current.children).forEach((_) => {
|
|
807
|
+
_.classList.add(dt["rp-text-layer-text"]);
|
|
808
|
+
});
|
|
809
|
+
const b = (v = u.current) == null ? void 0 : v.textDivs;
|
|
810
|
+
b && d.current && g(d.current, b, !0);
|
|
811
|
+
}, [g]), /* @__PURE__ */ a(
|
|
812
|
+
"div",
|
|
813
|
+
{
|
|
814
|
+
"data-rp": `page-${t}-textLayer`,
|
|
815
|
+
className: dt["rp-text-layer"],
|
|
816
|
+
ref: o
|
|
817
|
+
}
|
|
818
|
+
);
|
|
819
|
+
}, To = {
|
|
820
|
+
"rp-annotation-layer": "_rp-annotation-layer_o0ksd_1"
|
|
821
|
+
};
|
|
822
|
+
let Po = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
823
|
+
const xo = (e) => {
|
|
824
|
+
const { pageNumber: t } = e, n = M(null), { pages: o, pdf: r } = K(), i = M(), [c, s] = $(), { setFocusedPage: l, goToPage: u } = ie(), { scrollMode: d } = Ee(), { print: f } = nt(), { download: h } = Un(), g = F(() => o.get(t), [o, t]), w = F(() => g == null ? void 0 : g.page.getViewport(), [g]);
|
|
825
|
+
A(() => {
|
|
826
|
+
i.current && (i.current.div.replaceChildren(), i.current = void 0);
|
|
827
|
+
}, [r]), A(() => {
|
|
828
|
+
g && g.page.getAnnotations().then((v) => {
|
|
829
|
+
i.current = void 0, s(v), n.current && (n.current.innerText = "");
|
|
830
|
+
});
|
|
831
|
+
}, [g]);
|
|
832
|
+
const b = L(
|
|
833
|
+
(v) => {
|
|
834
|
+
!c || !r || (Nr(v), Er(v, r, c).then((_) => {
|
|
835
|
+
var m, P;
|
|
836
|
+
((m = _ == null ? void 0 : _.data) == null ? void 0 : m.action) === "Print" ? f() : ((P = _ == null ? void 0 : _.data) == null ? void 0 : P.action) === "SaveAs" && h();
|
|
837
|
+
}), d === X.PAGE_SCROLLING ? Mt(v, c, r, (_) => l(_.pageIndex + 1)) : Mt(v, c, r, (_) => u(_.pageIndex + 1)));
|
|
838
|
+
},
|
|
839
|
+
[r, c, u, l, d, f, h]
|
|
840
|
+
);
|
|
841
|
+
return A(() => {
|
|
842
|
+
if (!g || !c)
|
|
843
|
+
return;
|
|
844
|
+
const v = g.page.getViewport();
|
|
845
|
+
if (i.current) {
|
|
846
|
+
i.current.update({
|
|
847
|
+
viewport: v.clone({ dontFlip: !0 })
|
|
848
|
+
});
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
const _ = /* @__PURE__ */ new Map([]);
|
|
852
|
+
for (const x of c) {
|
|
853
|
+
const { annotationType: p } = x;
|
|
854
|
+
switch (p) {
|
|
855
|
+
case kt.Link:
|
|
856
|
+
Dr(x);
|
|
857
|
+
break;
|
|
858
|
+
case kt.Widget:
|
|
859
|
+
Or(x, v, _);
|
|
860
|
+
break;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
const m = new AbortController();
|
|
864
|
+
return (async () => {
|
|
865
|
+
var T;
|
|
866
|
+
i.current && (i.current.div.replaceChildren(), i.current = void 0), n.current && (n.current.innerText = ""), i.current = new gr({
|
|
867
|
+
div: n.current,
|
|
868
|
+
accessibilityManager: void 0,
|
|
869
|
+
annotationCanvasMap: void 0,
|
|
870
|
+
annotationEditorUIManager: void 0,
|
|
871
|
+
structTreeLayer: null,
|
|
872
|
+
page: g.page,
|
|
873
|
+
viewport: v.clone({ dontFlip: !0 })
|
|
874
|
+
}), n.current && Wt(n.current, b);
|
|
875
|
+
const x = await (r == null ? void 0 : r.hasJSActions()), p = await (r == null ? void 0 : r.getFieldObjects());
|
|
876
|
+
if (m.signal.aborted)
|
|
877
|
+
throw "abort";
|
|
878
|
+
return (T = i.current) == null ? void 0 : T.render({
|
|
879
|
+
annotations: c,
|
|
880
|
+
annotationStorage: r == null ? void 0 : r.annotationStorage,
|
|
881
|
+
hasJSActions: x,
|
|
882
|
+
fieldObjects: p,
|
|
883
|
+
div: n.current,
|
|
884
|
+
viewport: v.clone({ dontFlip: !0 }),
|
|
885
|
+
page: g.page,
|
|
886
|
+
imageResourcesPath: Po,
|
|
887
|
+
renderForms: !0,
|
|
888
|
+
linkService: new Rr(),
|
|
889
|
+
downloadManager: null,
|
|
890
|
+
enableScripting: !1
|
|
891
|
+
});
|
|
892
|
+
})().then(() => {
|
|
893
|
+
n.current && zr(n.current, b);
|
|
894
|
+
}).catch((x) => {
|
|
895
|
+
if (x !== "abort")
|
|
896
|
+
throw x;
|
|
897
|
+
}), () => {
|
|
898
|
+
m.abort("clear"), n.current && Wt(n.current, b);
|
|
899
|
+
};
|
|
900
|
+
}, [r, c, b]), /* @__PURE__ */ a(
|
|
901
|
+
"div",
|
|
902
|
+
{
|
|
903
|
+
"data-rp": `page-${t}-annotationLayer`,
|
|
904
|
+
style: { width: `${w == null ? void 0 : w.width}px`, height: `${w == null ? void 0 : w.height}px` },
|
|
905
|
+
className: To["rp-annotation-layer"],
|
|
906
|
+
ref: n
|
|
907
|
+
}
|
|
908
|
+
);
|
|
909
|
+
}, ut = {
|
|
910
|
+
"rp-text-highlight-layer": "_rp-text-highlight-layer_1470i_1",
|
|
911
|
+
"rp-text-highlight-layer-text": "_rp-text-highlight-layer-text_1470i_9"
|
|
912
|
+
}, So = ({ pageNumber: e }) => {
|
|
913
|
+
const t = M(null), n = M(), o = M(), { pages: r } = K(), { highlightMatches: i } = vr(), c = F(() => i.filter((u) => u.pageIndex === e - 1), [i]), s = L(
|
|
914
|
+
(l, u, d = !1) => {
|
|
915
|
+
d && hn(l, u), pr(c, l, u);
|
|
916
|
+
},
|
|
917
|
+
[c, r, e]
|
|
918
|
+
);
|
|
919
|
+
return A(() => {
|
|
920
|
+
const l = r.get(e);
|
|
921
|
+
if (!l || !t.current)
|
|
922
|
+
return;
|
|
923
|
+
const u = t.current;
|
|
924
|
+
return n.current && n.current.cancel(), l.page.getTextContent().then((d) => {
|
|
925
|
+
const f = l.page.getViewport({ scale: 1 });
|
|
926
|
+
return n.current = new Pt.TextLayer({
|
|
927
|
+
viewport: f,
|
|
928
|
+
textContentSource: d,
|
|
929
|
+
container: u
|
|
930
|
+
}), o.current = d, u && (u.innerText = ""), n.current.render();
|
|
931
|
+
}).then(() => {
|
|
932
|
+
var h;
|
|
933
|
+
[].slice.call(u.children).forEach((g) => {
|
|
934
|
+
g.classList.add(ut["rp-text-highlight-layer-text"]);
|
|
935
|
+
});
|
|
936
|
+
const f = (h = n.current) == null ? void 0 : h.textDivs;
|
|
937
|
+
f && o.current && s(o.current, f);
|
|
938
|
+
}).catch(() => {
|
|
939
|
+
}), () => {
|
|
940
|
+
var d;
|
|
941
|
+
(d = n.current) == null || d.cancel();
|
|
942
|
+
};
|
|
943
|
+
}, [r, e]), A(() => {
|
|
944
|
+
var d;
|
|
945
|
+
[].slice.call(t.current.children).forEach((f) => {
|
|
946
|
+
f.classList.add(ut["rp-text-highlight-layer-text"]);
|
|
947
|
+
});
|
|
948
|
+
const u = (d = n.current) == null ? void 0 : d.textDivs;
|
|
949
|
+
u && o.current && s(o.current, u, !0);
|
|
950
|
+
}, [s]), /* @__PURE__ */ a(Se, { children: /* @__PURE__ */ a(
|
|
951
|
+
"div",
|
|
952
|
+
{
|
|
953
|
+
"data-rp": `page-${e}-textHighlightLayer`,
|
|
954
|
+
className: ut["rp-text-highlight-layer"],
|
|
955
|
+
ref: t
|
|
956
|
+
}
|
|
957
|
+
) });
|
|
958
|
+
}, Nt = We((e, t) => {
|
|
959
|
+
const { pageNumber: n, style: o, ...r } = e, { pages: i } = K(), { rotate: c } = Ye(), { textLayer: s } = sr(), { currentZoom: l } = Je(), u = M(i.get(n)), [d, f] = $(!1), h = M(null), [g, w] = $({
|
|
960
|
+
width: 0,
|
|
961
|
+
height: 0
|
|
962
|
+
});
|
|
963
|
+
ln(t, () => h.current), A(() => {
|
|
964
|
+
if (i && (u.current = i.get(n), u.current)) {
|
|
965
|
+
const m = u.current.page.getViewport({ scale: l, rotation: c });
|
|
966
|
+
w(m);
|
|
967
|
+
}
|
|
968
|
+
}, [i, n, c, l]);
|
|
969
|
+
const b = F(() => {
|
|
970
|
+
switch (c) {
|
|
971
|
+
case 90:
|
|
972
|
+
return `${g.width / 2}px ${g.width / 2}px`;
|
|
973
|
+
case -90:
|
|
974
|
+
case 270:
|
|
975
|
+
return `${g.height / 2}px ${g.height / 2}px`;
|
|
976
|
+
default:
|
|
977
|
+
return "center";
|
|
978
|
+
}
|
|
979
|
+
}, [c, g]), v = L(() => {
|
|
980
|
+
f(!0);
|
|
981
|
+
}, []), _ = L(() => {
|
|
982
|
+
f(!1);
|
|
983
|
+
}, []);
|
|
984
|
+
return /* @__PURE__ */ a(
|
|
985
|
+
"div",
|
|
986
|
+
{
|
|
987
|
+
ref: h,
|
|
988
|
+
id: `page-${n}`,
|
|
989
|
+
"data-rp": `page-${n}`,
|
|
990
|
+
...r,
|
|
991
|
+
style: {
|
|
992
|
+
...o,
|
|
993
|
+
"--rp-rotate": `${c}deg`,
|
|
994
|
+
"--rp-page-rotate-translate": `${b}`,
|
|
995
|
+
"--scale-factor": l
|
|
996
|
+
},
|
|
997
|
+
className: lt["rp-page-wrapper"],
|
|
998
|
+
children: /* @__PURE__ */ D(
|
|
999
|
+
"div",
|
|
1000
|
+
{
|
|
1001
|
+
style: {
|
|
1002
|
+
width: `${g.width}px`,
|
|
1003
|
+
height: `${g.height}px`
|
|
1004
|
+
},
|
|
1005
|
+
className: lt["rp-page"],
|
|
1006
|
+
children: [
|
|
1007
|
+
/* @__PURE__ */ a(bo, { onLoading: v, onLoaded: _, pageNumber: n }),
|
|
1008
|
+
d && /* @__PURE__ */ a("div", { className: lt["rp-loader-wrapper"], children: /* @__PURE__ */ a(St, {}) }),
|
|
1009
|
+
s && /* @__PURE__ */ a(Co, { pageNumber: n }),
|
|
1010
|
+
/* @__PURE__ */ a(So, { pageNumber: n }),
|
|
1011
|
+
/* @__PURE__ */ a(xo, { pageNumber: n })
|
|
1012
|
+
]
|
|
1013
|
+
}
|
|
1014
|
+
)
|
|
1015
|
+
}
|
|
1016
|
+
);
|
|
1017
|
+
});
|
|
1018
|
+
function qt(e) {
|
|
1019
|
+
if (e === void 0)
|
|
1020
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1021
|
+
return e;
|
|
1022
|
+
}
|
|
1023
|
+
function bt(e, t) {
|
|
1024
|
+
return bt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, o) {
|
|
1025
|
+
return n.__proto__ = o, n;
|
|
1026
|
+
}, bt(e, t);
|
|
1027
|
+
}
|
|
1028
|
+
function Io(e, t) {
|
|
1029
|
+
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, bt(e, t);
|
|
1030
|
+
}
|
|
1031
|
+
var Zt = Number.isNaN || function(t) {
|
|
1032
|
+
return typeof t == "number" && t !== t;
|
|
1033
|
+
};
|
|
1034
|
+
function yo(e, t) {
|
|
1035
|
+
return !!(e === t || Zt(e) && Zt(t));
|
|
1036
|
+
}
|
|
1037
|
+
function Lo(e, t) {
|
|
1038
|
+
if (e.length !== t.length)
|
|
1039
|
+
return !1;
|
|
1040
|
+
for (var n = 0; n < e.length; n++)
|
|
1041
|
+
if (!yo(e[n], t[n]))
|
|
1042
|
+
return !1;
|
|
1043
|
+
return !0;
|
|
1044
|
+
}
|
|
1045
|
+
function pt(e, t) {
|
|
1046
|
+
t === void 0 && (t = Lo);
|
|
1047
|
+
var n, o = [], r, i = !1;
|
|
1048
|
+
function c() {
|
|
1049
|
+
for (var s = [], l = 0; l < arguments.length; l++)
|
|
1050
|
+
s[l] = arguments[l];
|
|
1051
|
+
return i && n === this && t(s, o) || (r = e.apply(this, s), i = !0, n = this, o = s), r;
|
|
1052
|
+
}
|
|
1053
|
+
return c;
|
|
1054
|
+
}
|
|
1055
|
+
function Bt(e, t) {
|
|
1056
|
+
if (e == null)
|
|
1057
|
+
return {};
|
|
1058
|
+
var n = {};
|
|
1059
|
+
for (var o in e)
|
|
1060
|
+
if ({}.hasOwnProperty.call(e, o)) {
|
|
1061
|
+
if (t.indexOf(o) !== -1)
|
|
1062
|
+
continue;
|
|
1063
|
+
n[o] = e[o];
|
|
1064
|
+
}
|
|
1065
|
+
return n;
|
|
1066
|
+
}
|
|
1067
|
+
var Ro = typeof performance == "object" && typeof performance.now == "function", jt = Ro ? function() {
|
|
1068
|
+
return performance.now();
|
|
1069
|
+
} : function() {
|
|
1070
|
+
return Date.now();
|
|
1071
|
+
};
|
|
1072
|
+
function Kt(e) {
|
|
1073
|
+
cancelAnimationFrame(e.id);
|
|
1074
|
+
}
|
|
1075
|
+
function No(e, t) {
|
|
1076
|
+
var n = jt();
|
|
1077
|
+
function o() {
|
|
1078
|
+
jt() - n >= t ? e.call(null) : r.id = requestAnimationFrame(o);
|
|
1079
|
+
}
|
|
1080
|
+
var r = {
|
|
1081
|
+
id: requestAnimationFrame(o)
|
|
1082
|
+
};
|
|
1083
|
+
return r;
|
|
1084
|
+
}
|
|
1085
|
+
var ht = -1;
|
|
1086
|
+
function Eo(e) {
|
|
1087
|
+
if (e === void 0 && (e = !1), ht === -1 || e) {
|
|
1088
|
+
var t = document.createElement("div"), n = t.style;
|
|
1089
|
+
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), ht = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
1090
|
+
}
|
|
1091
|
+
return ht;
|
|
1092
|
+
}
|
|
1093
|
+
var Le = null;
|
|
1094
|
+
function Xt(e) {
|
|
1095
|
+
if (e === void 0 && (e = !1), Le === null || e) {
|
|
1096
|
+
var t = document.createElement("div"), n = t.style;
|
|
1097
|
+
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
1098
|
+
var o = document.createElement("div"), r = o.style;
|
|
1099
|
+
return r.width = "100px", r.height = "100px", t.appendChild(o), document.body.appendChild(t), t.scrollLeft > 0 ? Le = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? Le = "negative" : Le = "positive-ascending"), document.body.removeChild(t), Le;
|
|
1100
|
+
}
|
|
1101
|
+
return Le;
|
|
1102
|
+
}
|
|
1103
|
+
var Oo = 150, Do = function(t) {
|
|
1104
|
+
var n = t.columnIndex;
|
|
1105
|
+
t.data;
|
|
1106
|
+
var o = t.rowIndex;
|
|
1107
|
+
return o + ":" + n;
|
|
1108
|
+
}, Ve = null, Ue = null, qe = null;
|
|
1109
|
+
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Ve = /* @__PURE__ */ new WeakSet(), Ue = /* @__PURE__ */ new WeakSet(), qe = /* @__PURE__ */ new WeakSet());
|
|
1110
|
+
function zo(e) {
|
|
1111
|
+
var t, n = e.getColumnOffset, o = e.getColumnStartIndexForOffset, r = e.getColumnStopIndexForStartIndex, i = e.getColumnWidth, c = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, l = e.getOffsetForColumnAndAlignment, u = e.getOffsetForRowAndAlignment, d = e.getRowHeight, f = e.getRowOffset, h = e.getRowStartIndexForOffset, g = e.getRowStopIndexForStartIndex, w = e.initInstanceProps, b = e.shouldResetStyleCacheOnItemSizeChange, v = e.validateProps;
|
|
1112
|
+
return t = /* @__PURE__ */ function(_) {
|
|
1113
|
+
Io(m, _);
|
|
1114
|
+
function m(x) {
|
|
1115
|
+
var p;
|
|
1116
|
+
return p = _.call(this, x) || this, p._instanceProps = w(p.props, qt(p)), p._resetIsScrollingTimeoutId = null, p._outerRef = void 0, p.state = {
|
|
1117
|
+
instance: qt(p),
|
|
1118
|
+
isScrolling: !1,
|
|
1119
|
+
horizontalScrollDirection: "forward",
|
|
1120
|
+
scrollLeft: typeof p.props.initialScrollLeft == "number" ? p.props.initialScrollLeft : 0,
|
|
1121
|
+
scrollTop: typeof p.props.initialScrollTop == "number" ? p.props.initialScrollTop : 0,
|
|
1122
|
+
scrollUpdateWasRequested: !1,
|
|
1123
|
+
verticalScrollDirection: "forward"
|
|
1124
|
+
}, p._callOnItemsRendered = void 0, p._callOnItemsRendered = pt(function(T, C, S, N, y, O, R, k) {
|
|
1125
|
+
return p.props.onItemsRendered({
|
|
1126
|
+
overscanColumnStartIndex: T,
|
|
1127
|
+
overscanColumnStopIndex: C,
|
|
1128
|
+
overscanRowStartIndex: S,
|
|
1129
|
+
overscanRowStopIndex: N,
|
|
1130
|
+
visibleColumnStartIndex: y,
|
|
1131
|
+
visibleColumnStopIndex: O,
|
|
1132
|
+
visibleRowStartIndex: R,
|
|
1133
|
+
visibleRowStopIndex: k
|
|
1134
|
+
});
|
|
1135
|
+
}), p._callOnScroll = void 0, p._callOnScroll = pt(function(T, C, S, N, y) {
|
|
1136
|
+
return p.props.onScroll({
|
|
1137
|
+
horizontalScrollDirection: S,
|
|
1138
|
+
scrollLeft: T,
|
|
1139
|
+
scrollTop: C,
|
|
1140
|
+
verticalScrollDirection: N,
|
|
1141
|
+
scrollUpdateWasRequested: y
|
|
1142
|
+
});
|
|
1143
|
+
}), p._getItemStyle = void 0, p._getItemStyle = function(T, C) {
|
|
1144
|
+
var S = p.props, N = S.columnWidth, y = S.direction, O = S.rowHeight, R = p._getItemStyleCache(b && N, b && y, b && O), k = T + ":" + C, z;
|
|
1145
|
+
if (R.hasOwnProperty(k))
|
|
1146
|
+
z = R[k];
|
|
1147
|
+
else {
|
|
1148
|
+
var I = n(p.props, C, p._instanceProps), E = y === "rtl";
|
|
1149
|
+
R[k] = z = {
|
|
1150
|
+
position: "absolute",
|
|
1151
|
+
left: E ? void 0 : I,
|
|
1152
|
+
right: E ? I : void 0,
|
|
1153
|
+
top: f(p.props, T, p._instanceProps),
|
|
1154
|
+
height: d(p.props, T, p._instanceProps),
|
|
1155
|
+
width: i(p.props, C, p._instanceProps)
|
|
1156
|
+
};
|
|
1157
|
+
}
|
|
1158
|
+
return z;
|
|
1159
|
+
}, p._getItemStyleCache = void 0, p._getItemStyleCache = pt(function(T, C, S) {
|
|
1160
|
+
return {};
|
|
1161
|
+
}), p._onScroll = function(T) {
|
|
1162
|
+
var C = T.currentTarget, S = C.clientHeight, N = C.clientWidth, y = C.scrollLeft, O = C.scrollTop, R = C.scrollHeight, k = C.scrollWidth;
|
|
1163
|
+
p.setState(function(z) {
|
|
1164
|
+
if (z.scrollLeft === y && z.scrollTop === O)
|
|
1165
|
+
return null;
|
|
1166
|
+
var I = p.props.direction, E = y;
|
|
1167
|
+
if (I === "rtl")
|
|
1168
|
+
switch (Xt()) {
|
|
1169
|
+
case "negative":
|
|
1170
|
+
E = -y;
|
|
1171
|
+
break;
|
|
1172
|
+
case "positive-descending":
|
|
1173
|
+
E = k - N - y;
|
|
1174
|
+
break;
|
|
1175
|
+
}
|
|
1176
|
+
E = Math.max(0, Math.min(E, k - N));
|
|
1177
|
+
var W = Math.max(0, Math.min(O, R - S));
|
|
1178
|
+
return {
|
|
1179
|
+
isScrolling: !0,
|
|
1180
|
+
horizontalScrollDirection: z.scrollLeft < y ? "forward" : "backward",
|
|
1181
|
+
scrollLeft: E,
|
|
1182
|
+
scrollTop: W,
|
|
1183
|
+
verticalScrollDirection: z.scrollTop < O ? "forward" : "backward",
|
|
1184
|
+
scrollUpdateWasRequested: !1
|
|
1185
|
+
};
|
|
1186
|
+
}, p._resetIsScrollingDebounced);
|
|
1187
|
+
}, p._outerRefSetter = function(T) {
|
|
1188
|
+
var C = p.props.outerRef;
|
|
1189
|
+
p._outerRef = T, typeof C == "function" ? C(T) : C != null && typeof C == "object" && C.hasOwnProperty("current") && (C.current = T);
|
|
1190
|
+
}, p._resetIsScrollingDebounced = function() {
|
|
1191
|
+
p._resetIsScrollingTimeoutId !== null && Kt(p._resetIsScrollingTimeoutId), p._resetIsScrollingTimeoutId = No(p._resetIsScrolling, Oo);
|
|
1192
|
+
}, p._resetIsScrolling = function() {
|
|
1193
|
+
p._resetIsScrollingTimeoutId = null, p.setState({
|
|
1194
|
+
isScrolling: !1
|
|
1195
|
+
}, function() {
|
|
1196
|
+
p._getItemStyleCache(-1);
|
|
1197
|
+
});
|
|
1198
|
+
}, p;
|
|
1199
|
+
}
|
|
1200
|
+
m.getDerivedStateFromProps = function(p, T) {
|
|
1201
|
+
return Ao(p, T), v(p), null;
|
|
1202
|
+
};
|
|
1203
|
+
var P = m.prototype;
|
|
1204
|
+
return P.scrollTo = function(p) {
|
|
1205
|
+
var T = p.scrollLeft, C = p.scrollTop;
|
|
1206
|
+
T !== void 0 && (T = Math.max(0, T)), C !== void 0 && (C = Math.max(0, C)), this.setState(function(S) {
|
|
1207
|
+
return T === void 0 && (T = S.scrollLeft), C === void 0 && (C = S.scrollTop), S.scrollLeft === T && S.scrollTop === C ? null : {
|
|
1208
|
+
horizontalScrollDirection: S.scrollLeft < T ? "forward" : "backward",
|
|
1209
|
+
scrollLeft: T,
|
|
1210
|
+
scrollTop: C,
|
|
1211
|
+
scrollUpdateWasRequested: !0,
|
|
1212
|
+
verticalScrollDirection: S.scrollTop < C ? "forward" : "backward"
|
|
1213
|
+
};
|
|
1214
|
+
}, this._resetIsScrollingDebounced);
|
|
1215
|
+
}, P.scrollToItem = function(p) {
|
|
1216
|
+
var T = p.align, C = T === void 0 ? "auto" : T, S = p.columnIndex, N = p.rowIndex, y = this.props, O = y.columnCount, R = y.height, k = y.rowCount, z = y.width, I = this.state, E = I.scrollLeft, W = I.scrollTop, V = Eo();
|
|
1217
|
+
S !== void 0 && (S = Math.max(0, Math.min(S, O - 1))), N !== void 0 && (N = Math.max(0, Math.min(N, k - 1)));
|
|
1218
|
+
var Z = c(this.props, this._instanceProps), Y = s(this.props, this._instanceProps), j = Y > z ? V : 0, B = Z > R ? V : 0;
|
|
1219
|
+
this.scrollTo({
|
|
1220
|
+
scrollLeft: S !== void 0 ? l(this.props, S, C, E, this._instanceProps, B) : E,
|
|
1221
|
+
scrollTop: N !== void 0 ? u(this.props, N, C, W, this._instanceProps, j) : W
|
|
1222
|
+
});
|
|
1223
|
+
}, P.componentDidMount = function() {
|
|
1224
|
+
var p = this.props, T = p.initialScrollLeft, C = p.initialScrollTop;
|
|
1225
|
+
if (this._outerRef != null) {
|
|
1226
|
+
var S = this._outerRef;
|
|
1227
|
+
typeof T == "number" && (S.scrollLeft = T), typeof C == "number" && (S.scrollTop = C);
|
|
1228
|
+
}
|
|
1229
|
+
this._callPropsCallbacks();
|
|
1230
|
+
}, P.componentDidUpdate = function() {
|
|
1231
|
+
var p = this.props.direction, T = this.state, C = T.scrollLeft, S = T.scrollTop, N = T.scrollUpdateWasRequested;
|
|
1232
|
+
if (N && this._outerRef != null) {
|
|
1233
|
+
var y = this._outerRef;
|
|
1234
|
+
if (p === "rtl")
|
|
1235
|
+
switch (Xt()) {
|
|
1236
|
+
case "negative":
|
|
1237
|
+
y.scrollLeft = -C;
|
|
1238
|
+
break;
|
|
1239
|
+
case "positive-ascending":
|
|
1240
|
+
y.scrollLeft = C;
|
|
1241
|
+
break;
|
|
1242
|
+
default:
|
|
1243
|
+
var O = y.clientWidth, R = y.scrollWidth;
|
|
1244
|
+
y.scrollLeft = R - O - C;
|
|
1245
|
+
break;
|
|
1246
|
+
}
|
|
1247
|
+
else
|
|
1248
|
+
y.scrollLeft = Math.max(0, C);
|
|
1249
|
+
y.scrollTop = Math.max(0, S);
|
|
1250
|
+
}
|
|
1251
|
+
this._callPropsCallbacks();
|
|
1252
|
+
}, P.componentWillUnmount = function() {
|
|
1253
|
+
this._resetIsScrollingTimeoutId !== null && Kt(this._resetIsScrollingTimeoutId);
|
|
1254
|
+
}, P.render = function() {
|
|
1255
|
+
var p = this.props, T = p.children, C = p.className, S = p.columnCount, N = p.direction, y = p.height, O = p.innerRef, R = p.innerElementType, k = p.innerTagName, z = p.itemData, I = p.itemKey, E = I === void 0 ? Do : I, W = p.outerElementType, V = p.outerTagName, Z = p.rowCount, Y = p.style, j = p.useIsScrolling, B = p.width, te = this.state.isScrolling, ae = this._getHorizontalRangeToRender(), J = ae[0], ne = ae[1], he = this._getVerticalRangeToRender(), ce = he[0], Oe = he[1], we = [];
|
|
1256
|
+
if (S > 0 && Z)
|
|
1257
|
+
for (var me = ce; me <= Oe; me++)
|
|
1258
|
+
for (var le = J; le <= ne; le++)
|
|
1259
|
+
we.push(Ge(T, {
|
|
1260
|
+
columnIndex: le,
|
|
1261
|
+
data: z,
|
|
1262
|
+
isScrolling: j ? te : void 0,
|
|
1263
|
+
key: E({
|
|
1264
|
+
columnIndex: le,
|
|
1265
|
+
data: z,
|
|
1266
|
+
rowIndex: me
|
|
1267
|
+
}),
|
|
1268
|
+
rowIndex: me,
|
|
1269
|
+
style: this._getItemStyle(me, le)
|
|
1270
|
+
}));
|
|
1271
|
+
var De = c(this.props, this._instanceProps), rt = s(this.props, this._instanceProps);
|
|
1272
|
+
return Ge(W || V || "div", {
|
|
1273
|
+
className: C,
|
|
1274
|
+
onScroll: this._onScroll,
|
|
1275
|
+
ref: this._outerRefSetter,
|
|
1276
|
+
style: Ar({
|
|
1277
|
+
position: "relative",
|
|
1278
|
+
height: y,
|
|
1279
|
+
width: B,
|
|
1280
|
+
overflow: "auto",
|
|
1281
|
+
WebkitOverflowScrolling: "touch",
|
|
1282
|
+
willChange: "transform",
|
|
1283
|
+
direction: N
|
|
1284
|
+
}, Y)
|
|
1285
|
+
}, Ge(R || k || "div", {
|
|
1286
|
+
children: we,
|
|
1287
|
+
ref: O,
|
|
1288
|
+
style: {
|
|
1289
|
+
height: De,
|
|
1290
|
+
pointerEvents: te ? "none" : void 0,
|
|
1291
|
+
width: rt
|
|
1292
|
+
}
|
|
1293
|
+
}));
|
|
1294
|
+
}, P._callPropsCallbacks = function() {
|
|
1295
|
+
var p = this.props, T = p.columnCount, C = p.onItemsRendered, S = p.onScroll, N = p.rowCount;
|
|
1296
|
+
if (typeof C == "function" && T > 0 && N > 0) {
|
|
1297
|
+
var y = this._getHorizontalRangeToRender(), O = y[0], R = y[1], k = y[2], z = y[3], I = this._getVerticalRangeToRender(), E = I[0], W = I[1], V = I[2], Z = I[3];
|
|
1298
|
+
this._callOnItemsRendered(O, R, E, W, k, z, V, Z);
|
|
1299
|
+
}
|
|
1300
|
+
if (typeof S == "function") {
|
|
1301
|
+
var Y = this.state, j = Y.horizontalScrollDirection, B = Y.scrollLeft, te = Y.scrollTop, ae = Y.scrollUpdateWasRequested, J = Y.verticalScrollDirection;
|
|
1302
|
+
this._callOnScroll(B, te, j, J, ae);
|
|
1303
|
+
}
|
|
1304
|
+
}, P._getHorizontalRangeToRender = function() {
|
|
1305
|
+
var p = this.props, T = p.columnCount, C = p.overscanColumnCount, S = p.overscanColumnsCount, N = p.overscanCount, y = p.rowCount, O = this.state, R = O.horizontalScrollDirection, k = O.isScrolling, z = O.scrollLeft, I = C || S || N || 1;
|
|
1306
|
+
if (T === 0 || y === 0)
|
|
1307
|
+
return [0, 0, 0, 0];
|
|
1308
|
+
var E = o(this.props, z, this._instanceProps), W = r(this.props, E, z, this._instanceProps), V = !k || R === "backward" ? Math.max(1, I) : 1, Z = !k || R === "forward" ? Math.max(1, I) : 1;
|
|
1309
|
+
return [Math.max(0, E - V), Math.max(0, Math.min(T - 1, W + Z)), E, W];
|
|
1310
|
+
}, P._getVerticalRangeToRender = function() {
|
|
1311
|
+
var p = this.props, T = p.columnCount, C = p.overscanCount, S = p.overscanRowCount, N = p.overscanRowsCount, y = p.rowCount, O = this.state, R = O.isScrolling, k = O.verticalScrollDirection, z = O.scrollTop, I = S || N || C || 1;
|
|
1312
|
+
if (T === 0 || y === 0)
|
|
1313
|
+
return [0, 0, 0, 0];
|
|
1314
|
+
var E = h(this.props, z, this._instanceProps), W = g(this.props, E, z, this._instanceProps), V = !R || k === "backward" ? Math.max(1, I) : 1, Z = !R || k === "forward" ? Math.max(1, I) : 1;
|
|
1315
|
+
return [Math.max(0, E - V), Math.max(0, Math.min(y - 1, W + Z)), E, W];
|
|
1316
|
+
}, m;
|
|
1317
|
+
}(nr), t.defaultProps = {
|
|
1318
|
+
direction: "ltr",
|
|
1319
|
+
itemData: void 0,
|
|
1320
|
+
useIsScrolling: !1
|
|
1321
|
+
}, t;
|
|
1322
|
+
}
|
|
1323
|
+
var Ao = function(t, n) {
|
|
1324
|
+
var o = t.children, r = t.direction, i = t.height, c = t.innerTagName, s = t.outerTagName, l = t.overscanColumnsCount, u = t.overscanCount, d = t.overscanRowsCount, f = t.width, h = n.instance;
|
|
1325
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1326
|
+
if (typeof u == "number" && Ve && !Ve.has(h) && (Ve.add(h), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof l == "number" || typeof d == "number") && Ue && !Ue.has(h) && (Ue.add(h), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (c != null || s != null) && qe && !qe.has(h) && (qe.add(h), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), o == null)
|
|
1327
|
+
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
1328
|
+
switch (r) {
|
|
1329
|
+
case "ltr":
|
|
1330
|
+
case "rtl":
|
|
1331
|
+
break;
|
|
1332
|
+
default:
|
|
1333
|
+
throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + r + '" was specified.'));
|
|
1334
|
+
}
|
|
1335
|
+
if (typeof f != "number")
|
|
1336
|
+
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (f === null ? "null" : typeof f) + '" was specified.'));
|
|
1337
|
+
if (typeof i != "number")
|
|
1338
|
+
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (i === null ? "null" : typeof i) + '" was specified.'));
|
|
1339
|
+
}
|
|
1340
|
+
}, Yt = 50, yn = function(t, n) {
|
|
1341
|
+
var o = t.rowCount, r = n.rowMetadataMap, i = n.estimatedRowHeight, c = n.lastMeasuredRowIndex, s = 0;
|
|
1342
|
+
if (c >= o && (c = o - 1), c >= 0) {
|
|
1343
|
+
var l = r[c];
|
|
1344
|
+
s = l.offset + l.size;
|
|
1345
|
+
}
|
|
1346
|
+
var u = o - c - 1, d = u * i;
|
|
1347
|
+
return s + d;
|
|
1348
|
+
}, Ln = function(t, n) {
|
|
1349
|
+
var o = t.columnCount, r = n.columnMetadataMap, i = n.estimatedColumnWidth, c = n.lastMeasuredColumnIndex, s = 0;
|
|
1350
|
+
if (c >= o && (c = o - 1), c >= 0) {
|
|
1351
|
+
var l = r[c];
|
|
1352
|
+
s = l.offset + l.size;
|
|
1353
|
+
}
|
|
1354
|
+
var u = o - c - 1, d = u * i;
|
|
1355
|
+
return s + d;
|
|
1356
|
+
}, ve = function(t, n, o, r) {
|
|
1357
|
+
var i, c, s;
|
|
1358
|
+
if (t === "column" ? (i = r.columnMetadataMap, c = n.columnWidth, s = r.lastMeasuredColumnIndex) : (i = r.rowMetadataMap, c = n.rowHeight, s = r.lastMeasuredRowIndex), o > s) {
|
|
1359
|
+
var l = 0;
|
|
1360
|
+
if (s >= 0) {
|
|
1361
|
+
var u = i[s];
|
|
1362
|
+
l = u.offset + u.size;
|
|
1363
|
+
}
|
|
1364
|
+
for (var d = s + 1; d <= o; d++) {
|
|
1365
|
+
var f = c(d);
|
|
1366
|
+
i[d] = {
|
|
1367
|
+
offset: l,
|
|
1368
|
+
size: f
|
|
1369
|
+
}, l += f;
|
|
1370
|
+
}
|
|
1371
|
+
t === "column" ? r.lastMeasuredColumnIndex = o : r.lastMeasuredRowIndex = o;
|
|
1372
|
+
}
|
|
1373
|
+
return i[o];
|
|
1374
|
+
}, Jt = function(t, n, o, r) {
|
|
1375
|
+
var i, c;
|
|
1376
|
+
t === "column" ? (i = o.columnMetadataMap, c = o.lastMeasuredColumnIndex) : (i = o.rowMetadataMap, c = o.lastMeasuredRowIndex);
|
|
1377
|
+
var s = c > 0 ? i[c].offset : 0;
|
|
1378
|
+
return s >= r ? Rn(t, n, o, c, 0, r) : Fo(t, n, o, Math.max(0, c), r);
|
|
1379
|
+
}, Rn = function(t, n, o, r, i, c) {
|
|
1380
|
+
for (; i <= r; ) {
|
|
1381
|
+
var s = i + Math.floor((r - i) / 2), l = ve(t, n, s, o).offset;
|
|
1382
|
+
if (l === c)
|
|
1383
|
+
return s;
|
|
1384
|
+
l < c ? i = s + 1 : l > c && (r = s - 1);
|
|
1385
|
+
}
|
|
1386
|
+
return i > 0 ? i - 1 : 0;
|
|
1387
|
+
}, Fo = function(t, n, o, r, i) {
|
|
1388
|
+
for (var c = t === "column" ? n.columnCount : n.rowCount, s = 1; r < c && ve(t, n, r, o).offset < i; )
|
|
1389
|
+
r += s, s *= 2;
|
|
1390
|
+
return Rn(t, n, o, Math.min(r, c - 1), Math.floor(r / 2), i);
|
|
1391
|
+
}, Qt = function(t, n, o, r, i, c, s) {
|
|
1392
|
+
var l = t === "column" ? n.width : n.height, u = ve(t, n, o, c), d = t === "column" ? Ln(n, c) : yn(n, c), f = Math.max(0, Math.min(d - l, u.offset)), h = Math.max(0, u.offset - l + s + u.size);
|
|
1393
|
+
switch (r === "smart" && (i >= h - l && i <= f + l ? r = "auto" : r = "center"), r) {
|
|
1394
|
+
case "start":
|
|
1395
|
+
return f;
|
|
1396
|
+
case "end":
|
|
1397
|
+
return h;
|
|
1398
|
+
case "center":
|
|
1399
|
+
return Math.round(h + (f - h) / 2);
|
|
1400
|
+
case "auto":
|
|
1401
|
+
default:
|
|
1402
|
+
return i >= h && i <= f ? i : h > f || i < h ? h : f;
|
|
1403
|
+
}
|
|
1404
|
+
}, ko = /* @__PURE__ */ zo({
|
|
1405
|
+
getColumnOffset: function(t, n, o) {
|
|
1406
|
+
return ve("column", t, n, o).offset;
|
|
1407
|
+
},
|
|
1408
|
+
getColumnStartIndexForOffset: function(t, n, o) {
|
|
1409
|
+
return Jt("column", t, o, n);
|
|
1410
|
+
},
|
|
1411
|
+
getColumnStopIndexForStartIndex: function(t, n, o, r) {
|
|
1412
|
+
for (var i = t.columnCount, c = t.width, s = ve("column", t, n, r), l = o + c, u = s.offset + s.size, d = n; d < i - 1 && u < l; )
|
|
1413
|
+
d++, u += ve("column", t, d, r).size;
|
|
1414
|
+
return d;
|
|
1415
|
+
},
|
|
1416
|
+
getColumnWidth: function(t, n, o) {
|
|
1417
|
+
return o.columnMetadataMap[n].size;
|
|
1418
|
+
},
|
|
1419
|
+
getEstimatedTotalHeight: yn,
|
|
1420
|
+
getEstimatedTotalWidth: Ln,
|
|
1421
|
+
getOffsetForColumnAndAlignment: function(t, n, o, r, i, c) {
|
|
1422
|
+
return Qt("column", t, n, o, r, i, c);
|
|
1423
|
+
},
|
|
1424
|
+
getOffsetForRowAndAlignment: function(t, n, o, r, i, c) {
|
|
1425
|
+
return Qt("row", t, n, o, r, i, c);
|
|
1426
|
+
},
|
|
1427
|
+
getRowOffset: function(t, n, o) {
|
|
1428
|
+
return ve("row", t, n, o).offset;
|
|
1429
|
+
},
|
|
1430
|
+
getRowHeight: function(t, n, o) {
|
|
1431
|
+
return o.rowMetadataMap[n].size;
|
|
1432
|
+
},
|
|
1433
|
+
getRowStartIndexForOffset: function(t, n, o) {
|
|
1434
|
+
return Jt("row", t, o, n);
|
|
1435
|
+
},
|
|
1436
|
+
getRowStopIndexForStartIndex: function(t, n, o, r) {
|
|
1437
|
+
for (var i = t.rowCount, c = t.height, s = ve("row", t, n, r), l = o + c, u = s.offset + s.size, d = n; d < i - 1 && u < l; )
|
|
1438
|
+
d++, u += ve("row", t, d, r).size;
|
|
1439
|
+
return d;
|
|
1440
|
+
},
|
|
1441
|
+
initInstanceProps: function(t, n) {
|
|
1442
|
+
var o = t, r = o.estimatedColumnWidth, i = o.estimatedRowHeight, c = {
|
|
1443
|
+
columnMetadataMap: {},
|
|
1444
|
+
estimatedColumnWidth: r || Yt,
|
|
1445
|
+
estimatedRowHeight: i || Yt,
|
|
1446
|
+
lastMeasuredColumnIndex: -1,
|
|
1447
|
+
lastMeasuredRowIndex: -1,
|
|
1448
|
+
rowMetadataMap: {}
|
|
1449
|
+
};
|
|
1450
|
+
return n.resetAfterColumnIndex = function(s, l) {
|
|
1451
|
+
l === void 0 && (l = !0), n.resetAfterIndices({
|
|
1452
|
+
columnIndex: s,
|
|
1453
|
+
shouldForceUpdate: l
|
|
1454
|
+
});
|
|
1455
|
+
}, n.resetAfterRowIndex = function(s, l) {
|
|
1456
|
+
l === void 0 && (l = !0), n.resetAfterIndices({
|
|
1457
|
+
rowIndex: s,
|
|
1458
|
+
shouldForceUpdate: l
|
|
1459
|
+
});
|
|
1460
|
+
}, n.resetAfterIndices = function(s) {
|
|
1461
|
+
var l = s.columnIndex, u = s.rowIndex, d = s.shouldForceUpdate, f = d === void 0 ? !0 : d;
|
|
1462
|
+
typeof l == "number" && (c.lastMeasuredColumnIndex = Math.min(c.lastMeasuredColumnIndex, l - 1)), typeof u == "number" && (c.lastMeasuredRowIndex = Math.min(c.lastMeasuredRowIndex, u - 1)), n._getItemStyleCache(-1), f && n.forceUpdate();
|
|
1463
|
+
}, c;
|
|
1464
|
+
},
|
|
1465
|
+
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
1466
|
+
validateProps: function(t) {
|
|
1467
|
+
var n = t.columnWidth, o = t.rowHeight;
|
|
1468
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1469
|
+
if (typeof n != "function")
|
|
1470
|
+
throw Error('An invalid "columnWidth" prop has been specified. Value should be a function. ' + ('"' + (n === null ? "null" : typeof n) + '" was specified.'));
|
|
1471
|
+
if (typeof o != "function")
|
|
1472
|
+
throw Error('An invalid "rowHeight" prop has been specified. Value should be a function. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
});
|
|
1476
|
+
process.env.NODE_ENV;
|
|
1477
|
+
function en(e, t) {
|
|
1478
|
+
for (var n in e)
|
|
1479
|
+
if (!(n in t))
|
|
1480
|
+
return !0;
|
|
1481
|
+
for (var o in t)
|
|
1482
|
+
if (e[o] !== t[o])
|
|
1483
|
+
return !0;
|
|
1484
|
+
return !1;
|
|
1485
|
+
}
|
|
1486
|
+
var Mo = ["style"], Wo = ["style"];
|
|
1487
|
+
function Ho(e, t) {
|
|
1488
|
+
var n = e.style, o = Bt(e, Mo), r = t.style, i = Bt(t, Wo);
|
|
1489
|
+
return !en(n, r) && !en(o, i);
|
|
1490
|
+
}
|
|
1491
|
+
const $o = () => {
|
|
1492
|
+
const { viewMode: e } = Qe(), { scrollMode: t } = Ee(), { setColumnCount: n } = un(), { virtualScrollableElementRef: o } = et(), r = tt(), i = L(
|
|
1493
|
+
(g) => r.widths[g] || 0,
|
|
1494
|
+
[r.widths]
|
|
1495
|
+
), c = L(
|
|
1496
|
+
(g) => r.heights[g] || 0,
|
|
1497
|
+
[r.heights]
|
|
1498
|
+
), s = F(() => r.heights.length, [r.heights]), l = F(() => Math.max(...r.widths), [r.widths]), u = F(() => t === X.HORIZONTAL_SCROLLING ? s : e === Ze.DUAL_PAGE ? 2 : 1, [e, t, t, s, o, l]);
|
|
1499
|
+
A(() => {
|
|
1500
|
+
n(u);
|
|
1501
|
+
}, [u, n]);
|
|
1502
|
+
const d = F(() => t === X.HORIZONTAL_SCROLLING || t === X.PAGE_SCROLLING ? 1 : Math.round(s / u), [u, s, t]), f = F(() => r.heights.reduce((g, w) => g + w, 0) / r.heights.length || 0, [r]), h = F(() => r.widths.reduce((g, w) => g + w, 0) / r.heights.length || 0, [r]);
|
|
1503
|
+
return {
|
|
1504
|
+
rowCount: d,
|
|
1505
|
+
rowHeight: c,
|
|
1506
|
+
columnCount: u,
|
|
1507
|
+
columnWidth: i,
|
|
1508
|
+
pageDimension: r,
|
|
1509
|
+
estimatedRowHeight: f,
|
|
1510
|
+
estimatedColumnWidth: h
|
|
1511
|
+
};
|
|
1512
|
+
};
|
|
1513
|
+
let oe;
|
|
1514
|
+
typeof window < "u" ? oe = window : typeof self < "u" ? oe = self : oe = global;
|
|
1515
|
+
let Ct = null, Tt = null;
|
|
1516
|
+
const tn = 20, mt = oe.clearTimeout, nn = oe.setTimeout, ft = oe.cancelAnimationFrame || oe.mozCancelAnimationFrame || oe.webkitCancelAnimationFrame, rn = oe.requestAnimationFrame || oe.mozRequestAnimationFrame || oe.webkitRequestAnimationFrame;
|
|
1517
|
+
ft == null || rn == null ? (Ct = mt, Tt = function(t) {
|
|
1518
|
+
return nn(t, tn);
|
|
1519
|
+
}) : (Ct = function([t, n]) {
|
|
1520
|
+
ft(t), mt(n);
|
|
1521
|
+
}, Tt = function(t) {
|
|
1522
|
+
const n = rn(function() {
|
|
1523
|
+
mt(o), t();
|
|
1524
|
+
}), o = nn(function() {
|
|
1525
|
+
ft(n), t();
|
|
1526
|
+
}, tn);
|
|
1527
|
+
return [n, o];
|
|
1528
|
+
});
|
|
1529
|
+
function Go(e) {
|
|
1530
|
+
let t, n, o, r, i, c, s;
|
|
1531
|
+
const l = typeof document < "u" && document.attachEvent;
|
|
1532
|
+
if (!l) {
|
|
1533
|
+
c = function(_) {
|
|
1534
|
+
const m = _.__resizeTriggers__, P = m.firstElementChild, x = m.lastElementChild, p = P.firstElementChild;
|
|
1535
|
+
x.scrollLeft = x.scrollWidth, x.scrollTop = x.scrollHeight, p.style.width = P.offsetWidth + 1 + "px", p.style.height = P.offsetHeight + 1 + "px", P.scrollLeft = P.scrollWidth, P.scrollTop = P.scrollHeight;
|
|
1536
|
+
}, i = function(_) {
|
|
1537
|
+
return _.offsetWidth !== _.__resizeLast__.width || _.offsetHeight !== _.__resizeLast__.height;
|
|
1538
|
+
}, s = function(_) {
|
|
1539
|
+
if (_.target.className && typeof _.target.className.indexOf == "function" && _.target.className.indexOf("contract-trigger") < 0 && _.target.className.indexOf("expand-trigger") < 0)
|
|
1540
|
+
return;
|
|
1541
|
+
const m = this;
|
|
1542
|
+
c(this), this.__resizeRAF__ && Ct(this.__resizeRAF__), this.__resizeRAF__ = Tt(function() {
|
|
1543
|
+
i(m) && (m.__resizeLast__.width = m.offsetWidth, m.__resizeLast__.height = m.offsetHeight, m.__resizeListeners__.forEach(function(p) {
|
|
1544
|
+
p.call(m, _);
|
|
1545
|
+
}));
|
|
1546
|
+
});
|
|
1547
|
+
};
|
|
1548
|
+
let h = !1, g = "";
|
|
1549
|
+
o = "animationstart";
|
|
1550
|
+
const w = "Webkit Moz O ms".split(" ");
|
|
1551
|
+
let b = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), v = "";
|
|
1552
|
+
{
|
|
1553
|
+
const _ = document.createElement("fakeelement");
|
|
1554
|
+
if (_.style.animationName !== void 0 && (h = !0), h === !1) {
|
|
1555
|
+
for (let m = 0; m < w.length; m++)
|
|
1556
|
+
if (_.style[w[m] + "AnimationName"] !== void 0) {
|
|
1557
|
+
v = w[m], g = "-" + v.toLowerCase() + "-", o = b[m], h = !0;
|
|
1558
|
+
break;
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
n = "resizeanim", t = "@" + g + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", r = g + "animation: 1ms " + n + "; ";
|
|
1563
|
+
}
|
|
1564
|
+
const u = function(h) {
|
|
1565
|
+
if (!h.getElementById("detectElementResize")) {
|
|
1566
|
+
const g = (t || "") + ".resize-triggers { " + (r || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', w = h.head || h.getElementsByTagName("head")[0], b = h.createElement("style");
|
|
1567
|
+
b.id = "detectElementResize", b.type = "text/css", e != null && b.setAttribute("nonce", e), b.styleSheet ? b.styleSheet.cssText = g : b.appendChild(h.createTextNode(g)), w.appendChild(b);
|
|
1568
|
+
}
|
|
1569
|
+
};
|
|
1570
|
+
return {
|
|
1571
|
+
addResizeListener: function(h, g) {
|
|
1572
|
+
if (l)
|
|
1573
|
+
h.attachEvent("onresize", g);
|
|
1574
|
+
else {
|
|
1575
|
+
if (!h.__resizeTriggers__) {
|
|
1576
|
+
const w = h.ownerDocument, b = oe.getComputedStyle(h);
|
|
1577
|
+
b && b.position === "static" && (h.style.position = "relative"), u(w), h.__resizeLast__ = {}, h.__resizeListeners__ = [], (h.__resizeTriggers__ = w.createElement("div")).className = "resize-triggers";
|
|
1578
|
+
const v = w.createElement("div");
|
|
1579
|
+
v.className = "expand-trigger", v.appendChild(w.createElement("div"));
|
|
1580
|
+
const _ = w.createElement("div");
|
|
1581
|
+
_.className = "contract-trigger", h.__resizeTriggers__.appendChild(v), h.__resizeTriggers__.appendChild(_), h.appendChild(h.__resizeTriggers__), c(h), h.addEventListener("scroll", s, !0), o && (h.__resizeTriggers__.__animationListener__ = function(P) {
|
|
1582
|
+
P.animationName === n && c(h);
|
|
1583
|
+
}, h.__resizeTriggers__.addEventListener(o, h.__resizeTriggers__.__animationListener__));
|
|
1584
|
+
}
|
|
1585
|
+
h.__resizeListeners__.push(g);
|
|
1586
|
+
}
|
|
1587
|
+
},
|
|
1588
|
+
removeResizeListener: function(h, g) {
|
|
1589
|
+
if (l)
|
|
1590
|
+
h.detachEvent("onresize", g);
|
|
1591
|
+
else if (h.__resizeListeners__.splice(h.__resizeListeners__.indexOf(g), 1), !h.__resizeListeners__.length) {
|
|
1592
|
+
h.removeEventListener("scroll", s, !0), h.__resizeTriggers__.__animationListener__ && (h.__resizeTriggers__.removeEventListener(o, h.__resizeTriggers__.__animationListener__), h.__resizeTriggers__.__animationListener__ = null);
|
|
1593
|
+
try {
|
|
1594
|
+
h.__resizeTriggers__ = !h.removeChild(h.__resizeTriggers__);
|
|
1595
|
+
} catch {
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
};
|
|
1600
|
+
}
|
|
1601
|
+
class Vo extends rr {
|
|
1602
|
+
constructor(...t) {
|
|
1603
|
+
super(...t), this.state = {
|
|
1604
|
+
height: this.props.defaultHeight || 0,
|
|
1605
|
+
scaledHeight: this.props.defaultHeight || 0,
|
|
1606
|
+
scaledWidth: this.props.defaultWidth || 0,
|
|
1607
|
+
width: this.props.defaultWidth || 0
|
|
1608
|
+
}, this._autoSizer = null, this._detectElementResize = null, this._parentNode = null, this._resizeObserver = null, this._timeoutId = null, this._onResize = () => {
|
|
1609
|
+
this._timeoutId = null;
|
|
1610
|
+
const {
|
|
1611
|
+
disableHeight: n,
|
|
1612
|
+
disableWidth: o,
|
|
1613
|
+
onResize: r
|
|
1614
|
+
} = this.props;
|
|
1615
|
+
if (this._parentNode) {
|
|
1616
|
+
const i = window.getComputedStyle(this._parentNode) || {}, c = parseFloat(i.paddingLeft || "0"), s = parseFloat(i.paddingRight || "0"), l = parseFloat(i.paddingTop || "0"), u = parseFloat(i.paddingBottom || "0"), d = this._parentNode.getBoundingClientRect(), f = d.height - l - u, h = d.width - c - s, g = this._parentNode.offsetHeight - l - u, w = this._parentNode.offsetWidth - c - s;
|
|
1617
|
+
(!n && (this.state.height !== g || this.state.scaledHeight !== f) || !o && (this.state.width !== w || this.state.scaledWidth !== h)) && (this.setState({
|
|
1618
|
+
height: g,
|
|
1619
|
+
width: w,
|
|
1620
|
+
scaledHeight: f,
|
|
1621
|
+
scaledWidth: h
|
|
1622
|
+
}), typeof r == "function" && r({
|
|
1623
|
+
height: g,
|
|
1624
|
+
scaledHeight: f,
|
|
1625
|
+
scaledWidth: h,
|
|
1626
|
+
width: w
|
|
1627
|
+
}));
|
|
1628
|
+
}
|
|
1629
|
+
}, this._setRef = (n) => {
|
|
1630
|
+
this._autoSizer = n;
|
|
1631
|
+
};
|
|
1632
|
+
}
|
|
1633
|
+
componentDidMount() {
|
|
1634
|
+
const {
|
|
1635
|
+
nonce: t
|
|
1636
|
+
} = this.props, n = this._autoSizer ? this._autoSizer.parentNode : null;
|
|
1637
|
+
if (n != null && n.ownerDocument && n.ownerDocument.defaultView && n instanceof n.ownerDocument.defaultView.HTMLElement) {
|
|
1638
|
+
this._parentNode = n;
|
|
1639
|
+
const o = n.ownerDocument.defaultView.ResizeObserver;
|
|
1640
|
+
o != null ? (this._resizeObserver = new o(() => {
|
|
1641
|
+
this._timeoutId = setTimeout(this._onResize, 0);
|
|
1642
|
+
}), this._resizeObserver.observe(n)) : (this._detectElementResize = Go(t), this._detectElementResize.addResizeListener(n, this._onResize)), this._onResize();
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
componentWillUnmount() {
|
|
1646
|
+
this._parentNode && (this._detectElementResize && this._detectElementResize.removeResizeListener(this._parentNode, this._onResize), this._timeoutId !== null && clearTimeout(this._timeoutId), this._resizeObserver && this._resizeObserver.disconnect());
|
|
1647
|
+
}
|
|
1648
|
+
render() {
|
|
1649
|
+
const {
|
|
1650
|
+
children: t,
|
|
1651
|
+
defaultHeight: n,
|
|
1652
|
+
defaultWidth: o,
|
|
1653
|
+
disableHeight: r = !1,
|
|
1654
|
+
disableWidth: i = !1,
|
|
1655
|
+
doNotBailOutOnEmptyChildren: c = !1,
|
|
1656
|
+
nonce: s,
|
|
1657
|
+
onResize: l,
|
|
1658
|
+
style: u = {},
|
|
1659
|
+
tagName: d = "div",
|
|
1660
|
+
...f
|
|
1661
|
+
} = this.props, {
|
|
1662
|
+
height: h,
|
|
1663
|
+
scaledHeight: g,
|
|
1664
|
+
scaledWidth: w,
|
|
1665
|
+
width: b
|
|
1666
|
+
} = this.state, v = {
|
|
1667
|
+
overflow: "visible"
|
|
1668
|
+
}, _ = {};
|
|
1669
|
+
let m = !1;
|
|
1670
|
+
return r || (h === 0 && (m = !0), v.height = 0, _.height = h, _.scaledHeight = g), i || (b === 0 && (m = !0), v.width = 0, _.width = b, _.scaledWidth = w), c && (m = !1), Ge(d, {
|
|
1671
|
+
ref: this._setRef,
|
|
1672
|
+
style: {
|
|
1673
|
+
...v,
|
|
1674
|
+
...u
|
|
1675
|
+
},
|
|
1676
|
+
...f
|
|
1677
|
+
}, !m && t(_));
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
const Uo = ({ widths: e, heights: t }) => {
|
|
1681
|
+
const { focusedPage: n, totalPages: o } = ie(), r = F(() => {
|
|
1682
|
+
const s = [], l = Math.ceil(n / 2) * 2 - 1;
|
|
1683
|
+
if (s.push(l), l + 1 < o) {
|
|
1684
|
+
const u = l + 1;
|
|
1685
|
+
s.push(u);
|
|
1686
|
+
}
|
|
1687
|
+
return s;
|
|
1688
|
+
}, [n, o]), i = F(() => [
|
|
1689
|
+
{
|
|
1690
|
+
position: "absolute",
|
|
1691
|
+
left: 0,
|
|
1692
|
+
width: e(n - 1),
|
|
1693
|
+
height: t(n - 1)
|
|
1694
|
+
},
|
|
1695
|
+
{
|
|
1696
|
+
position: "absolute",
|
|
1697
|
+
left: e(n),
|
|
1698
|
+
top: 0,
|
|
1699
|
+
width: e(n),
|
|
1700
|
+
height: t(n)
|
|
1701
|
+
}
|
|
1702
|
+
], [e, t, r]), c = F(() => i.reduce((s, l) => s + Number(l.width || 0), 0), [i]);
|
|
1703
|
+
return /* @__PURE__ */ a("div", { style: { width: c, position: "relative" }, children: r.map((s, l) => /* @__PURE__ */ a(Nt, { style: i[l], pageNumber: s }, s)) });
|
|
1704
|
+
}, qo = ({ widths: e, heights: t }) => {
|
|
1705
|
+
const { focusedPage: n } = ie(), o = F(() => ({
|
|
1706
|
+
position: "absolute",
|
|
1707
|
+
width: e(n - 1),
|
|
1708
|
+
height: t(n - 1)
|
|
1709
|
+
}), [e, t, n]), r = F(() => e(n - 1), [e]);
|
|
1710
|
+
return /* @__PURE__ */ a(
|
|
1711
|
+
"div",
|
|
1712
|
+
{
|
|
1713
|
+
style: {
|
|
1714
|
+
width: r,
|
|
1715
|
+
position: "relative"
|
|
1716
|
+
},
|
|
1717
|
+
children: /* @__PURE__ */ a(Nt, { style: o, pageNumber: n }, n)
|
|
1718
|
+
}
|
|
1719
|
+
);
|
|
1720
|
+
}, Zo = (e, t, n) => {
|
|
1721
|
+
const o = M(), { contentRef: r } = Te(), { heights: i, widths: c } = tt(), { setFocusedPage: s } = ie(), [l, u] = $([]), { smoothScrolling: d } = xt(), f = It(l, 100, 500), h = F(() => i.map((w, b) => {
|
|
1722
|
+
const v = c[b], _ = Hr(b + 1, e), m = v * _.columnIndex, P = w * _.rowIndex, x = m + v, p = P + w;
|
|
1723
|
+
return {
|
|
1724
|
+
pageNumber: b + 1,
|
|
1725
|
+
..._,
|
|
1726
|
+
width: v,
|
|
1727
|
+
height: w,
|
|
1728
|
+
startX: m,
|
|
1729
|
+
startY: P,
|
|
1730
|
+
endX: x,
|
|
1731
|
+
endY: p
|
|
1732
|
+
};
|
|
1733
|
+
}), [i, c, e, t]);
|
|
1734
|
+
A(() => {
|
|
1735
|
+
f.length > 0 && !d.current && s(f[0].pageNumber);
|
|
1736
|
+
}, [f, s]);
|
|
1737
|
+
const g = L(
|
|
1738
|
+
(w) => {
|
|
1739
|
+
o.current && cancelAnimationFrame(o.current), o.current = requestAnimationFrame(() => {
|
|
1740
|
+
const b = w.target, v = {
|
|
1741
|
+
startTop: b.scrollTop,
|
|
1742
|
+
startLeft: b.scrollLeft,
|
|
1743
|
+
endTop: b.scrollTop + b.clientHeight,
|
|
1744
|
+
endLeft: b.scrollLeft + b.clientWidth
|
|
1745
|
+
}, _ = h.filter((m) => {
|
|
1746
|
+
const P = m.endX >= v.startLeft && m.endY >= v.startTop, x = m.startX <= v.endLeft && m.startY <= v.endTop;
|
|
1747
|
+
return P && x;
|
|
1748
|
+
}).map((m) => {
|
|
1749
|
+
const P = v.startLeft > m.startX ? v.startLeft : m.startX, x = v.startTop > m.startY ? v.startTop : m.startY, p = v.endLeft < m.endX ? v.endLeft : m.endX, T = v.endTop < m.endY ? v.endTop : m.endY, C = p - P, S = T - x, y = +(C * S / (m.width * m.height) * 100).toFixed(2);
|
|
1750
|
+
return {
|
|
1751
|
+
pageNumber: m.pageNumber,
|
|
1752
|
+
ratio: y
|
|
1753
|
+
};
|
|
1754
|
+
}).sort((m, P) => P.ratio - m.ratio);
|
|
1755
|
+
u(_);
|
|
1756
|
+
});
|
|
1757
|
+
},
|
|
1758
|
+
[r, h]
|
|
1759
|
+
);
|
|
1760
|
+
A(() => {
|
|
1761
|
+
if (n)
|
|
1762
|
+
return n == null || n.addEventListener("scroll", g), () => {
|
|
1763
|
+
n == null || n.removeEventListener("scroll", g);
|
|
1764
|
+
};
|
|
1765
|
+
}, [n, g]);
|
|
1766
|
+
}, Bo = or(({ columnIndex: e, rowIndex: t, data: n, style: o }) => {
|
|
1767
|
+
const r = $r(t, e, n.columnCount);
|
|
1768
|
+
return /* @__PURE__ */ a(Nt, { style: o, pageNumber: r }, r);
|
|
1769
|
+
}, Ho), Is = () => {
|
|
1770
|
+
const { initialPage: e = 1, initialScrollMode: t } = lr(), { pagesRef: n, setPagesRef: o } = Te(), { scrollToPage: r } = bn(), {
|
|
1771
|
+
virtualScrollRef: i,
|
|
1772
|
+
getVirtualScrollRef: c,
|
|
1773
|
+
getPageScrollElementRef: s,
|
|
1774
|
+
getVirtualScrollableElementRef: l,
|
|
1775
|
+
setTotalInnerDimensions: u,
|
|
1776
|
+
virtualScrollableElementRef: d,
|
|
1777
|
+
totalInnerDimensions: f,
|
|
1778
|
+
pageScrollElementRef: h
|
|
1779
|
+
} = et(), g = M(!0), { nextPage: w, prevPage: b, setFocusedPage: v, focusedPage: _ } = ie(), { scrollMode: m } = Ee(), { viewMode: P } = Qe(), x = M(null), { loading: p } = K(), { LoaderImageComponent: T } = mn(), { smoothScrolling: C, targetScrollPosition: S } = xt(), N = M(
|
|
1780
|
+
f
|
|
1781
|
+
), y = M({
|
|
1782
|
+
viewMode: P,
|
|
1783
|
+
scrollMode: m
|
|
1784
|
+
}), O = M(!1), R = M(), { isFullScreen: k } = dr(), {
|
|
1785
|
+
pageDimension: z,
|
|
1786
|
+
rowCount: I,
|
|
1787
|
+
rowHeight: E,
|
|
1788
|
+
columnCount: W,
|
|
1789
|
+
columnWidth: V,
|
|
1790
|
+
estimatedColumnWidth: Z,
|
|
1791
|
+
estimatedRowHeight: Y
|
|
1792
|
+
} = $o(), j = It(f, 100), B = M();
|
|
1793
|
+
Zo(W, I, d);
|
|
1794
|
+
const te = M({
|
|
1795
|
+
scrollTop: 0,
|
|
1796
|
+
scrollLeft: 0
|
|
1797
|
+
});
|
|
1798
|
+
Wr(n);
|
|
1799
|
+
const { isPressed: ae } = kr(), { selectionMode: J } = cr(), { initializeGrabScroll: ne, resetGrabState: he } = Mr({
|
|
1800
|
+
isPressed: ae
|
|
1801
|
+
}), ce = F(() => J === ar.HAND, [J]), Oe = F(() => ({
|
|
1802
|
+
columnCount: W
|
|
1803
|
+
}), [W]), we = L(
|
|
1804
|
+
(H) => {
|
|
1805
|
+
const G = document.activeElement !== n;
|
|
1806
|
+
!k && G || (["ArrowUp", "ArrowLeft"].includes(H.key) ? (H.preventDefault(), b()) : ["ArrowDown", "ArrowRight"].includes(H.key) && (H.preventDefault(), w()));
|
|
1807
|
+
},
|
|
1808
|
+
[w, b, k, m]
|
|
1809
|
+
);
|
|
1810
|
+
A(() => (window.addEventListener("keydown", we), () => {
|
|
1811
|
+
window.removeEventListener("keydown", we);
|
|
1812
|
+
}), [we]), A(() => {
|
|
1813
|
+
if (x.current && (x.current.style.position = "relative"), !!i)
|
|
1814
|
+
for (let H = 0; H < I; H++)
|
|
1815
|
+
for (let G = 0; G < W; G++)
|
|
1816
|
+
i.resetAfterIndices({
|
|
1817
|
+
columnIndex: G,
|
|
1818
|
+
rowIndex: H,
|
|
1819
|
+
shouldForceUpdate: !0
|
|
1820
|
+
});
|
|
1821
|
+
}, [I, W, z, i]);
|
|
1822
|
+
const me = L(
|
|
1823
|
+
(H, G) => {
|
|
1824
|
+
if (!d)
|
|
1825
|
+
return { scrollTop: 0, scrollLeft: 0 };
|
|
1826
|
+
const fe = te.current.scrollTop > G, ge = te.current.scrollLeft > H;
|
|
1827
|
+
return fe || ge ? te.current : {
|
|
1828
|
+
scrollTop: d.scrollTop,
|
|
1829
|
+
scrollLeft: d.scrollLeft
|
|
1830
|
+
};
|
|
1831
|
+
},
|
|
1832
|
+
[d]
|
|
1833
|
+
), le = L(
|
|
1834
|
+
(H, G) => {
|
|
1835
|
+
if (y.current.viewMode !== P || y.current.scrollMode !== m) {
|
|
1836
|
+
B.current && clearTimeout(B.current), O.current = !0, r(_, "auto"), B.current = setTimeout(() => {
|
|
1837
|
+
requestAnimationFrame(() => {
|
|
1838
|
+
y.current = { viewMode: P, scrollMode: m };
|
|
1839
|
+
});
|
|
1840
|
+
}, 100);
|
|
1841
|
+
return;
|
|
1842
|
+
}
|
|
1843
|
+
const ge = H.scrollTop, ze = H.scrollLeft;
|
|
1844
|
+
if (!G.height || !G.width)
|
|
1845
|
+
return;
|
|
1846
|
+
O.current = !0;
|
|
1847
|
+
const { height: Pe, width: ot } = G, { height: At, width: Ft } = N.current;
|
|
1848
|
+
if (At === Pe && Ft === ot)
|
|
1849
|
+
return;
|
|
1850
|
+
const Jn = ge / At * Pe, Qn = ze / Ft * ot, er = Math.round(Math.min(Jn, Pe)) || 0, tr = Math.round(Math.min(Qn, ot)) || 0;
|
|
1851
|
+
R.current = setTimeout(() => {
|
|
1852
|
+
requestAnimationFrame(() => {
|
|
1853
|
+
i == null || i.scrollTo({
|
|
1854
|
+
scrollTop: er,
|
|
1855
|
+
scrollLeft: tr
|
|
1856
|
+
});
|
|
1857
|
+
});
|
|
1858
|
+
}, 0), N.current = {
|
|
1859
|
+
height: G.height,
|
|
1860
|
+
width: G.width
|
|
1861
|
+
};
|
|
1862
|
+
},
|
|
1863
|
+
[i, P, m, r]
|
|
1864
|
+
);
|
|
1865
|
+
A(() => {
|
|
1866
|
+
clearTimeout(R.current);
|
|
1867
|
+
const H = Array.from({ length: I }).reduce(
|
|
1868
|
+
(ge, ze, Pe) => ge + E(Pe),
|
|
1869
|
+
0
|
|
1870
|
+
), G = Array.from({ length: W }).reduce(
|
|
1871
|
+
(ge, ze, Pe) => ge + V(Pe),
|
|
1872
|
+
0
|
|
1873
|
+
), fe = me(G, H);
|
|
1874
|
+
te.current = fe, le(fe, { height: H, width: G }), u({
|
|
1875
|
+
height: H,
|
|
1876
|
+
width: G
|
|
1877
|
+
});
|
|
1878
|
+
}, [z, I, W, le]);
|
|
1879
|
+
const De = L(
|
|
1880
|
+
(H) => {
|
|
1881
|
+
te.current = {
|
|
1882
|
+
scrollTop: H.scrollTop,
|
|
1883
|
+
scrollLeft: H.scrollLeft
|
|
1884
|
+
};
|
|
1885
|
+
const G = ((d == null ? void 0 : d.scrollHeight) || 0) - ((d == null ? void 0 : d.clientHeight) || 0), fe = ((d == null ? void 0 : d.scrollWidth) || 0) - ((d == null ? void 0 : d.clientWidth) || 0), ge = Math.round(S.current.left) === Math.round(H.scrollLeft) && Math.round(S.current.top) === Math.round(H.scrollTop), ze = Math.round(G) === Math.round(H.scrollTop) && Math.round(fe) === Math.round(H.scrollLeft);
|
|
1886
|
+
(ge || ze) && (C.current = !1);
|
|
1887
|
+
},
|
|
1888
|
+
[d]
|
|
1889
|
+
);
|
|
1890
|
+
A(() => () => {
|
|
1891
|
+
B.current && clearTimeout(B.current);
|
|
1892
|
+
}, []);
|
|
1893
|
+
const rt = F(() => re(de["rp-pages-container"], {
|
|
1894
|
+
[de["rp-cursor-grab"]]: ce && !ae,
|
|
1895
|
+
[de["rp-cursor-grabbing"]]: ce && ae
|
|
1896
|
+
}), [ce, ae]), Yn = L(
|
|
1897
|
+
(H) => {
|
|
1898
|
+
if (ce && H) {
|
|
1899
|
+
const G = re(de["rp-pages"]), fe = document.querySelector(`.${G}`);
|
|
1900
|
+
ne(fe);
|
|
1901
|
+
}
|
|
1902
|
+
},
|
|
1903
|
+
[ce, ne, de]
|
|
1904
|
+
);
|
|
1905
|
+
return A(() => {
|
|
1906
|
+
p && he();
|
|
1907
|
+
}, [p]), A(() => {
|
|
1908
|
+
if (!(j.height === 0 || !g.current)) {
|
|
1909
|
+
if (t === X.PAGE_SCROLLING) {
|
|
1910
|
+
e !== _ && h && v(e), g.current = !1;
|
|
1911
|
+
return;
|
|
1912
|
+
}
|
|
1913
|
+
if (i != null && i.scrollToItem) {
|
|
1914
|
+
switch (t) {
|
|
1915
|
+
case X.HORIZONTAL_SCROLLING:
|
|
1916
|
+
i.scrollToItem({
|
|
1917
|
+
columnIndex: e - 1,
|
|
1918
|
+
rowIndex: 0,
|
|
1919
|
+
align: "start"
|
|
1920
|
+
});
|
|
1921
|
+
break;
|
|
1922
|
+
default:
|
|
1923
|
+
i.scrollToItem({
|
|
1924
|
+
columnIndex: 0,
|
|
1925
|
+
rowIndex: e - 1,
|
|
1926
|
+
align: "start"
|
|
1927
|
+
});
|
|
1928
|
+
break;
|
|
1929
|
+
}
|
|
1930
|
+
v(e), g.current = !1;
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
}, [
|
|
1934
|
+
i,
|
|
1935
|
+
t,
|
|
1936
|
+
h,
|
|
1937
|
+
v,
|
|
1938
|
+
j
|
|
1939
|
+
]), /* @__PURE__ */ a("div", { ref: o, tabIndex: -1, className: rt, children: /* @__PURE__ */ a(Vo, { style: { minHeight: "50px" }, children: ({ width: H, height: G }) => /* @__PURE__ */ a("div", { "data-rp": "pages", ref: Yn, style: { width: H, height: G }, children: m === X.PAGE_SCROLLING ? /* @__PURE__ */ a(
|
|
1940
|
+
"div",
|
|
1941
|
+
{
|
|
1942
|
+
ref: s,
|
|
1943
|
+
style: { width: H, height: G },
|
|
1944
|
+
className: re(de["rp-pages"], de["rp-page-scrolling-wrapper"]),
|
|
1945
|
+
children: P === Ze.DUAL_PAGE ? /* @__PURE__ */ a(Uo, { widths: V, heights: E }) : /* @__PURE__ */ a(qo, { widths: V, heights: E })
|
|
1946
|
+
}
|
|
1947
|
+
) : Z ? /* @__PURE__ */ a(
|
|
1948
|
+
ko,
|
|
1949
|
+
{
|
|
1950
|
+
ref: c,
|
|
1951
|
+
itemData: Oe,
|
|
1952
|
+
outerRef: l,
|
|
1953
|
+
innerRef: x,
|
|
1954
|
+
onScroll: De,
|
|
1955
|
+
columnCount: W,
|
|
1956
|
+
columnWidth: V,
|
|
1957
|
+
rowHeight: E,
|
|
1958
|
+
height: G,
|
|
1959
|
+
width: H,
|
|
1960
|
+
estimatedColumnWidth: Z,
|
|
1961
|
+
estimatedRowHeight: Y,
|
|
1962
|
+
rowCount: I,
|
|
1963
|
+
className: re(
|
|
1964
|
+
de["rp-pages"],
|
|
1965
|
+
m === X.HORIZONTAL_SCROLLING ? de["rp-pages-horizontal-scroll"] : ""
|
|
1966
|
+
),
|
|
1967
|
+
children: Bo
|
|
1968
|
+
}
|
|
1969
|
+
) : p ? null : /* @__PURE__ */ a(
|
|
1970
|
+
"div",
|
|
1971
|
+
{
|
|
1972
|
+
className: de["rp-loader"],
|
|
1973
|
+
style: {
|
|
1974
|
+
display: "flex",
|
|
1975
|
+
justifyContent: "center",
|
|
1976
|
+
alignItems: "center",
|
|
1977
|
+
height: "100%",
|
|
1978
|
+
width: "100%"
|
|
1979
|
+
},
|
|
1980
|
+
children: T && /* @__PURE__ */ a(T, {})
|
|
1981
|
+
}
|
|
1982
|
+
) }) }) });
|
|
1983
|
+
}, Ae = {
|
|
1984
|
+
"rp-toolbar-content": "_rp-toolbar-content_sz31z_1",
|
|
1985
|
+
"rp-toolbar-wrapper": "_rp-toolbar-wrapper_sz31z_10",
|
|
1986
|
+
"rp-toolbar-start": "_rp-toolbar-start_sz31z_33",
|
|
1987
|
+
"rp-toolbar-middle": "_rp-toolbar-middle_sz31z_39",
|
|
1988
|
+
"rp-toolbar-end": "_rp-toolbar-end_sz31z_46"
|
|
1989
|
+
}, gt = {
|
|
1990
|
+
"rp-paginate": "_rp-paginate_1y9vo_1",
|
|
1991
|
+
"rp-page-input": "_rp-page-input_1y9vo_6",
|
|
1992
|
+
"rp-total-page": "_rp-total-page_1y9vo_11"
|
|
1993
|
+
}, jo = () => {
|
|
1994
|
+
const { prevIcon: e } = pe();
|
|
1995
|
+
return e || /* @__PURE__ */ a(Me, {});
|
|
1996
|
+
}, Ko = () => {
|
|
1997
|
+
const { nextIcon: e } = pe();
|
|
1998
|
+
return e || /* @__PURE__ */ a(Me, { style: { transform: "rotate(180deg" } });
|
|
1999
|
+
}, Xo = () => {
|
|
2000
|
+
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: i } = ie(), [c, s] = $(e.toString()), { pageNavigationTool: l = !0 } = _e(), { isSmallScreen: u } = ye(), { localeMessages: d } = ue();
|
|
2001
|
+
A(() => {
|
|
2002
|
+
s(e.toString());
|
|
2003
|
+
}, [e]);
|
|
2004
|
+
const f = L((b) => {
|
|
2005
|
+
const v = b.target.value;
|
|
2006
|
+
s(v);
|
|
2007
|
+
}, []), h = L(async () => {
|
|
2008
|
+
const b = i(c);
|
|
2009
|
+
b.success || s(b.currentPage.toString());
|
|
2010
|
+
}, [i, c, t]), g = L(() => {
|
|
2011
|
+
s(e.toString());
|
|
2012
|
+
}, [e]), w = L(
|
|
2013
|
+
(b) => {
|
|
2014
|
+
b.key === "Enter" && h();
|
|
2015
|
+
},
|
|
2016
|
+
[h]
|
|
2017
|
+
);
|
|
2018
|
+
return typeof l != "boolean" ? /* @__PURE__ */ a(
|
|
2019
|
+
l,
|
|
2020
|
+
{
|
|
2021
|
+
total: t,
|
|
2022
|
+
current: e,
|
|
2023
|
+
nextPage: o,
|
|
2024
|
+
prevPage: r,
|
|
2025
|
+
goToPage: i,
|
|
2026
|
+
changePage: n
|
|
2027
|
+
}
|
|
2028
|
+
) : l ? /* @__PURE__ */ D("div", { className: gt["rp-paginate"], children: [
|
|
2029
|
+
!u && /* @__PURE__ */ a(q, { content: d == null ? void 0 : d.previousPageTooltip, children: /* @__PURE__ */ a(
|
|
2030
|
+
ee,
|
|
2031
|
+
{
|
|
2032
|
+
onClick: r,
|
|
2033
|
+
"aria-label": d == null ? void 0 : d.previousPageTooltip,
|
|
2034
|
+
"aria-disabled": e === 1,
|
|
2035
|
+
children: /* @__PURE__ */ a(jo, {})
|
|
2036
|
+
}
|
|
2037
|
+
) }),
|
|
2038
|
+
/* @__PURE__ */ a(q, { content: d == null ? void 0 : d.currentPageTooltip, children: /* @__PURE__ */ a(
|
|
2039
|
+
dn,
|
|
2040
|
+
{
|
|
2041
|
+
onKeyDown: w,
|
|
2042
|
+
onBlur: g,
|
|
2043
|
+
onChange: f,
|
|
2044
|
+
value: c,
|
|
2045
|
+
className: gt["rp-page-input"]
|
|
2046
|
+
}
|
|
2047
|
+
) }),
|
|
2048
|
+
/* @__PURE__ */ D("span", { className: gt["rp-total-page"], children: [
|
|
2049
|
+
"/",
|
|
2050
|
+
t
|
|
2051
|
+
] }),
|
|
2052
|
+
!u && /* @__PURE__ */ a(q, { content: d == null ? void 0 : d.nextPageTooltip, children: /* @__PURE__ */ a(
|
|
2053
|
+
ee,
|
|
2054
|
+
{
|
|
2055
|
+
onClick: o,
|
|
2056
|
+
"aria-label": d == null ? void 0 : d.nextPageTooltip,
|
|
2057
|
+
"aria-disabled": e === t,
|
|
2058
|
+
children: /* @__PURE__ */ a(Ko, {})
|
|
2059
|
+
}
|
|
2060
|
+
) })
|
|
2061
|
+
] }) : null;
|
|
2062
|
+
};
|
|
2063
|
+
var Et = "Dialog", [Nn, ys] = qr(Et), [Yo, se] = Nn(Et), En = (e) => {
|
|
2064
|
+
const {
|
|
2065
|
+
__scopeDialog: t,
|
|
2066
|
+
children: n,
|
|
2067
|
+
open: o,
|
|
2068
|
+
defaultOpen: r,
|
|
2069
|
+
onOpenChange: i,
|
|
2070
|
+
modal: c = !0
|
|
2071
|
+
} = e, s = U.useRef(null), l = U.useRef(null), [u = !1, d] = jr({
|
|
2072
|
+
prop: o,
|
|
2073
|
+
defaultProp: r,
|
|
2074
|
+
onChange: i
|
|
2075
|
+
});
|
|
2076
|
+
return /* @__PURE__ */ a(
|
|
2077
|
+
Yo,
|
|
2078
|
+
{
|
|
2079
|
+
scope: t,
|
|
2080
|
+
triggerRef: s,
|
|
2081
|
+
contentRef: l,
|
|
2082
|
+
contentId: st(),
|
|
2083
|
+
titleId: st(),
|
|
2084
|
+
descriptionId: st(),
|
|
2085
|
+
open: u,
|
|
2086
|
+
onOpenChange: d,
|
|
2087
|
+
onOpenToggle: U.useCallback(() => d((f) => !f), [d]),
|
|
2088
|
+
modal: c,
|
|
2089
|
+
children: n
|
|
2090
|
+
}
|
|
2091
|
+
);
|
|
2092
|
+
};
|
|
2093
|
+
En.displayName = Et;
|
|
2094
|
+
var On = "DialogTrigger", Jo = U.forwardRef(
|
|
2095
|
+
(e, t) => {
|
|
2096
|
+
const { __scopeDialog: n, ...o } = e, r = se(On, n), i = yt(t, r.triggerRef);
|
|
2097
|
+
return /* @__PURE__ */ a(
|
|
2098
|
+
He.button,
|
|
2099
|
+
{
|
|
2100
|
+
type: "button",
|
|
2101
|
+
"aria-haspopup": "dialog",
|
|
2102
|
+
"aria-expanded": r.open,
|
|
2103
|
+
"aria-controls": r.contentId,
|
|
2104
|
+
"data-state": zt(r.open),
|
|
2105
|
+
...o,
|
|
2106
|
+
ref: i,
|
|
2107
|
+
onClick: ke(e.onClick, r.onOpenToggle)
|
|
2108
|
+
}
|
|
2109
|
+
);
|
|
2110
|
+
}
|
|
2111
|
+
);
|
|
2112
|
+
Jo.displayName = On;
|
|
2113
|
+
var Ot = "DialogPortal", [Qo, Dn] = Nn(Ot, {
|
|
2114
|
+
forceMount: void 0
|
|
2115
|
+
}), zn = (e) => {
|
|
2116
|
+
const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, i = se(Ot, t);
|
|
2117
|
+
return /* @__PURE__ */ a(Qo, { scope: t, forceMount: n, children: U.Children.map(o, (c) => /* @__PURE__ */ a(Lt, { present: n || i.open, children: /* @__PURE__ */ a(Qr, { asChild: !0, container: r, children: c }) })) });
|
|
2118
|
+
};
|
|
2119
|
+
zn.displayName = Ot;
|
|
2120
|
+
var je = "DialogOverlay", An = U.forwardRef(
|
|
2121
|
+
(e, t) => {
|
|
2122
|
+
const n = Dn(je, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, i = se(je, e.__scopeDialog);
|
|
2123
|
+
return i.modal ? /* @__PURE__ */ a(Lt, { present: o || i.open, children: /* @__PURE__ */ a(ei, { ...r, ref: t }) }) : null;
|
|
2124
|
+
}
|
|
2125
|
+
);
|
|
2126
|
+
An.displayName = je;
|
|
2127
|
+
var ei = U.forwardRef(
|
|
2128
|
+
(e, t) => {
|
|
2129
|
+
const { __scopeDialog: n, ...o } = e, r = se(je, n);
|
|
2130
|
+
return (
|
|
2131
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
2132
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
2133
|
+
/* @__PURE__ */ a(Xr, { as: Zr, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ a(
|
|
2134
|
+
He.div,
|
|
2135
|
+
{
|
|
2136
|
+
"data-state": zt(r.open),
|
|
2137
|
+
...o,
|
|
2138
|
+
ref: t,
|
|
2139
|
+
style: { pointerEvents: "auto", ...o.style }
|
|
2140
|
+
}
|
|
2141
|
+
) })
|
|
2142
|
+
);
|
|
2143
|
+
}
|
|
2144
|
+
), Ie = "DialogContent", Fn = U.forwardRef(
|
|
2145
|
+
(e, t) => {
|
|
2146
|
+
const n = Dn(Ie, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, i = se(Ie, e.__scopeDialog);
|
|
2147
|
+
return /* @__PURE__ */ a(Lt, { present: o || i.open, children: i.modal ? /* @__PURE__ */ a(ti, { ...r, ref: t }) : /* @__PURE__ */ a(ni, { ...r, ref: t }) });
|
|
2148
|
+
}
|
|
2149
|
+
);
|
|
2150
|
+
Fn.displayName = Ie;
|
|
2151
|
+
var ti = U.forwardRef(
|
|
2152
|
+
(e, t) => {
|
|
2153
|
+
const n = se(Ie, e.__scopeDialog), o = U.useRef(null), r = yt(t, n.contentRef, o);
|
|
2154
|
+
return U.useEffect(() => {
|
|
2155
|
+
const i = o.current;
|
|
2156
|
+
if (i)
|
|
2157
|
+
return eo(i);
|
|
2158
|
+
}, []), /* @__PURE__ */ a(
|
|
2159
|
+
kn,
|
|
2160
|
+
{
|
|
2161
|
+
...e,
|
|
2162
|
+
ref: r,
|
|
2163
|
+
trapFocus: n.open,
|
|
2164
|
+
disableOutsidePointerEvents: !0,
|
|
2165
|
+
onCloseAutoFocus: ke(e.onCloseAutoFocus, (i) => {
|
|
2166
|
+
var c;
|
|
2167
|
+
i.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
|
|
2168
|
+
}),
|
|
2169
|
+
onPointerDownOutside: ke(e.onPointerDownOutside, (i) => {
|
|
2170
|
+
const c = i.detail.originalEvent, s = c.button === 0 && c.ctrlKey === !0;
|
|
2171
|
+
(c.button === 2 || s) && i.preventDefault();
|
|
2172
|
+
}),
|
|
2173
|
+
onFocusOutside: ke(
|
|
2174
|
+
e.onFocusOutside,
|
|
2175
|
+
(i) => i.preventDefault()
|
|
2176
|
+
)
|
|
2177
|
+
}
|
|
2178
|
+
);
|
|
2179
|
+
}
|
|
2180
|
+
), ni = U.forwardRef(
|
|
2181
|
+
(e, t) => {
|
|
2182
|
+
const n = se(Ie, e.__scopeDialog), o = U.useRef(!1), r = U.useRef(!1);
|
|
2183
|
+
return /* @__PURE__ */ a(
|
|
2184
|
+
kn,
|
|
2185
|
+
{
|
|
2186
|
+
...e,
|
|
2187
|
+
ref: t,
|
|
2188
|
+
trapFocus: !1,
|
|
2189
|
+
disableOutsidePointerEvents: !1,
|
|
2190
|
+
onCloseAutoFocus: (i) => {
|
|
2191
|
+
var c, s;
|
|
2192
|
+
(c = e.onCloseAutoFocus) == null || c.call(e, i), i.defaultPrevented || (o.current || (s = n.triggerRef.current) == null || s.focus(), i.preventDefault()), o.current = !1, r.current = !1;
|
|
2193
|
+
},
|
|
2194
|
+
onInteractOutside: (i) => {
|
|
2195
|
+
var l, u;
|
|
2196
|
+
(l = e.onInteractOutside) == null || l.call(e, i), i.defaultPrevented || (o.current = !0, i.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
2197
|
+
const c = i.target;
|
|
2198
|
+
((u = n.triggerRef.current) == null ? void 0 : u.contains(c)) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && r.current && i.preventDefault();
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
);
|
|
2202
|
+
}
|
|
2203
|
+
), kn = U.forwardRef(
|
|
2204
|
+
(e, t) => {
|
|
2205
|
+
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: i, ...c } = e, s = se(Ie, n), l = U.useRef(null), u = yt(t, l);
|
|
2206
|
+
return Yr(), /* @__PURE__ */ D(Se, { children: [
|
|
2207
|
+
/* @__PURE__ */ a(
|
|
2208
|
+
Jr,
|
|
2209
|
+
{
|
|
2210
|
+
asChild: !0,
|
|
2211
|
+
loop: !0,
|
|
2212
|
+
trapped: o,
|
|
2213
|
+
onMountAutoFocus: r,
|
|
2214
|
+
onUnmountAutoFocus: i,
|
|
2215
|
+
children: /* @__PURE__ */ a(
|
|
2216
|
+
Kr,
|
|
2217
|
+
{
|
|
2218
|
+
role: "dialog",
|
|
2219
|
+
id: s.contentId,
|
|
2220
|
+
"aria-describedby": s.descriptionId,
|
|
2221
|
+
"aria-labelledby": s.titleId,
|
|
2222
|
+
"data-state": zt(s.open),
|
|
2223
|
+
...c,
|
|
2224
|
+
ref: u,
|
|
2225
|
+
onDismiss: () => s.onOpenChange(!1)
|
|
2226
|
+
}
|
|
2227
|
+
)
|
|
2228
|
+
}
|
|
2229
|
+
),
|
|
2230
|
+
/* @__PURE__ */ D(Se, { children: [
|
|
2231
|
+
/* @__PURE__ */ a(oi, { titleId: s.titleId }),
|
|
2232
|
+
/* @__PURE__ */ a(ai, { contentRef: l, descriptionId: s.descriptionId })
|
|
2233
|
+
] })
|
|
2234
|
+
] });
|
|
2235
|
+
}
|
|
2236
|
+
), Dt = "DialogTitle", Mn = U.forwardRef(
|
|
2237
|
+
(e, t) => {
|
|
2238
|
+
const { __scopeDialog: n, ...o } = e, r = se(Dt, n);
|
|
2239
|
+
return /* @__PURE__ */ a(He.h2, { id: r.titleId, ...o, ref: t });
|
|
2240
|
+
}
|
|
2241
|
+
);
|
|
2242
|
+
Mn.displayName = Dt;
|
|
2243
|
+
var Wn = "DialogDescription", ri = U.forwardRef(
|
|
2244
|
+
(e, t) => {
|
|
2245
|
+
const { __scopeDialog: n, ...o } = e, r = se(Wn, n);
|
|
2246
|
+
return /* @__PURE__ */ a(He.p, { id: r.descriptionId, ...o, ref: t });
|
|
2247
|
+
}
|
|
2248
|
+
);
|
|
2249
|
+
ri.displayName = Wn;
|
|
2250
|
+
var Hn = "DialogClose", $n = U.forwardRef(
|
|
2251
|
+
(e, t) => {
|
|
2252
|
+
const { __scopeDialog: n, ...o } = e, r = se(Hn, n);
|
|
2253
|
+
return /* @__PURE__ */ a(
|
|
2254
|
+
He.button,
|
|
2255
|
+
{
|
|
2256
|
+
type: "button",
|
|
2257
|
+
...o,
|
|
2258
|
+
ref: t,
|
|
2259
|
+
onClick: ke(e.onClick, () => r.onOpenChange(!1))
|
|
2260
|
+
}
|
|
2261
|
+
);
|
|
2262
|
+
}
|
|
2263
|
+
);
|
|
2264
|
+
$n.displayName = Hn;
|
|
2265
|
+
function zt(e) {
|
|
2266
|
+
return e ? "open" : "closed";
|
|
2267
|
+
}
|
|
2268
|
+
var Gn = "DialogTitleWarning", [Ls, Vn] = Br(Gn, {
|
|
2269
|
+
contentName: Ie,
|
|
2270
|
+
titleName: Dt,
|
|
2271
|
+
docsSlug: "dialog"
|
|
2272
|
+
}), oi = ({ titleId: e }) => {
|
|
2273
|
+
const t = Vn(Gn), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2274
|
+
|
|
2275
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
2276
|
+
|
|
2277
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
|
|
2278
|
+
return U.useEffect(() => {
|
|
2279
|
+
e && (document.getElementById(e) || console.error(n));
|
|
2280
|
+
}, [n, e]), null;
|
|
2281
|
+
}, ii = "DialogDescriptionWarning", ai = ({ contentRef: e, descriptionId: t }) => {
|
|
2282
|
+
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Vn(ii).contentName}}.`;
|
|
2283
|
+
return U.useEffect(() => {
|
|
2284
|
+
var i;
|
|
2285
|
+
const r = (i = e.current) == null ? void 0 : i.getAttribute("aria-describedby");
|
|
2286
|
+
t && r && (document.getElementById(t) || console.warn(o));
|
|
2287
|
+
}, [o, e, t]), null;
|
|
2288
|
+
}, si = En, ci = zn, li = An, di = Fn, ui = Mn, pi = $n;
|
|
2289
|
+
const xe = {
|
|
2290
|
+
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2291
|
+
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
2292
|
+
"rp-document-dialog": "_rp-document-dialog_slqo7_13",
|
|
2293
|
+
"rp-document-properties": "_rp-document-properties_slqo7_35",
|
|
2294
|
+
"rp-dialog-title": "_rp-dialog-title_slqo7_39",
|
|
2295
|
+
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2296
|
+
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2297
|
+
}, hi = () => {
|
|
2298
|
+
const { pdfProperties: e } = K(), { container: t } = Te(), { activeDocumentProperties: n, setActiveDocumentProperties: o } = no(), { localeMessages: r } = ue(), i = F(() => {
|
|
2299
|
+
if (!e)
|
|
2300
|
+
return [];
|
|
2301
|
+
const {
|
|
2302
|
+
fileSize: c,
|
|
2303
|
+
filename: s,
|
|
2304
|
+
title: l,
|
|
2305
|
+
author: u,
|
|
2306
|
+
subject: d,
|
|
2307
|
+
createdOn: f,
|
|
2308
|
+
creator: h,
|
|
2309
|
+
keywords: g,
|
|
2310
|
+
modifiedOn: w,
|
|
2311
|
+
pdfProducer: b,
|
|
2312
|
+
pdfVersion: v,
|
|
2313
|
+
pageCount: _
|
|
2314
|
+
} = e;
|
|
2315
|
+
return [
|
|
2316
|
+
{ label: r == null ? void 0 : r.propertiesFilenameLabel, value: s },
|
|
2317
|
+
{ label: r == null ? void 0 : r.propertiesFileSizeLabel, value: c },
|
|
2318
|
+
{ separate: !0 },
|
|
2319
|
+
{ label: r == null ? void 0 : r.propertiesTitleLabel, value: l },
|
|
2320
|
+
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value: u },
|
|
2321
|
+
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value: d },
|
|
2322
|
+
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value: g },
|
|
2323
|
+
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value: h },
|
|
2324
|
+
{
|
|
2325
|
+
label: r == null ? void 0 : r.propertiesCreateOnLabel,
|
|
2326
|
+
value: f ? $t(f) : ""
|
|
2327
|
+
},
|
|
2328
|
+
{
|
|
2329
|
+
label: r == null ? void 0 : r.propertiesModifiedOnLabel,
|
|
2330
|
+
value: w ? $t(w) : ""
|
|
2331
|
+
},
|
|
2332
|
+
{ separate: !0 },
|
|
2333
|
+
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value: b },
|
|
2334
|
+
{ label: r == null ? void 0 : r.propertiesPDFVersionLabel, value: v },
|
|
2335
|
+
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value: _ }
|
|
2336
|
+
];
|
|
2337
|
+
}, [e, r]);
|
|
2338
|
+
return /* @__PURE__ */ a(si, { open: n, onOpenChange: o, children: /* @__PURE__ */ a(ci, { container: t, children: /* @__PURE__ */ D("div", { className: xe["rp-dialog-wrapper"], children: [
|
|
2339
|
+
/* @__PURE__ */ a(li, { className: xe["rp-dialog-overlay"] }),
|
|
2340
|
+
/* @__PURE__ */ D(di, { className: xe["rp-document-dialog"], children: [
|
|
2341
|
+
/* @__PURE__ */ a(ui, { className: xe["rp-dialog-title"], children: r == null ? void 0 : r.documentPropertiesLabel }),
|
|
2342
|
+
/* @__PURE__ */ a("div", { className: xe["rp-document-properties"], children: i.map((c, s) => /* @__PURE__ */ a("div", { children: c.separate ? /* @__PURE__ */ a("div", { className: xe["rp-properties-divider"] }) : /* @__PURE__ */ a(to, { label: c.label, value: c.value }) }, s)) }),
|
|
2343
|
+
/* @__PURE__ */ a(pi, { asChild: !0, className: xe["rp-dialog-close"], children: /* @__PURE__ */ a(vn, {}) })
|
|
2344
|
+
] })
|
|
2345
|
+
] }) }) });
|
|
2346
|
+
}, mi = {
|
|
2347
|
+
"rp-other-tool-content": "_rp-other-tool-content_su718_1"
|
|
2348
|
+
}, on = ".pdf", fi = (e) => URL.createObjectURL(e), gi = async (e) => {
|
|
2349
|
+
const n = await (await fetch(e)).blob();
|
|
2350
|
+
return fi(n);
|
|
2351
|
+
}, Un = () => {
|
|
2352
|
+
const { filename: e, pdfSrc: t } = K(), { downloadFilename: n } = _r(), o = (i) => {
|
|
2353
|
+
const c = n || i;
|
|
2354
|
+
return c.endsWith(on) ? c : `${c}${on}`;
|
|
2355
|
+
};
|
|
2356
|
+
return { download: L(async () => {
|
|
2357
|
+
if (!e || !t)
|
|
2358
|
+
throw new Error("There is no PDF source to download");
|
|
2359
|
+
const i = document.createElement("a");
|
|
2360
|
+
i.href = await gi(t), i.download = o(e), document.body.appendChild(i), i.click(), document.body.removeChild(i);
|
|
2361
|
+
}, [e, t]) };
|
|
2362
|
+
}, qn = () => {
|
|
2363
|
+
const { downloadIcon: e } = pe();
|
|
2364
|
+
return e || /* @__PURE__ */ a(so, {});
|
|
2365
|
+
}, Zn = ({ children: e, className: t, localeMessages: n }) => /* @__PURE__ */ a(q, { className: t, content: n == null ? void 0 : n.downloadFileTooltip, children: e }), vi = ({ download: e, localeMessages: t }) => /* @__PURE__ */ a(Zn, { localeMessages: t, children: /* @__PURE__ */ a(ee, { onClick: e, "aria-label": t == null ? void 0 : t.downloadFileTooltip, children: /* @__PURE__ */ a(qn, {}) }) }), _i = ({ download: e, localeMessages: t }) => /* @__PURE__ */ a(Ce, { onClick: e, children: /* @__PURE__ */ D(Zn, { className: "rp-menu-item", localeMessages: t, children: [
|
|
2366
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(qn, {}) }),
|
|
2367
|
+
t == null ? void 0 : t.downloadFileLabel
|
|
2368
|
+
] }) }), Bn = () => {
|
|
2369
|
+
const { download: e } = Un(), { downloadTool: t = !0 } = _e(), { isSmallScreen: n } = ye(), { localeMessages: o } = ue();
|
|
2370
|
+
return t ? n ? /* @__PURE__ */ a(_i, { download: e, localeMessages: o }) : typeof t == "function" ? /* @__PURE__ */ a(t, { download: e }) : t ? /* @__PURE__ */ a(vi, { download: e, localeMessages: o }) : null : null;
|
|
2371
|
+
}, jn = () => {
|
|
2372
|
+
const { printIcon: e } = pe();
|
|
2373
|
+
return e || /* @__PURE__ */ a(co, {});
|
|
2374
|
+
}, Kn = ({ children: e, className: t, localeMessages: n }) => /* @__PURE__ */ a(q, { className: t, content: n == null ? void 0 : n.printTooltip, children: e }), wi = ({ print: e, localeMessages: t }) => /* @__PURE__ */ a(Kn, { localeMessages: t, children: /* @__PURE__ */ a(ee, { onClick: e, "aria-label": t == null ? void 0 : t.printTooltip, children: /* @__PURE__ */ a(jn, {}) }) }), bi = ({ print: e, localeMessages: t }) => /* @__PURE__ */ a(Ce, { onClick: e, children: /* @__PURE__ */ D(Kn, { className: "rp-menu-item", localeMessages: t, children: [
|
|
2375
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(jn, {}) }),
|
|
2376
|
+
t == null ? void 0 : t.printLabel
|
|
2377
|
+
] }) }), Xn = () => {
|
|
2378
|
+
const { print: e, cancel: t, setOnProgress: n, setOnComplete: o, setOnError: r, progress: i } = nt(), { printTool: c = !0 } = _e(), { isSmallScreen: s } = ye(), { localeMessages: l } = ue();
|
|
2379
|
+
return c ? s ? /* @__PURE__ */ a(bi, { print: e, localeMessages: l }) : typeof c == "function" ? /* @__PURE__ */ a(
|
|
2380
|
+
c,
|
|
2381
|
+
{
|
|
2382
|
+
print: e,
|
|
2383
|
+
cancel: t,
|
|
2384
|
+
setOnProgress: n,
|
|
2385
|
+
setOnError: r,
|
|
2386
|
+
setOnComplete: o,
|
|
2387
|
+
progress: i
|
|
2388
|
+
}
|
|
2389
|
+
) : c ? /* @__PURE__ */ a(wi, { print: e, localeMessages: l }) : null : null;
|
|
2390
|
+
}, Ci = {
|
|
2391
|
+
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2392
|
+
}, Ti = () => {
|
|
2393
|
+
const { goToFirstPageIcon: e } = pe();
|
|
2394
|
+
return e || /* @__PURE__ */ a(wn, { className: Ci["rp-go-to-Top"] });
|
|
2395
|
+
}, Pi = () => {
|
|
2396
|
+
const { goToLastPageIcon: e } = pe();
|
|
2397
|
+
return e || /* @__PURE__ */ a(wn, {});
|
|
2398
|
+
}, an = { width: "100%" }, xi = () => {
|
|
2399
|
+
const { goToPage: e, totalPages: t, focusedPage: n } = ie(), { jumpNavigationTool: o = !0 } = _e(), { localeMessages: r } = ue(), i = F(() => n === 1, [n]), c = F(() => n === t, [n, t]), s = L(() => {
|
|
2400
|
+
e(1);
|
|
2401
|
+
}, [e]), l = L(() => {
|
|
2402
|
+
e(t);
|
|
2403
|
+
}, [e, t]);
|
|
2404
|
+
return o ? /* @__PURE__ */ D(Be, { children: [
|
|
2405
|
+
/* @__PURE__ */ a(Ce, { onClick: s, children: /* @__PURE__ */ a(q, { content: r == null ? void 0 : r.firstPageTooltip, style: an, children: /* @__PURE__ */ D("div", { className: "rp-menu-item", "aria-disabled": i, children: [
|
|
2406
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Ti, {}) }),
|
|
2407
|
+
/* @__PURE__ */ a("span", { children: r == null ? void 0 : r.firstPageLabel })
|
|
2408
|
+
] }) }) }),
|
|
2409
|
+
/* @__PURE__ */ a(Ce, { onClick: l, children: /* @__PURE__ */ a(q, { content: r == null ? void 0 : r.lastPageTooltip, style: an, children: /* @__PURE__ */ D("div", { className: "rp-menu-item", "aria-disabled": c, children: [
|
|
2410
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Pi, {}) }),
|
|
2411
|
+
/* @__PURE__ */ a("span", { children: r == null ? void 0 : r.lastPageLabel })
|
|
2412
|
+
] }) }) }),
|
|
2413
|
+
/* @__PURE__ */ a(Rt, {})
|
|
2414
|
+
] }) : null;
|
|
2415
|
+
}, Si = () => {
|
|
2416
|
+
const { container: e } = Te(), { isSmallScreen: t } = ye(), {
|
|
2417
|
+
openFileTool: n,
|
|
2418
|
+
downloadTool: o,
|
|
2419
|
+
documentProperties: r,
|
|
2420
|
+
scrollModeTool: i,
|
|
2421
|
+
rotateTool: c,
|
|
2422
|
+
selectionModeTool: s,
|
|
2423
|
+
jumpNavigationTool: l,
|
|
2424
|
+
printTool: u,
|
|
2425
|
+
fullscreenTool: d
|
|
2426
|
+
} = _e(), { localeMessages: f } = ue();
|
|
2427
|
+
return F(() => {
|
|
2428
|
+
const g = l || c || s || i || r;
|
|
2429
|
+
let w = !1;
|
|
2430
|
+
return t && (w = !(!n && !o && !u && !d)), g || w;
|
|
2431
|
+
}, [
|
|
2432
|
+
n,
|
|
2433
|
+
o,
|
|
2434
|
+
r,
|
|
2435
|
+
i,
|
|
2436
|
+
c,
|
|
2437
|
+
s,
|
|
2438
|
+
l,
|
|
2439
|
+
t
|
|
2440
|
+
]) ? /* @__PURE__ */ D(ro, { children: [
|
|
2441
|
+
/* @__PURE__ */ a(
|
|
2442
|
+
gn,
|
|
2443
|
+
{
|
|
2444
|
+
container: e,
|
|
2445
|
+
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(q, { content: f == null ? void 0 : f.moreOptionTooltip, children: /* @__PURE__ */ a(ee, { "aria-label": f == null ? void 0 : f.moreOptionTooltip, children: /* @__PURE__ */ a(Ur, {}) }) }) }),
|
|
2446
|
+
children: /* @__PURE__ */ D("div", { className: mi["rp-other-tool-content"], "data-rp": "moreOptionsDropdown", children: [
|
|
2447
|
+
t && /* @__PURE__ */ D(Be, { children: [
|
|
2448
|
+
/* @__PURE__ */ a(fn, {}),
|
|
2449
|
+
/* @__PURE__ */ a(Bn, {}),
|
|
2450
|
+
/* @__PURE__ */ a(Xn, {}),
|
|
2451
|
+
/* @__PURE__ */ a(_n, {}),
|
|
2452
|
+
/* @__PURE__ */ a(Rt, {})
|
|
2453
|
+
] }),
|
|
2454
|
+
/* @__PURE__ */ a(xi, {}),
|
|
2455
|
+
/* @__PURE__ */ a(io, {}),
|
|
2456
|
+
/* @__PURE__ */ a(lo, {}),
|
|
2457
|
+
/* @__PURE__ */ a(ao, {}),
|
|
2458
|
+
/* @__PURE__ */ a(oo, {})
|
|
2459
|
+
] })
|
|
2460
|
+
}
|
|
2461
|
+
),
|
|
2462
|
+
/* @__PURE__ */ a(hi, {})
|
|
2463
|
+
] }) : null;
|
|
2464
|
+
}, Ii = () => {
|
|
2465
|
+
const { isSmallScreen: e } = ye();
|
|
2466
|
+
return /* @__PURE__ */ D(Se, { children: [
|
|
2467
|
+
/* @__PURE__ */ a(Vr, {}),
|
|
2468
|
+
!e && /* @__PURE__ */ D(Se, { children: [
|
|
2469
|
+
/* @__PURE__ */ a(fn, {}),
|
|
2470
|
+
/* @__PURE__ */ a(Bn, {}),
|
|
2471
|
+
/* @__PURE__ */ a(Xn, {}),
|
|
2472
|
+
/* @__PURE__ */ a(_n, {})
|
|
2473
|
+
] }),
|
|
2474
|
+
/* @__PURE__ */ a(Si, {})
|
|
2475
|
+
] });
|
|
2476
|
+
}, Re = {
|
|
2477
|
+
"rp-zoom-wrapper": "_rp-zoom-wrapper_cocqs_1",
|
|
2478
|
+
"rp-current-zoom-wrapper": "_rp-current-zoom-wrapper_cocqs_6",
|
|
2479
|
+
"rp-current-zoom-icon": "_rp-current-zoom-icon_cocqs_11",
|
|
2480
|
+
"rp-current-zoom-text": "_rp-current-zoom-text_cocqs_16",
|
|
2481
|
+
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_cocqs_20"
|
|
2482
|
+
}, yi = 25, vt = 1e3, Li = [50, 75, 100, 125, 150, 200, 300, 400], Ri = () => {
|
|
2483
|
+
const { zoomInIcon: e } = pe();
|
|
2484
|
+
return e || /* @__PURE__ */ a(uo, {});
|
|
2485
|
+
}, Ni = () => {
|
|
2486
|
+
const { zoomOutIcon: e } = pe();
|
|
2487
|
+
return e || /* @__PURE__ */ a(po, {});
|
|
2488
|
+
}, Ei = () => {
|
|
2489
|
+
const { zoomLevel: e, setZoomLevel: t } = Je(), { container: n, contentRef: o } = Te(), { zoomTool: r = !0 } = _e(), { focusedPage: i } = ie(), { rotate: c } = Ye(), { pages: s } = K(), { isSmallScreen: l } = ye(), { localeMessages: u } = ue(), d = L(() => {
|
|
2490
|
+
t((_) => {
|
|
2491
|
+
const m = Math.floor(_ / 25) * 25;
|
|
2492
|
+
return Math.min(m + 25, vt);
|
|
2493
|
+
});
|
|
2494
|
+
}, [t]), f = L(() => {
|
|
2495
|
+
t((_) => {
|
|
2496
|
+
const m = Math.ceil(_ / 25) * 25;
|
|
2497
|
+
return Math.min(m - 25, vt);
|
|
2498
|
+
});
|
|
2499
|
+
}, [t]), h = F(() => e === yi, [e]), g = F(() => e === vt, [e]), w = F(() => {
|
|
2500
|
+
var _;
|
|
2501
|
+
return (_ = s.get(i)) == null ? void 0 : _.page.getViewport({ scale: 1, rotation: c });
|
|
2502
|
+
}, [s, i, c]), b = L(
|
|
2503
|
+
(_) => {
|
|
2504
|
+
const m = ((w == null ? void 0 : w.width) || 0) + 2 * Gt, P = ((w == null ? void 0 : w.height) || 0) + 2 * Gt, x = (o == null ? void 0 : o.clientWidth) || 0, p = (o == null ? void 0 : o.clientHeight) || 0, T = ho(_, x, p, m, P);
|
|
2505
|
+
t(T);
|
|
2506
|
+
},
|
|
2507
|
+
[t, w]
|
|
2508
|
+
), v = L(
|
|
2509
|
+
(_) => {
|
|
2510
|
+
typeof _ == "number" ? t(_) : b(_);
|
|
2511
|
+
},
|
|
2512
|
+
[t, b]
|
|
2513
|
+
);
|
|
2514
|
+
return typeof r != "boolean" ? /* @__PURE__ */ a(r, { zoomLevel: e, setZoomLevel: t }) : r ? /* @__PURE__ */ D("div", { className: Re["rp-zoom-wrapper"], children: [
|
|
2515
|
+
/* @__PURE__ */ a(q, { content: u == null ? void 0 : u.zoomOutTooltip, children: /* @__PURE__ */ a(
|
|
2516
|
+
ee,
|
|
2517
|
+
{
|
|
2518
|
+
disabled: h,
|
|
2519
|
+
onClick: f,
|
|
2520
|
+
"aria-label": u == null ? void 0 : u.zoomOutTooltip,
|
|
2521
|
+
children: /* @__PURE__ */ a(Ni, {})
|
|
2522
|
+
}
|
|
2523
|
+
) }),
|
|
2524
|
+
!l && /* @__PURE__ */ a(
|
|
2525
|
+
gn,
|
|
2526
|
+
{
|
|
2527
|
+
container: n,
|
|
2528
|
+
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(q, { content: u == null ? void 0 : u.zoomSelectTooltip, children: /* @__PURE__ */ D(
|
|
2529
|
+
ee,
|
|
2530
|
+
{
|
|
2531
|
+
className: Re["rp-current-zoom-wrapper"],
|
|
2532
|
+
"aria-label": u == null ? void 0 : u.zoomSelectTooltip,
|
|
2533
|
+
children: [
|
|
2534
|
+
/* @__PURE__ */ a("span", { className: Re["rp-current-zoom-text"], children: e }),
|
|
2535
|
+
/* @__PURE__ */ a("span", { className: Re["rp-current-zoom-text"], children: "%" }),
|
|
2536
|
+
/* @__PURE__ */ a(Me, { className: Re["rp-current-zoom-icon"] })
|
|
2537
|
+
]
|
|
2538
|
+
}
|
|
2539
|
+
) }) }),
|
|
2540
|
+
style: { minWidth: "200px" },
|
|
2541
|
+
align: "center",
|
|
2542
|
+
children: /* @__PURE__ */ D("div", { className: Re["rp-zoom-dropdown-content"], children: [
|
|
2543
|
+
/* @__PURE__ */ D(Be, { children: [
|
|
2544
|
+
/* @__PURE__ */ a(Ce, { onClick: () => v(it.ACTUAL), children: u == null ? void 0 : u.zoomActualSize }),
|
|
2545
|
+
/* @__PURE__ */ a(Ce, { onClick: () => v(it.PAGE_FIT), children: u == null ? void 0 : u.zoomPageFit }),
|
|
2546
|
+
/* @__PURE__ */ a(Ce, { onClick: () => v(it.PAGE_WIDTH), children: u == null ? void 0 : u.zoomPageWidth })
|
|
2547
|
+
] }),
|
|
2548
|
+
/* @__PURE__ */ a(Rt, {}),
|
|
2549
|
+
/* @__PURE__ */ a(Be, { children: Li.map((_) => /* @__PURE__ */ D(Ce, { onClick: () => v(_), children: [
|
|
2550
|
+
_,
|
|
2551
|
+
" %"
|
|
2552
|
+
] }, _)) })
|
|
2553
|
+
] })
|
|
2554
|
+
}
|
|
2555
|
+
),
|
|
2556
|
+
/* @__PURE__ */ a(q, { content: u == null ? void 0 : u.zoomInTooltip, children: /* @__PURE__ */ a(
|
|
2557
|
+
ee,
|
|
2558
|
+
{
|
|
2559
|
+
disabled: g,
|
|
2560
|
+
onClick: d,
|
|
2561
|
+
"aria-label": u == null ? void 0 : u.zoomInTooltip,
|
|
2562
|
+
children: /* @__PURE__ */ a(Ri, {})
|
|
2563
|
+
}
|
|
2564
|
+
) })
|
|
2565
|
+
] }) : null;
|
|
2566
|
+
}, Q = {
|
|
2567
|
+
"rp-search-tool-content": "_rp-search-tool-content_lnthn_1",
|
|
2568
|
+
"rp-search-tool-input": "_rp-search-tool-input_lnthn_10",
|
|
2569
|
+
"rp-search-tool-input-icon": "_rp-search-tool-input-icon_lnthn_17",
|
|
2570
|
+
"rp-search-tool-controls": "_rp-search-tool-controls_lnthn_27",
|
|
2571
|
+
"rp-search-tool-input-wrapper": "_rp-search-tool-input-wrapper_lnthn_35",
|
|
2572
|
+
"rp-search-tool-input-checkboxes": "_rp-search-tool-input-checkboxes_lnthn_41",
|
|
2573
|
+
"rp-search-tool-input-clear": "_rp-search-tool-input-clear_lnthn_46",
|
|
2574
|
+
"rp-search-input": "_rp-search-input_lnthn_60",
|
|
2575
|
+
"rp-search-icon-info": "_rp-search-icon-info_lnthn_65",
|
|
2576
|
+
"rp-search-loader-icon": "_rp-search-loader-icon_lnthn_74"
|
|
2577
|
+
}, sn = () => {
|
|
2578
|
+
const { searchIcon: e } = pe();
|
|
2579
|
+
return e || /* @__PURE__ */ a(mo, {});
|
|
2580
|
+
}, Oi = () => {
|
|
2581
|
+
const { container: e } = Te(), [t, n] = $(!1), { pdf: o } = K(), [r, i] = $(null), {
|
|
2582
|
+
searchOptions: c,
|
|
2583
|
+
setSearchOptions: s,
|
|
2584
|
+
loading: l,
|
|
2585
|
+
setSearch: u,
|
|
2586
|
+
totalMatches: d,
|
|
2587
|
+
currentMatchPosition: f,
|
|
2588
|
+
nextMatch: h,
|
|
2589
|
+
prevMatch: g,
|
|
2590
|
+
search: w
|
|
2591
|
+
} = In(), { searchTool: b = !0 } = _e(), [v, _] = $(w), { localeMessages: m } = ue(), P = L(() => {
|
|
2592
|
+
n(!0);
|
|
2593
|
+
}, []), x = L(() => {
|
|
2594
|
+
u(""), _(""), n(!1);
|
|
2595
|
+
}, [u]), p = (I) => {
|
|
2596
|
+
const E = I.key === "Enter", W = I.key === " ";
|
|
2597
|
+
(E || W) && x();
|
|
2598
|
+
}, T = L(
|
|
2599
|
+
(I) => {
|
|
2600
|
+
I.key === "Escape" && t && x();
|
|
2601
|
+
},
|
|
2602
|
+
[t]
|
|
2603
|
+
), C = L(
|
|
2604
|
+
(I) => {
|
|
2605
|
+
I.shiftKey && I.key === "Enter" ? g() : I.key === "Enter" && w !== v ? u(v) : I.key === "Enter" && h();
|
|
2606
|
+
},
|
|
2607
|
+
[v, g, h, u, w]
|
|
2608
|
+
);
|
|
2609
|
+
A(() => (window.addEventListener("keydown", T), () => {
|
|
2610
|
+
window.removeEventListener("keydown", T);
|
|
2611
|
+
}), [T]), A(() => {
|
|
2612
|
+
r && r.focus();
|
|
2613
|
+
}, [r]);
|
|
2614
|
+
const S = L((I) => {
|
|
2615
|
+
_(I.target.value);
|
|
2616
|
+
}, []), N = L(() => {
|
|
2617
|
+
_(""), u("");
|
|
2618
|
+
}, [u]), y = F(() => `${f} / ${d}`, [f, d]), { wholeWords: O, matchCase: R } = F(() => c, [c]), k = L(
|
|
2619
|
+
(I) => {
|
|
2620
|
+
s((E) => ({ ...E, matchCase: I }));
|
|
2621
|
+
},
|
|
2622
|
+
[s]
|
|
2623
|
+
), z = L(
|
|
2624
|
+
(I) => {
|
|
2625
|
+
s((E) => ({ ...E, wholeWords: I }));
|
|
2626
|
+
},
|
|
2627
|
+
[s]
|
|
2628
|
+
);
|
|
2629
|
+
return A(() => {
|
|
2630
|
+
x();
|
|
2631
|
+
}, [o, x]), b ? /* @__PURE__ */ a(Se, { children: /* @__PURE__ */ a(
|
|
2632
|
+
Fr,
|
|
2633
|
+
{
|
|
2634
|
+
open: t,
|
|
2635
|
+
container: e,
|
|
2636
|
+
triggerComponent: /* @__PURE__ */ a(q, { content: m == null ? void 0 : m.searchButtonTooltip, children: /* @__PURE__ */ a(ee, { onClick: P, "aria-label": m == null ? void 0 : m.searchButtonTooltip, children: /* @__PURE__ */ a(sn, {}) }) }),
|
|
2637
|
+
children: /* @__PURE__ */ D("div", { className: Q["rp-search-tool-content"], children: [
|
|
2638
|
+
/* @__PURE__ */ D("div", { className: Q["rp-search-tool-input-wrapper"], children: [
|
|
2639
|
+
/* @__PURE__ */ D("div", { className: Q["rp-search-tool-input"], children: [
|
|
2640
|
+
/* @__PURE__ */ a(q, { content: m == null ? void 0 : m.searchInputTooltip, children: /* @__PURE__ */ a(
|
|
2641
|
+
dn,
|
|
2642
|
+
{
|
|
2643
|
+
value: v,
|
|
2644
|
+
onKeyDown: C,
|
|
2645
|
+
onChange: S,
|
|
2646
|
+
icon: /* @__PURE__ */ a(sn, {}),
|
|
2647
|
+
placeholder: m == null ? void 0 : m.searchInputPlaceholder,
|
|
2648
|
+
className: Q["rp-search-input"],
|
|
2649
|
+
ref: i,
|
|
2650
|
+
children: !!v && /* @__PURE__ */ a("span", { className: Q["rp-search-tool-input-clear"], onClick: N, children: /* @__PURE__ */ a(fo, {}) })
|
|
2651
|
+
}
|
|
2652
|
+
) }),
|
|
2653
|
+
l ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(St, { className: Q["rp-search-loader-icon"] }) }) : /* @__PURE__ */ a("span", { children: y })
|
|
2654
|
+
] }),
|
|
2655
|
+
/* @__PURE__ */ D("div", { className: Q["rp-search-tool-input-checkboxes"], children: [
|
|
2656
|
+
/* @__PURE__ */ a(Vt, { name: "matchCase", value: R, onChange: k, children: m == null ? void 0 : m.searchMatchCaseLabel }),
|
|
2657
|
+
/* @__PURE__ */ a(q, { content: m == null ? void 0 : m.searchMatchCaseTooltip, children: /* @__PURE__ */ a("div", { className: Q["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ a(Ut, {}) }) }),
|
|
2658
|
+
/* @__PURE__ */ a(Vt, { name: "wholeWord", value: O, onChange: z, children: m == null ? void 0 : m.searchWholeWordsLabel }),
|
|
2659
|
+
/* @__PURE__ */ a(q, { content: m == null ? void 0 : m.searchWholeWordsTooltip, children: /* @__PURE__ */ a("div", { className: Q["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ a(Ut, {}) }) })
|
|
2660
|
+
] })
|
|
2661
|
+
] }),
|
|
2662
|
+
/* @__PURE__ */ D("div", { className: Q["rp-search-tool-controls"], children: [
|
|
2663
|
+
/* @__PURE__ */ a(q, { content: m == null ? void 0 : m.searchPrevTooltip, children: /* @__PURE__ */ a(ee, { onClick: g, "aria-label": m == null ? void 0 : m.searchPrevTooltip, children: /* @__PURE__ */ a(
|
|
2664
|
+
Me,
|
|
2665
|
+
{
|
|
2666
|
+
className: Q["rp-search-tool-input-icon"],
|
|
2667
|
+
"aria-disabled": !d
|
|
2668
|
+
}
|
|
2669
|
+
) }) }),
|
|
2670
|
+
/* @__PURE__ */ a(q, { content: m == null ? void 0 : m.searchNextTooltip, children: /* @__PURE__ */ a(ee, { onClick: h, "aria-label": m == null ? void 0 : m.searchNextTooltip, children: /* @__PURE__ */ a(
|
|
2671
|
+
Me,
|
|
2672
|
+
{
|
|
2673
|
+
style: { transform: "rotate(180deg" },
|
|
2674
|
+
className: Q["rp-search-tool-input-icon"],
|
|
2675
|
+
"aria-disabled": !d
|
|
2676
|
+
}
|
|
2677
|
+
) }) }),
|
|
2678
|
+
/* @__PURE__ */ a(q, { content: m == null ? void 0 : m.searchCloseButtonTooltip, children: /* @__PURE__ */ a(
|
|
2679
|
+
ee,
|
|
2680
|
+
{
|
|
2681
|
+
onKeyDown: p,
|
|
2682
|
+
"aria-label": m == null ? void 0 : m.searchCloseButtonTooltip,
|
|
2683
|
+
children: /* @__PURE__ */ a(vn, { onClick: x, className: Q["rp-search-tool-input-icon"] })
|
|
2684
|
+
}
|
|
2685
|
+
) })
|
|
2686
|
+
] })
|
|
2687
|
+
] })
|
|
2688
|
+
}
|
|
2689
|
+
) }) : null;
|
|
2690
|
+
}, Di = "_loading_vpexk_1", Ne = {
|
|
2691
|
+
"rp-loading-overlay": "_rp-loading-overlay_vpexk_1",
|
|
2692
|
+
"rp-loading-modal": "_rp-loading-modal_vpexk_14",
|
|
2693
|
+
"rp-loading-title": "_rp-loading-title_vpexk_27",
|
|
2694
|
+
"rp-loading-progress-bar": "_rp-loading-progress-bar_vpexk_35",
|
|
2695
|
+
"rp-loading-progress": "_rp-loading-progress_vpexk_35",
|
|
2696
|
+
"rp-loading-cancel-button": "_rp-loading-cancel-button_vpexk_55",
|
|
2697
|
+
loading: Di
|
|
2698
|
+
}, zi = ({ percentage: e }) => {
|
|
2699
|
+
const { cancel: t } = nt(), { localeMessages: n } = ue();
|
|
2700
|
+
return e < 1 ? null : /* @__PURE__ */ a("div", { className: re(Ne["rp-loading-overlay"]), children: /* @__PURE__ */ D("div", { className: re(Ne["rp-loading-modal"]), children: [
|
|
2701
|
+
/* @__PURE__ */ D("div", { className: re(Ne["rp-loading-title"]), children: [
|
|
2702
|
+
n == null ? void 0 : n.printLoadingMessage,
|
|
2703
|
+
"..."
|
|
2704
|
+
] }),
|
|
2705
|
+
/* @__PURE__ */ a("div", { className: re(Ne["rp-loading-progress-bar"]), children: /* @__PURE__ */ a(
|
|
2706
|
+
"div",
|
|
2707
|
+
{
|
|
2708
|
+
className: re(Ne["rp-loading-progress"]),
|
|
2709
|
+
style: { width: `${e}%` }
|
|
2710
|
+
}
|
|
2711
|
+
) }),
|
|
2712
|
+
/* @__PURE__ */ a("button", { className: re(Ne["rp-loading-cancel-button"]), onClick: t, children: n == null ? void 0 : n.printCancelLabel })
|
|
2713
|
+
] }) });
|
|
2714
|
+
}, Ai = We((e, t) => {
|
|
2715
|
+
const { showPrintProgress: n } = _e(), { progress: o } = nt(), { isSmallScreen: r } = ye(), { percentage: i } = o || {}, c = () => r ? { gridTemplateColumns: "25% 60% 15%" } : void 0;
|
|
2716
|
+
return /* @__PURE__ */ D("div", { children: [
|
|
2717
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBar", ref: t, className: Ae["rp-toolbar-content"], children: /* @__PURE__ */ D("div", { className: Ae["rp-toolbar-wrapper"], style: c(), children: [
|
|
2718
|
+
/* @__PURE__ */ D("div", { "data-rp": "topBarLeft", className: Ae["rp-toolbar-start"], children: [
|
|
2719
|
+
/* @__PURE__ */ a(Oi, {}),
|
|
2720
|
+
/* @__PURE__ */ a(Xo, {})
|
|
2721
|
+
] }),
|
|
2722
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarCenter", className: Ae["rp-toolbar-middle"], children: /* @__PURE__ */ a(Ei, {}) }),
|
|
2723
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarRight", className: Ae["rp-toolbar-end"], children: /* @__PURE__ */ a(Ii, {}) })
|
|
2724
|
+
] }) }),
|
|
2725
|
+
n && i ? /* @__PURE__ */ a(zi, { percentage: i }) : null
|
|
2726
|
+
] });
|
|
2727
|
+
}), _t = {
|
|
2728
|
+
"rp-sidebar-content-wrapper": "_rp-sidebar-content-wrapper_1sdl6_1",
|
|
2729
|
+
"rp-sidebar-content": "_rp-sidebar-content_1sdl6_1",
|
|
2730
|
+
"rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_1sdl6_16",
|
|
2731
|
+
"rp-thumbnail-dragging": "_rp-thumbnail-dragging_1sdl6_21"
|
|
2732
|
+
}, Fe = {
|
|
2733
|
+
"rp-thumbnail-wrapper": "_rp-thumbnail-wrapper_3fenb_1",
|
|
2734
|
+
"rp-thumbnail-text": "_rp-thumbnail-text_3fenb_10",
|
|
2735
|
+
"rp-thumbnail": "_rp-thumbnail_3fenb_1",
|
|
2736
|
+
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
2737
|
+
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
2738
|
+
}, Fi = (e) => {
|
|
2739
|
+
const { thumbnailSrc: t, pageNumber: n, isFocused: o, viewport: r } = e, { goToPage: i } = ie(), c = F(() => o ? Fe["rp-thumbnail-active"] : "", [o]), s = F(() => ({
|
|
2740
|
+
width: Math.round(r.width),
|
|
2741
|
+
height: Math.round(r.height)
|
|
2742
|
+
}), [r]), l = L(() => {
|
|
2743
|
+
n && i(n);
|
|
2744
|
+
}, [i, n]);
|
|
2745
|
+
return /* @__PURE__ */ D(
|
|
2746
|
+
"div",
|
|
2747
|
+
{
|
|
2748
|
+
onClick: l,
|
|
2749
|
+
id: `page-${n}`,
|
|
2750
|
+
className: Fe["rp-thumbnail-wrapper"],
|
|
2751
|
+
children: [
|
|
2752
|
+
/* @__PURE__ */ a("div", { className: re(c, Fe["rp-thumbnail"]), children: t ? /* @__PURE__ */ a(
|
|
2753
|
+
"img",
|
|
2754
|
+
{
|
|
2755
|
+
src: t,
|
|
2756
|
+
width: s.width,
|
|
2757
|
+
height: s.height,
|
|
2758
|
+
alt: "thumbnail"
|
|
2759
|
+
}
|
|
2760
|
+
) : /* @__PURE__ */ a(
|
|
2761
|
+
"div",
|
|
2762
|
+
{
|
|
2763
|
+
className: Fe["rp-thumbnail-loader"],
|
|
2764
|
+
style: {
|
|
2765
|
+
width: `${s.width}px`,
|
|
2766
|
+
height: `${s.height}px`
|
|
2767
|
+
},
|
|
2768
|
+
children: /* @__PURE__ */ a(St, {})
|
|
2769
|
+
}
|
|
2770
|
+
) }),
|
|
2771
|
+
/* @__PURE__ */ a("div", { className: Fe["rp-thumbnail-text"], children: n })
|
|
2772
|
+
]
|
|
2773
|
+
}
|
|
2774
|
+
);
|
|
2775
|
+
}, cn = {
|
|
2776
|
+
"rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
|
|
2777
|
+
"rp-thumbnails": "_rp-thumbnails_16vqr_1"
|
|
2778
|
+
}, ki = 16, Mi = (e, t) => {
|
|
2779
|
+
const n = e == null ? void 0 : e.querySelector(`#page-${t}`);
|
|
2780
|
+
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) - ki);
|
|
2781
|
+
}, Wi = We((e, t) => {
|
|
2782
|
+
const { show: n } = e, { focusedPage: o, totalPages: r } = ie(), { thumbnailPages: i, addPage: c, thumbnailLength: s, addToPage: l } = xn(), u = M(null), d = M(1);
|
|
2783
|
+
ln(t, () => u.current);
|
|
2784
|
+
const f = F(() => Object.values(i), [i]), h = L(() => {
|
|
2785
|
+
const g = s + 1;
|
|
2786
|
+
g <= r && c(g);
|
|
2787
|
+
}, [c, r, s]);
|
|
2788
|
+
return A(() => {
|
|
2789
|
+
o > s ? l(o) : n && d.current !== o && (Mi(u.current, o), d.current = o);
|
|
2790
|
+
}, [o, s, l, n, f]), br(u.current, h), /* @__PURE__ */ a("div", { ref: u, className: cn["rp-thumbnails-container"], children: /* @__PURE__ */ a("div", { className: cn["rp-thumbnails"], children: n ? f.map((g, w) => {
|
|
2791
|
+
var b, v;
|
|
2792
|
+
return /* @__PURE__ */ a(
|
|
2793
|
+
Fi,
|
|
2794
|
+
{
|
|
2795
|
+
isFocused: o === ((b = g.page) == null ? void 0 : b.pageNumber),
|
|
2796
|
+
pageNumber: (v = g.page) == null ? void 0 : v.pageNumber,
|
|
2797
|
+
thumbnailSrc: g.thumbnailSrc,
|
|
2798
|
+
loading: g.loading,
|
|
2799
|
+
viewport: g.viewport
|
|
2800
|
+
},
|
|
2801
|
+
w
|
|
2802
|
+
);
|
|
2803
|
+
}) : null }) });
|
|
2804
|
+
}), Hi = () => {
|
|
2805
|
+
const { thumbnailIcon: e } = pe();
|
|
2806
|
+
return e || /* @__PURE__ */ a(wr, {});
|
|
2807
|
+
}, $i = () => {
|
|
2808
|
+
const { active: e, setActive: t } = xn(), [n, o] = $(200), r = M(null), { thumbnailTool: i, sidebarEnable: c } = _e(), { localeMessages: s } = ue(), l = L(() => {
|
|
2809
|
+
t((d) => !d);
|
|
2810
|
+
}, []), u = F(() => typeof i != "boolean" && i ? /* @__PURE__ */ a(i, { onClick: l, active: e }) : i ? /* @__PURE__ */ a(q, { content: s == null ? void 0 : s.thumbnailTooltip, children: /* @__PURE__ */ a(
|
|
2811
|
+
ee,
|
|
2812
|
+
{
|
|
2813
|
+
onClick: l,
|
|
2814
|
+
active: e,
|
|
2815
|
+
"aria-label": s == null ? void 0 : s.thumbnailTooltip,
|
|
2816
|
+
children: /* @__PURE__ */ a(Hi, {})
|
|
2817
|
+
}
|
|
2818
|
+
) }) : null, [i, e, l, s]);
|
|
2819
|
+
return /* @__PURE__ */ a(Se, { children: c && /* @__PURE__ */ D(
|
|
2820
|
+
"div",
|
|
2821
|
+
{
|
|
2822
|
+
style: { "--rp-thumbnail-width": `${n}px` },
|
|
2823
|
+
className: _t["rp-sidebar-content-wrapper"],
|
|
2824
|
+
"data-rp": "sidebar",
|
|
2825
|
+
children: [
|
|
2826
|
+
/* @__PURE__ */ a("div", { className: _t["rp-sidebar-content"], children: u }),
|
|
2827
|
+
/* @__PURE__ */ D(
|
|
2828
|
+
"div",
|
|
2829
|
+
{
|
|
2830
|
+
"data-rp": "thumbnailSidebar",
|
|
2831
|
+
hidden: !e,
|
|
2832
|
+
className: _t["rp-thumbnails-wrapper"],
|
|
2833
|
+
children: [
|
|
2834
|
+
/* @__PURE__ */ a(Wi, { show: e, ref: r }),
|
|
2835
|
+
/* @__PURE__ */ a(Cr, { onWidthChange: o, thumbnailRef: r })
|
|
2836
|
+
]
|
|
2837
|
+
}
|
|
2838
|
+
)
|
|
2839
|
+
]
|
|
2840
|
+
}
|
|
2841
|
+
) });
|
|
2842
|
+
}, be = {
|
|
2843
|
+
"rp-layout": "_rp-layout_12d1x_1",
|
|
2844
|
+
"rp-content": "_rp-content_12d1x_5",
|
|
2845
|
+
"rp-pages": "_rp-pages_12d1x_11",
|
|
2846
|
+
"rp-container": "_rp-container_12d1x_16",
|
|
2847
|
+
"rp-loader": "_rp-loader_12d1x_52",
|
|
2848
|
+
"rp-theme-variables": "_rp-theme-variables_12d1x_56",
|
|
2849
|
+
"rp-dark-mode": "_rp-dark-mode_12d1x_147"
|
|
2850
|
+
}, Gi = We(
|
|
2851
|
+
(e, t) => {
|
|
2852
|
+
const { children: n, toolbarRef: o, style: r, className: i } = e, { customVariables: c, customDarkVariables: s } = Lr(), { darkMode: l } = ir();
|
|
2853
|
+
return /* @__PURE__ */ a(
|
|
2854
|
+
"div",
|
|
2855
|
+
{
|
|
2856
|
+
ref: t,
|
|
2857
|
+
className: re(
|
|
2858
|
+
be["rp-theme-variables"],
|
|
2859
|
+
be["rp-container"],
|
|
2860
|
+
l ? be["rp-dark-mode"] : "",
|
|
2861
|
+
i
|
|
2862
|
+
),
|
|
2863
|
+
style: {
|
|
2864
|
+
"--rp-toolbar-height": `${(o == null ? void 0 : o.clientHeight) || 48}px`,
|
|
2865
|
+
...c,
|
|
2866
|
+
...l ? s : {},
|
|
2867
|
+
...r
|
|
2868
|
+
},
|
|
2869
|
+
children: n
|
|
2870
|
+
}
|
|
2871
|
+
);
|
|
2872
|
+
}
|
|
2873
|
+
), Rs = We((e, t) => {
|
|
2874
|
+
const {
|
|
2875
|
+
children: n,
|
|
2876
|
+
slots: o,
|
|
2877
|
+
icons: r,
|
|
2878
|
+
style: i,
|
|
2879
|
+
className: c,
|
|
2880
|
+
mobileWidth: s,
|
|
2881
|
+
onLoaded: l,
|
|
2882
|
+
cleanupOnLoaded: u,
|
|
2883
|
+
onLayoutWidthChange: d
|
|
2884
|
+
} = e, [f, h] = $(null), { setContainer: g, setContentRef: w } = Te(), { loading: b } = K(), { LoaderImageComponent: v } = mn();
|
|
2885
|
+
return A(() => (l && l(), () => {
|
|
2886
|
+
u && u();
|
|
2887
|
+
}), [l, u]), /* @__PURE__ */ a(Gi, { toolbarRef: f, ref: t, children: /* @__PURE__ */ a(yr, { mobileWidth: s, onLayoutWidthChange: d, children: /* @__PURE__ */ a(Tr, { slots: o, children: /* @__PURE__ */ a(Pr, { icons: r, children: /* @__PURE__ */ D(xr, { getContainerRef: g, style: i, className: c, children: [
|
|
2888
|
+
/* @__PURE__ */ D(Sr, { children: [
|
|
2889
|
+
/* @__PURE__ */ D("div", { className: be["rp-layout"], children: [
|
|
2890
|
+
/* @__PURE__ */ a(Ai, { ref: h }),
|
|
2891
|
+
/* @__PURE__ */ D("div", { className: be["rp-content"], children: [
|
|
2892
|
+
/* @__PURE__ */ a("div", { className: be["rp-sidebar"], children: /* @__PURE__ */ a($i, {}) }),
|
|
2893
|
+
/* @__PURE__ */ a("div", { ref: w, className: be["rp-pages"], children: n })
|
|
2894
|
+
] })
|
|
2895
|
+
] }),
|
|
2896
|
+
/* @__PURE__ */ a(Ir, {})
|
|
2897
|
+
] }),
|
|
2898
|
+
b ? /* @__PURE__ */ a(
|
|
2899
|
+
"div",
|
|
2900
|
+
{
|
|
2901
|
+
className: be["rp-loader"],
|
|
2902
|
+
style: {
|
|
2903
|
+
position: "absolute",
|
|
2904
|
+
top: 0,
|
|
2905
|
+
left: 0,
|
|
2906
|
+
right: 0,
|
|
2907
|
+
bottom: 0,
|
|
2908
|
+
width: "100%",
|
|
2909
|
+
height: "100%"
|
|
2910
|
+
},
|
|
2911
|
+
children: /* @__PURE__ */ a(
|
|
2912
|
+
"div",
|
|
2913
|
+
{
|
|
2914
|
+
style: {
|
|
2915
|
+
display: "flex",
|
|
2916
|
+
justifyContent: "center",
|
|
2917
|
+
alignItems: "center",
|
|
2918
|
+
height: "100%",
|
|
2919
|
+
width: "100%"
|
|
2920
|
+
},
|
|
2921
|
+
children: v && /* @__PURE__ */ a(v, {})
|
|
2922
|
+
}
|
|
2923
|
+
)
|
|
2924
|
+
}
|
|
2925
|
+
) : null
|
|
2926
|
+
] }) }) }) }) });
|
|
2927
|
+
});
|
|
2928
|
+
export {
|
|
2929
|
+
xo as A,
|
|
2930
|
+
Oi as B,
|
|
2931
|
+
bo as C,
|
|
2932
|
+
Uo as D,
|
|
2933
|
+
Ai as E,
|
|
2934
|
+
Bn as F,
|
|
2935
|
+
Fi as G,
|
|
2936
|
+
Wi as H,
|
|
2937
|
+
$i as I,
|
|
2938
|
+
Gi as J,
|
|
2939
|
+
zi as L,
|
|
2940
|
+
xi as M,
|
|
2941
|
+
Si as O,
|
|
2942
|
+
Ts as P,
|
|
2943
|
+
Is as R,
|
|
2944
|
+
Ss as S,
|
|
2945
|
+
xs as T,
|
|
2946
|
+
Ei as Z,
|
|
2947
|
+
Ps as a,
|
|
2948
|
+
Rs as b,
|
|
2949
|
+
Un as c,
|
|
2950
|
+
nt as d,
|
|
2951
|
+
In as e,
|
|
2952
|
+
bn as f,
|
|
2953
|
+
go as g,
|
|
2954
|
+
Cn as h,
|
|
2955
|
+
vo as i,
|
|
2956
|
+
Tn as j,
|
|
2957
|
+
_o as k,
|
|
2958
|
+
Pn as l,
|
|
2959
|
+
xn as m,
|
|
2960
|
+
wo as n,
|
|
2961
|
+
Sn as o,
|
|
2962
|
+
Co as p,
|
|
2963
|
+
So as q,
|
|
2964
|
+
Nt as r,
|
|
2965
|
+
$o as s,
|
|
2966
|
+
qo as t,
|
|
2967
|
+
ie as u,
|
|
2968
|
+
Zo as v,
|
|
2969
|
+
Xo as w,
|
|
2970
|
+
hi as x,
|
|
2971
|
+
Xn as y,
|
|
2972
|
+
Ii as z
|
|
2973
|
+
};
|