@pdf-viewer/react 0.5.0-beta.0 → 0.5.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RPLayout-88110444.js → RPLayout-fab108d3.js} +663 -665
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPViewer.js +1 -1
- package/dist/components/layout/RPLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/OtherTool.js +1 -1
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +1 -1
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/contexts/PaginateContext.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/main.js +1 -1
- package/dist/utils/hooks/useFileDownload.js +1 -1
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a, jsxs as O, Fragment as Ae } from "react/jsx-runtime";
|
|
2
2
|
import * as V from "react";
|
|
3
|
-
import { useRef as $, useEffect as
|
|
3
|
+
import { useRef as $, useEffect as A, useCallback as M, useState as F, useMemo as D, createContext as We, useContext as He, forwardRef as $e, useImperativeHandle as qt, createElement as Ne, PureComponent as zn, Component as Fn, memo as kn } from "react";
|
|
4
4
|
import { ChevronUpIcon as Me } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as B } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as Zt } from "./components/ui/Input.js";
|
|
@@ -27,7 +27,7 @@ import { AnnotationLayer as er, PixelsPerInch as tr, AnnotationMode as nr, Rende
|
|
|
27
27
|
import { getThumbnailViewport as It } from "./utils/getThumbnailViewport.js";
|
|
28
28
|
import { useInfiniteScroll as or } from "./utils/hooks/useInfiniteScroll.js";
|
|
29
29
|
import { RPSplitter as ar } from "./components/layout/sidebar/RPSplitter.js";
|
|
30
|
-
import { useIconContext as
|
|
30
|
+
import { useIconContext as re, IconProvider as ir } from "./contexts/IconContext.js";
|
|
31
31
|
import X from "./components/ui/RPTooltip.js";
|
|
32
32
|
import { c as he, C as sr } from "./Container-337e1b18.js";
|
|
33
33
|
import { useLayoutContainer as qe, LayoutContainerProvider as lr } from "./contexts/LayoutContainerContext.js";
|
|
@@ -48,12 +48,12 @@ import { usePageDimension as Xt } from "./utils/hooks/usePageDimension.js";
|
|
|
48
48
|
import { useMousePressed as Tr } from "./utils/hooks/useMousePressed.js";
|
|
49
49
|
import { useGrabScroll as Ir } from "./utils/hooks/useGrabScroll.js";
|
|
50
50
|
import { useDebounce as yr } from "./utils/hooks/useDebounce.js";
|
|
51
|
-
import { appConsole as
|
|
51
|
+
import { appConsole as Rr } from "./utils/appConsole.js";
|
|
52
52
|
import { FileUploadTool as Jt } from "./components/layout/toolbar/FileUploadTool.js";
|
|
53
|
-
import { DarkModeTool as
|
|
53
|
+
import { DarkModeTool as xr } from "./components/layout/toolbar/DarkModeTool.js";
|
|
54
54
|
import { ThreeDotIcon as Mr } from "./components/icons/ThreeDotIcon.js";
|
|
55
55
|
import { UIDropDown as ft } from "./components/ui/DropDown.js";
|
|
56
|
-
import { c as Lr, u as mt, a as Le, b as
|
|
56
|
+
import { c as Lr, u as mt, a as Le, b as xe, d as gt, e as Nr, f as Er, h as Or, g as Dr, F as Ar, D as zr, i as Fr, j as kr, k as Be, l as Wr, G as Fe } from "./index-8049287f.js";
|
|
57
57
|
import { CloseIcon as Yt } from "./components/icons/CloseIcon.js";
|
|
58
58
|
import { PropertyItem as Hr } from "./components/layout/toolbar/PropertyItem.js";
|
|
59
59
|
import { useOtherToolContext as $r, OtherToolProvider as Vr } from "./contexts/OtherToolContext.js";
|
|
@@ -71,7 +71,7 @@ import { ZoomInIcon as Kr } from "./components/icons/ZoomInIcon.js";
|
|
|
71
71
|
import { ZoomOutIcon as Xr } from "./components/icons/ZoomOutIcon.js";
|
|
72
72
|
import { PAGE_PADDING as yt } from "./utils/constants.js";
|
|
73
73
|
import { SearchIcon as Jr } from "./components/icons/SearchIcon.js";
|
|
74
|
-
import { UICheckbox as
|
|
74
|
+
import { UICheckbox as Rt } from "./components/ui/Checkbox.js";
|
|
75
75
|
import { ClearIcon as Yr } from "./components/icons/ClearIcon.js";
|
|
76
76
|
import './assets/RPLayout.css';const ae = {
|
|
77
77
|
"rp-pages": "_rp-pages_34orh_1",
|
|
@@ -87,16 +87,16 @@ import './assets/RPLayout.css';const ae = {
|
|
|
87
87
|
"rp-loader-wrapper": "_rp-loader-wrapper_h7a2q_14"
|
|
88
88
|
}, Qr = (e) => {
|
|
89
89
|
const { pageNumber: t, onLoaded: n, onLoading: r } = e, o = $(null), { pages: i } = Y(), { rotate: l } = Ve(), s = $(), { currentZoom: c } = ht();
|
|
90
|
-
return
|
|
90
|
+
return A(() => {
|
|
91
91
|
if (!i || c === 0)
|
|
92
92
|
return;
|
|
93
|
-
const
|
|
94
|
-
if (o.current &&
|
|
95
|
-
const
|
|
96
|
-
|
|
93
|
+
const p = i.get(t);
|
|
94
|
+
if (o.current && p) {
|
|
95
|
+
const h = o.current;
|
|
96
|
+
h.hidden = !0;
|
|
97
97
|
const m = s.current;
|
|
98
|
-
m && m.cancel(), r && r(), s.current = ot(
|
|
99
|
-
|
|
98
|
+
m && m.cancel(), r && r(), s.current = ot(p.page, h, c, l), s.current.promise.then(() => {
|
|
99
|
+
h.hidden = !1;
|
|
100
100
|
}).catch((u) => {
|
|
101
101
|
}).finally(() => {
|
|
102
102
|
n && n();
|
|
@@ -107,11 +107,11 @@ import './assets/RPLayout.css';const ae = {
|
|
|
107
107
|
"rp-text-layer": "_rp-text-layer_1mgyz_1",
|
|
108
108
|
"rp-text-layer-text": "_rp-text-layer-text_1mgyz_9"
|
|
109
109
|
}, _t = () => {
|
|
110
|
-
const { viewMode: e } = Ge(), { scrollMode: t } = Pe(), { virtualScrollRef: n, pageScrollElementRef: r } = Ue(), { setFocusedPage: o } =
|
|
111
|
-
|
|
110
|
+
const { viewMode: e } = Ge(), { scrollMode: t } = Pe(), { virtualScrollRef: n, pageScrollElementRef: r } = Ue(), { setFocusedPage: o } = ee(), i = $(), { columnCount: l } = Bt(), s = Xt(), c = $(t), p = $(e);
|
|
111
|
+
A(() => {
|
|
112
112
|
n != null && n.scrollToItem && (i.current = n);
|
|
113
113
|
}, [n]);
|
|
114
|
-
const
|
|
114
|
+
const h = M(
|
|
115
115
|
(u) => {
|
|
116
116
|
if (!r)
|
|
117
117
|
return;
|
|
@@ -120,99 +120,98 @@ import './assets/RPLayout.css';const ae = {
|
|
|
120
120
|
},
|
|
121
121
|
[r, s]
|
|
122
122
|
);
|
|
123
|
-
return
|
|
124
|
-
c.current = t,
|
|
125
|
-
}, [t, e]), { scrollToPage:
|
|
123
|
+
return A(() => {
|
|
124
|
+
c.current = t, p.current = e;
|
|
125
|
+
}, [t, e]), { scrollToPage: M(
|
|
126
126
|
(u, f = "start") => {
|
|
127
127
|
const v = u - 1;
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
let _ = v, g = 0;
|
|
129
|
+
if (p.current === ze.DUAL_PAGE && c.current === Q.PAGE_SCROLLING) {
|
|
130
|
+
h(u);
|
|
130
131
|
return;
|
|
131
132
|
}
|
|
132
133
|
if (c.current === Q.PAGE_SCROLLING) {
|
|
133
134
|
o(u);
|
|
134
135
|
return;
|
|
135
136
|
}
|
|
136
|
-
|
|
137
|
-
if (c.current === Q.HORIZONTAL_SCROLLING)
|
|
138
|
-
i.current.scrollToItem({ columnIndex: v, align: f });
|
|
139
|
-
else if (h.current === ze.DUAL_PAGE) {
|
|
140
|
-
const g = v % 2, C = Math.floor(v / 2);
|
|
141
|
-
i.current.scrollToItem({ columnIndex: g, rowIndex: C, align: f });
|
|
142
|
-
} else
|
|
143
|
-
i.current.scrollToItem({ rowIndex: v, align: f });
|
|
137
|
+
i.current && (c.current === Q.HORIZONTAL_SCROLLING ? g = v : p.current === ze.DUAL_PAGE && (g = v % 2, _ = Math.floor(v / 2)), i.current.scrollToItem({ rowIndex: _, columnIndex: g, align: f }));
|
|
144
138
|
},
|
|
145
|
-
[l,
|
|
139
|
+
[l, h, o]
|
|
146
140
|
) };
|
|
147
141
|
}, eo = (e = {}, t = "") => {
|
|
148
|
-
const [n, r] = F(t), [o, i] = F(!1), { pdf: l } = Y(), s = $(!n), [c,
|
|
149
|
-
|
|
150
|
-
if (
|
|
142
|
+
const [n, r] = F(t), [o, i] = F(!1), { pdf: l } = Y(), s = $(!n), [c, p] = F([]), [h, m] = F(0), { focusedPage: u } = ee(), { scrollToPage: f } = _t(), { virtualScrollRef: v, pageScrollElementRef: _, virtualScrollableElementRef: g } = Ue(), { scrollMode: b } = Pe(), [S, P] = F(null), T = D(() => h === 0 ? null : c[h - 1], [h, c]), d = D(() => c.length, [c]);
|
|
143
|
+
A(() => {
|
|
144
|
+
if (T && u !== T.page) {
|
|
145
|
+
const y = u < T.page ? "start" : "end";
|
|
146
|
+
f(T.page, y);
|
|
147
|
+
}
|
|
148
|
+
}, [T, f]), A(() => {
|
|
149
|
+
if (!T || u !== T.page || !S || !S.classList.contains("selected"))
|
|
151
150
|
return;
|
|
152
|
-
const
|
|
153
|
-
if (!
|
|
151
|
+
const y = g || _;
|
|
152
|
+
if (!y)
|
|
154
153
|
return;
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
top:
|
|
158
|
-
left:
|
|
154
|
+
const R = S.getBoundingClientRect(), L = y.clientHeight / 2, N = y.clientWidth / 2, x = y.scrollTop + R.top - L, E = y.scrollLeft + R.left - N;
|
|
155
|
+
y.scrollTo({
|
|
156
|
+
top: x,
|
|
157
|
+
left: E,
|
|
158
|
+
behavior: "smooth"
|
|
159
159
|
});
|
|
160
160
|
}, [
|
|
161
|
-
w,
|
|
162
161
|
u,
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
v,
|
|
163
|
+
S,
|
|
164
|
+
b,
|
|
165
165
|
g,
|
|
166
|
-
_
|
|
167
|
-
v
|
|
166
|
+
_
|
|
168
167
|
]);
|
|
169
|
-
const
|
|
170
|
-
m((
|
|
171
|
-
}, [
|
|
172
|
-
m((
|
|
173
|
-
}, [
|
|
174
|
-
if (!
|
|
168
|
+
const C = M(() => {
|
|
169
|
+
m((y) => d ? y + 1 > d ? 1 : y + 1 : 0);
|
|
170
|
+
}, [d]), w = M(() => {
|
|
171
|
+
m((y) => d ? y - 1 <= 0 ? d : y - 1 : 0);
|
|
172
|
+
}, [d]), I = M(async (y) => {
|
|
173
|
+
if (!y)
|
|
175
174
|
return {};
|
|
176
|
-
const
|
|
177
|
-
for (let
|
|
175
|
+
const R = y.numPages, L = {};
|
|
176
|
+
for (let N = 1; N <= R; N++) {
|
|
178
177
|
if (s.current)
|
|
179
178
|
throw "close pop over";
|
|
180
|
-
const
|
|
181
|
-
|
|
179
|
+
const x = await y.getPage(N);
|
|
180
|
+
L[N.toString()] = await x.getTextContent();
|
|
182
181
|
}
|
|
183
|
-
return
|
|
182
|
+
return L;
|
|
184
183
|
}, []);
|
|
185
|
-
return
|
|
184
|
+
return A(() => {
|
|
186
185
|
if (!n) {
|
|
187
|
-
s.current = !0,
|
|
186
|
+
s.current = !0, p([]), m(0);
|
|
188
187
|
return;
|
|
189
188
|
}
|
|
190
|
-
s.current = !1, i(!0),
|
|
191
|
-
const
|
|
192
|
-
const
|
|
189
|
+
s.current = !1, i(!0), p([]), m(0), I(l).then((y) => {
|
|
190
|
+
const L = Object.keys(y).reduce((N, x) => {
|
|
191
|
+
const E = Kn(
|
|
193
192
|
[n],
|
|
194
|
-
|
|
195
|
-
Number(
|
|
193
|
+
y[x],
|
|
194
|
+
Number(x) - 1,
|
|
196
195
|
e
|
|
197
|
-
).map((
|
|
198
|
-
return [...
|
|
196
|
+
).map((z, k) => ({ ...z, page: Number(x), pageMatchIdx: k }));
|
|
197
|
+
return [...N, ...E];
|
|
199
198
|
}, []);
|
|
200
|
-
|
|
199
|
+
p(L), m(L.length ? 1 : 0);
|
|
201
200
|
}).catch(() => {
|
|
202
|
-
|
|
201
|
+
p([]), m(0);
|
|
203
202
|
}).finally(() => i(!1));
|
|
204
|
-
}, [n,
|
|
203
|
+
}, [n, I, l, e]), {
|
|
205
204
|
search: n,
|
|
206
205
|
setSearch: r,
|
|
207
206
|
loading: o,
|
|
208
207
|
matches: c,
|
|
209
|
-
totalMatches:
|
|
210
|
-
currentMatchPosition:
|
|
211
|
-
currentMatch:
|
|
212
|
-
nextMatch:
|
|
213
|
-
prevMatch:
|
|
214
|
-
currentMatchElement:
|
|
215
|
-
setCurrentMatchElement:
|
|
208
|
+
totalMatches: d,
|
|
209
|
+
currentMatchPosition: h,
|
|
210
|
+
currentMatch: T,
|
|
211
|
+
nextMatch: C,
|
|
212
|
+
prevMatch: w,
|
|
213
|
+
currentMatchElement: S,
|
|
214
|
+
setCurrentMatchElement: P
|
|
216
215
|
};
|
|
217
216
|
}, tn = We({
|
|
218
217
|
search: "",
|
|
@@ -242,8 +241,8 @@ import './assets/RPLayout.css';const ae = {
|
|
|
242
241
|
totalMatches: l,
|
|
243
242
|
currentMatchPosition: s,
|
|
244
243
|
currentMatch: c,
|
|
245
|
-
search:
|
|
246
|
-
matches:
|
|
244
|
+
search: p,
|
|
245
|
+
matches: h,
|
|
247
246
|
nextMatch: m,
|
|
248
247
|
prevMatch: u,
|
|
249
248
|
currentMatchElement: f,
|
|
@@ -262,8 +261,8 @@ import './assets/RPLayout.css';const ae = {
|
|
|
262
261
|
currentMatch: c,
|
|
263
262
|
nextMatch: m,
|
|
264
263
|
prevMatch: u,
|
|
265
|
-
search:
|
|
266
|
-
matches:
|
|
264
|
+
search: p,
|
|
265
|
+
matches: h,
|
|
267
266
|
currentMatchElement: f,
|
|
268
267
|
setCurrentMatchElement: v
|
|
269
268
|
},
|
|
@@ -273,57 +272,57 @@ import './assets/RPLayout.css';const ae = {
|
|
|
273
272
|
}, nn = () => He(tn), no = (e) => {
|
|
274
273
|
const { pageNumber: t } = e, { pages: n } = Y(), r = $(null), { matches: o, currentMatch: i, setCurrentMatchElement: l } = nn(), [s, c] = F(
|
|
275
274
|
[]
|
|
276
|
-
),
|
|
275
|
+
), p = $(), h = $(), m = $(), u = D(() => o.filter((v) => v.pageIndex === t - 1), [o, t]), f = M(
|
|
277
276
|
(v, _, g = !1) => {
|
|
278
277
|
if (g && Xn(v, _), !u.length) {
|
|
279
278
|
m.current = void 0, c([]);
|
|
280
279
|
return;
|
|
281
280
|
}
|
|
282
|
-
const
|
|
283
|
-
c(
|
|
281
|
+
const b = Jn(u, v, _);
|
|
282
|
+
c(b);
|
|
284
283
|
},
|
|
285
284
|
[u]
|
|
286
285
|
);
|
|
287
|
-
return
|
|
286
|
+
return A(() => {
|
|
288
287
|
var g;
|
|
289
288
|
if ((g = m.current) == null || g.classList.remove("selected"), !s.length || !i || i.pageIndex !== t - 1)
|
|
290
289
|
return;
|
|
291
290
|
const v = u.findIndex(
|
|
292
|
-
(
|
|
291
|
+
(b) => JSON.stringify(b) === JSON.stringify(i)
|
|
293
292
|
);
|
|
294
293
|
if (v === -1)
|
|
295
294
|
return;
|
|
296
|
-
const _ = s.find((
|
|
295
|
+
const _ = s.find((b) => b.index === v);
|
|
297
296
|
_ && (m.current = _.element, l(_.element), _.element.classList.add("selected"));
|
|
298
|
-
}, [i, s, u]),
|
|
297
|
+
}, [i, s, u]), A(() => {
|
|
299
298
|
const v = n.get(t);
|
|
300
299
|
if (!(!v || !r.current))
|
|
301
|
-
return
|
|
300
|
+
return p.current && p.current.cancel(), v.page.getTextContent().then((_) => {
|
|
302
301
|
const g = v.page.getViewport({ scale: 1 });
|
|
303
|
-
return
|
|
302
|
+
return p.current = new Qn.TextLayer({
|
|
304
303
|
viewport: g,
|
|
305
304
|
textContentSource: _,
|
|
306
305
|
container: r.current
|
|
307
|
-
}),
|
|
306
|
+
}), h.current = _, r.current && (r.current.innerText = ""), p.current.render();
|
|
308
307
|
}).then(() => {
|
|
309
|
-
var
|
|
310
|
-
[].slice.call(r.current.children).forEach((
|
|
311
|
-
|
|
308
|
+
var b;
|
|
309
|
+
[].slice.call(r.current.children).forEach((S) => {
|
|
310
|
+
S.classList.add(Xe["rp-text-layer-text"]);
|
|
312
311
|
});
|
|
313
|
-
const g = (
|
|
314
|
-
g &&
|
|
312
|
+
const g = (b = p.current) == null ? void 0 : b.textDivs;
|
|
313
|
+
g && h.current && f(h.current, g);
|
|
315
314
|
}).catch(() => {
|
|
316
315
|
}), () => {
|
|
317
316
|
var _;
|
|
318
|
-
(_ =
|
|
317
|
+
(_ = p.current) == null || _.cancel();
|
|
319
318
|
};
|
|
320
|
-
}, [n, t]),
|
|
319
|
+
}, [n, t]), A(() => {
|
|
321
320
|
var g;
|
|
322
|
-
[].slice.call(r.current.children).forEach((
|
|
323
|
-
|
|
321
|
+
[].slice.call(r.current.children).forEach((b) => {
|
|
322
|
+
b.classList.add(Xe["rp-text-layer-text"]);
|
|
324
323
|
});
|
|
325
|
-
const _ = (g =
|
|
326
|
-
_ &&
|
|
324
|
+
const _ = (g = p.current) == null ? void 0 : g.textDivs;
|
|
325
|
+
_ && h.current && f(h.current, _, !0);
|
|
327
326
|
}, [f]), /* @__PURE__ */ a(
|
|
328
327
|
"div",
|
|
329
328
|
{
|
|
@@ -343,7 +342,7 @@ function ao(e, t) {
|
|
|
343
342
|
}
|
|
344
343
|
const io = (e, t, n) => {
|
|
345
344
|
st.set(on(e, t), n);
|
|
346
|
-
},
|
|
345
|
+
}, xt = (e, t) => {
|
|
347
346
|
switch (t[1].name) {
|
|
348
347
|
case "XYZ":
|
|
349
348
|
return {
|
|
@@ -385,9 +384,9 @@ async function an(e, t) {
|
|
|
385
384
|
const i = await e.getPageIndex(r);
|
|
386
385
|
return io(e, r, i), await an(e, n);
|
|
387
386
|
} else
|
|
388
|
-
return
|
|
387
|
+
return xt(o, n);
|
|
389
388
|
} else
|
|
390
|
-
return
|
|
389
|
+
return xt(n[0], n);
|
|
391
390
|
}
|
|
392
391
|
function so(e) {
|
|
393
392
|
const { id: t, url: n, unsafeUrl: r } = e, o = new MutationObserver((i) => {
|
|
@@ -434,7 +433,7 @@ const lo = (e) => {
|
|
|
434
433
|
return;
|
|
435
434
|
const s = t.find((c) => c.id === i);
|
|
436
435
|
!s || s.annotationType !== at.Link || s.dest && an(n, s.dest).then((c) => {
|
|
437
|
-
|
|
436
|
+
r(c);
|
|
438
437
|
});
|
|
439
438
|
};
|
|
440
439
|
function co(e, t) {
|
|
@@ -446,91 +445,90 @@ function uo(e, t) {
|
|
|
446
445
|
e.removeEventListener(n, t);
|
|
447
446
|
}
|
|
448
447
|
const po = (e) => {
|
|
449
|
-
const { pageNumber: t } = e, n = $(null), { pages: r, pdf: o } = Y(), i = $(), [l, s] = F(),
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
s(w);
|
|
453
|
-
}), o == null || o.getFieldObjects().then((w) => {
|
|
454
|
-
h(w);
|
|
455
|
-
}), i.current && (i.current.div.replaceChildren(), i.current = void 0);
|
|
448
|
+
const { pageNumber: t } = e, n = $(null), { pages: r, pdf: o } = Y(), i = $(), [l, s] = F(), { setFocusedPage: c, goToPage: p } = ee(), { scrollMode: h } = Pe(), m = D(() => r.get(t), [r, t]), u = D(() => m == null ? void 0 : m.page.getViewport(), [m]);
|
|
449
|
+
A(() => {
|
|
450
|
+
i.current && (i.current.div.replaceChildren(), i.current = void 0);
|
|
456
451
|
}, [o]);
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
i.current = void 0,
|
|
452
|
+
const f = D(() => o == null ? void 0 : o.annotationStorage, [o]);
|
|
453
|
+
A(() => {
|
|
454
|
+
m && m.page.getAnnotations().then((_) => {
|
|
455
|
+
i.current = void 0, s(_), n.current && (n.current.innerText = "");
|
|
461
456
|
});
|
|
462
|
-
}, [
|
|
463
|
-
const
|
|
464
|
-
(
|
|
465
|
-
lo(
|
|
457
|
+
}, [m]);
|
|
458
|
+
const v = M(
|
|
459
|
+
(_) => {
|
|
460
|
+
lo(_), !(!l || !o) && (h === Q.PAGE_SCROLLING ? Mt(_, l, o, (g) => c(g.pageIndex + 1)) : Mt(_, l, o, (g) => p(g.pageIndex + 1)));
|
|
466
461
|
},
|
|
467
|
-
[o,
|
|
462
|
+
[o, l, p, c, h]
|
|
468
463
|
);
|
|
469
|
-
return
|
|
470
|
-
if (!
|
|
464
|
+
return A(() => {
|
|
465
|
+
if (!m || !l)
|
|
471
466
|
return;
|
|
472
|
-
const
|
|
467
|
+
const _ = m.page.getViewport();
|
|
473
468
|
if (i.current) {
|
|
474
469
|
i.current.update({
|
|
475
|
-
viewport:
|
|
470
|
+
viewport: _.clone({ dontFlip: !0 })
|
|
476
471
|
});
|
|
477
472
|
return;
|
|
478
473
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
switch (d) {
|
|
474
|
+
for (const b of l) {
|
|
475
|
+
const { annotationType: S } = b;
|
|
476
|
+
switch (S) {
|
|
483
477
|
case at.Link:
|
|
484
|
-
so(
|
|
478
|
+
so(b);
|
|
485
479
|
break;
|
|
486
480
|
case at.Widget:
|
|
487
481
|
break;
|
|
488
482
|
}
|
|
489
483
|
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
484
|
+
(async () => {
|
|
485
|
+
i.current = new er({
|
|
486
|
+
div: n.current,
|
|
487
|
+
accessibilityManager: void 0,
|
|
488
|
+
annotationCanvasMap: void 0,
|
|
489
|
+
annotationEditorUIManager: void 0,
|
|
490
|
+
structTreeLayer: void 0,
|
|
491
|
+
page: m.page,
|
|
492
|
+
viewport: _.clone({ dontFlip: !0 })
|
|
493
|
+
}), n.current && uo(n.current, v);
|
|
494
|
+
const b = await (o == null ? void 0 : o.hasJSActions()), S = await (o == null ? void 0 : o.getFieldObjects());
|
|
495
|
+
return i.current.render({
|
|
496
|
+
annotations: l,
|
|
497
|
+
annotationStorage: f,
|
|
498
|
+
hasJSActions: b,
|
|
499
|
+
fieldObjects: S,
|
|
500
|
+
div: n.current,
|
|
501
|
+
viewport: _.clone({ dontFlip: !0 }),
|
|
502
|
+
page: m.page,
|
|
503
|
+
imageResourcesPath: oo,
|
|
504
|
+
renderForms: !1,
|
|
505
|
+
linkService: new Cr(),
|
|
506
|
+
downloadManager: null,
|
|
507
|
+
enableScripting: !1
|
|
508
|
+
});
|
|
509
|
+
})().then(() => {
|
|
510
|
+
n.current && co(n.current, v);
|
|
513
511
|
});
|
|
514
|
-
}, [
|
|
512
|
+
}, [o, l, v]), /* @__PURE__ */ a(
|
|
515
513
|
"div",
|
|
516
514
|
{
|
|
517
515
|
"data-rp": `page-${t}-annotationLayer`,
|
|
518
|
-
style: { width: `${
|
|
516
|
+
style: { width: `${u == null ? void 0 : u.width}px`, height: `${u == null ? void 0 : u.height}px` },
|
|
519
517
|
className: ro["rp-annotation-layer"],
|
|
520
518
|
ref: n
|
|
521
519
|
}
|
|
522
520
|
);
|
|
523
521
|
}, ho = Array.from({ length: 21 }, (e, t) => Number((t * 0.05).toFixed(2))), wt = $e((e, t) => {
|
|
524
|
-
const { pageNumber: n, style: r, onIntersectRatioChange: o, ...i } = e, { pages: l } = Y(), { rotate: s } = Ve(), { textLayer: c } = cr(), { currentZoom:
|
|
522
|
+
const { pageNumber: n, style: r, onIntersectRatioChange: o, ...i } = e, { pages: l } = Y(), { rotate: s } = Ve(), { textLayer: c } = cr(), { currentZoom: p } = ht(), h = $(l.get(n)), [m, u] = F(!1), f = $(null), [v, _] = F({
|
|
525
523
|
width: 0,
|
|
526
524
|
height: 0
|
|
527
525
|
});
|
|
528
|
-
qt(t, () => f.current),
|
|
529
|
-
if (l && (
|
|
530
|
-
const
|
|
531
|
-
_(
|
|
526
|
+
qt(t, () => f.current), A(() => {
|
|
527
|
+
if (l && (h.current = l.get(n), h.current)) {
|
|
528
|
+
const P = h.current.page.getViewport({ scale: p, rotation: s });
|
|
529
|
+
_(P);
|
|
532
530
|
}
|
|
533
|
-
}, [l, n, s,
|
|
531
|
+
}, [l, n, s, p]);
|
|
534
532
|
const g = D(() => {
|
|
535
533
|
switch (s) {
|
|
536
534
|
case 90:
|
|
@@ -541,20 +539,20 @@ const po = (e) => {
|
|
|
541
539
|
default:
|
|
542
540
|
return "center";
|
|
543
541
|
}
|
|
544
|
-
}, [s, v]),
|
|
542
|
+
}, [s, v]), b = M(() => {
|
|
545
543
|
u(!0);
|
|
546
|
-
}, []),
|
|
544
|
+
}, []), S = M(() => {
|
|
547
545
|
u(!1);
|
|
548
546
|
}, []);
|
|
549
|
-
return
|
|
550
|
-
const
|
|
547
|
+
return A(() => {
|
|
548
|
+
const P = new IntersectionObserver(
|
|
551
549
|
(T) => {
|
|
552
550
|
o && o(n, T[0].intersectionRatio);
|
|
553
551
|
},
|
|
554
552
|
{ threshold: ho }
|
|
555
553
|
);
|
|
556
|
-
return f.current &&
|
|
557
|
-
|
|
554
|
+
return f.current && P.observe(f.current), () => {
|
|
555
|
+
P.disconnect(), o && o(n, -1);
|
|
558
556
|
};
|
|
559
557
|
}, [o, n, s]), /* @__PURE__ */ a(
|
|
560
558
|
"div",
|
|
@@ -567,7 +565,7 @@ const po = (e) => {
|
|
|
567
565
|
...r,
|
|
568
566
|
"--rp-rotate": `${s}deg`,
|
|
569
567
|
"--rp-page-rotate-translate": `${g}`,
|
|
570
|
-
"--scale-factor":
|
|
568
|
+
"--scale-factor": p
|
|
571
569
|
},
|
|
572
570
|
className: Ke["rp-page-wrapper"],
|
|
573
571
|
children: /* @__PURE__ */ O(
|
|
@@ -579,7 +577,7 @@ const po = (e) => {
|
|
|
579
577
|
},
|
|
580
578
|
className: Ke["rp-page"],
|
|
581
579
|
children: [
|
|
582
|
-
/* @__PURE__ */ a(Qr, { onLoading:
|
|
580
|
+
/* @__PURE__ */ a(Qr, { onLoading: b, onLoaded: S, pageNumber: n }),
|
|
583
581
|
m && /* @__PURE__ */ a("div", { className: Ke["rp-loader-wrapper"], children: /* @__PURE__ */ a(pt, {}) }),
|
|
584
582
|
c && /* @__PURE__ */ a(no, { pageNumber: n }),
|
|
585
583
|
/* @__PURE__ */ a(po, { pageNumber: n })
|
|
@@ -692,12 +690,12 @@ var bo = 150, Co = function(t) {
|
|
|
692
690
|
}, Ee = null, Oe = null, De = null;
|
|
693
691
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Ee = /* @__PURE__ */ new WeakSet(), Oe = /* @__PURE__ */ new WeakSet(), De = /* @__PURE__ */ new WeakSet());
|
|
694
692
|
function Po(e) {
|
|
695
|
-
var t, n = e.getColumnOffset, r = e.getColumnStartIndexForOffset, o = e.getColumnStopIndexForStartIndex, i = e.getColumnWidth, l = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, c = e.getOffsetForColumnAndAlignment,
|
|
696
|
-
return t = /* @__PURE__ */ function(
|
|
697
|
-
fo(
|
|
698
|
-
function
|
|
693
|
+
var t, n = e.getColumnOffset, r = e.getColumnStartIndexForOffset, o = e.getColumnStopIndexForStartIndex, i = e.getColumnWidth, l = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, c = e.getOffsetForColumnAndAlignment, p = e.getOffsetForRowAndAlignment, h = e.getRowHeight, m = e.getRowOffset, u = e.getRowStartIndexForOffset, f = e.getRowStopIndexForStartIndex, v = e.initInstanceProps, _ = e.shouldResetStyleCacheOnItemSizeChange, g = e.validateProps;
|
|
694
|
+
return t = /* @__PURE__ */ function(b) {
|
|
695
|
+
fo(S, b);
|
|
696
|
+
function S(T) {
|
|
699
697
|
var d;
|
|
700
|
-
return d =
|
|
698
|
+
return d = b.call(this, T) || this, d._instanceProps = v(d.props, Lt(d)), d._resetIsScrollingTimeoutId = null, d._outerRef = void 0, d.state = {
|
|
701
699
|
instance: Lt(d),
|
|
702
700
|
isScrolling: !1,
|
|
703
701
|
horizontalScrollDirection: "forward",
|
|
@@ -705,72 +703,72 @@ function Po(e) {
|
|
|
705
703
|
scrollTop: typeof d.props.initialScrollTop == "number" ? d.props.initialScrollTop : 0,
|
|
706
704
|
scrollUpdateWasRequested: !1,
|
|
707
705
|
verticalScrollDirection: "forward"
|
|
708
|
-
}, d._callOnItemsRendered = void 0, d._callOnItemsRendered = Je(function(
|
|
706
|
+
}, d._callOnItemsRendered = void 0, d._callOnItemsRendered = Je(function(C, w, I, y, R, L, N, x) {
|
|
709
707
|
return d.props.onItemsRendered({
|
|
710
|
-
overscanColumnStartIndex:
|
|
711
|
-
overscanColumnStopIndex:
|
|
712
|
-
overscanRowStartIndex:
|
|
713
|
-
overscanRowStopIndex:
|
|
714
|
-
visibleColumnStartIndex:
|
|
715
|
-
visibleColumnStopIndex:
|
|
716
|
-
visibleRowStartIndex:
|
|
717
|
-
visibleRowStopIndex:
|
|
708
|
+
overscanColumnStartIndex: C,
|
|
709
|
+
overscanColumnStopIndex: w,
|
|
710
|
+
overscanRowStartIndex: I,
|
|
711
|
+
overscanRowStopIndex: y,
|
|
712
|
+
visibleColumnStartIndex: R,
|
|
713
|
+
visibleColumnStopIndex: L,
|
|
714
|
+
visibleRowStartIndex: N,
|
|
715
|
+
visibleRowStopIndex: x
|
|
718
716
|
});
|
|
719
|
-
}), d._callOnScroll = void 0, d._callOnScroll = Je(function(
|
|
717
|
+
}), d._callOnScroll = void 0, d._callOnScroll = Je(function(C, w, I, y, R) {
|
|
720
718
|
return d.props.onScroll({
|
|
721
|
-
horizontalScrollDirection:
|
|
722
|
-
scrollLeft:
|
|
723
|
-
scrollTop:
|
|
724
|
-
verticalScrollDirection:
|
|
725
|
-
scrollUpdateWasRequested:
|
|
719
|
+
horizontalScrollDirection: I,
|
|
720
|
+
scrollLeft: C,
|
|
721
|
+
scrollTop: w,
|
|
722
|
+
verticalScrollDirection: y,
|
|
723
|
+
scrollUpdateWasRequested: R
|
|
726
724
|
});
|
|
727
|
-
}), d._getItemStyle = void 0, d._getItemStyle = function(
|
|
728
|
-
var
|
|
729
|
-
if (
|
|
730
|
-
E =
|
|
725
|
+
}), d._getItemStyle = void 0, d._getItemStyle = function(C, w) {
|
|
726
|
+
var I = d.props, y = I.columnWidth, R = I.direction, L = I.rowHeight, N = d._getItemStyleCache(_ && y, _ && R, _ && L), x = C + ":" + w, E;
|
|
727
|
+
if (N.hasOwnProperty(x))
|
|
728
|
+
E = N[x];
|
|
731
729
|
else {
|
|
732
|
-
var
|
|
733
|
-
|
|
730
|
+
var z = n(d.props, w, d._instanceProps), k = R === "rtl";
|
|
731
|
+
N[x] = E = {
|
|
734
732
|
position: "absolute",
|
|
735
|
-
left:
|
|
736
|
-
right:
|
|
737
|
-
top: m(d.props,
|
|
738
|
-
height:
|
|
739
|
-
width: i(d.props,
|
|
733
|
+
left: k ? void 0 : z,
|
|
734
|
+
right: k ? z : void 0,
|
|
735
|
+
top: m(d.props, C, d._instanceProps),
|
|
736
|
+
height: h(d.props, C, d._instanceProps),
|
|
737
|
+
width: i(d.props, w, d._instanceProps)
|
|
740
738
|
};
|
|
741
739
|
}
|
|
742
740
|
return E;
|
|
743
|
-
}, d._getItemStyleCache = void 0, d._getItemStyleCache = Je(function(
|
|
741
|
+
}, d._getItemStyleCache = void 0, d._getItemStyleCache = Je(function(C, w, I) {
|
|
744
742
|
return {};
|
|
745
|
-
}), d._onScroll = function(
|
|
746
|
-
var
|
|
743
|
+
}), d._onScroll = function(C) {
|
|
744
|
+
var w = C.currentTarget, I = w.clientHeight, y = w.clientWidth, R = w.scrollLeft, L = w.scrollTop, N = w.scrollHeight, x = w.scrollWidth;
|
|
747
745
|
d.setState(function(E) {
|
|
748
|
-
if (E.scrollLeft ===
|
|
746
|
+
if (E.scrollLeft === R && E.scrollTop === L)
|
|
749
747
|
return null;
|
|
750
|
-
var
|
|
751
|
-
if (
|
|
748
|
+
var z = d.props.direction, k = R;
|
|
749
|
+
if (z === "rtl")
|
|
752
750
|
switch (At()) {
|
|
753
751
|
case "negative":
|
|
754
|
-
|
|
752
|
+
k = -R;
|
|
755
753
|
break;
|
|
756
754
|
case "positive-descending":
|
|
757
|
-
|
|
755
|
+
k = x - y - R;
|
|
758
756
|
break;
|
|
759
757
|
}
|
|
760
|
-
|
|
761
|
-
var G = Math.max(0, Math.min(
|
|
758
|
+
k = Math.max(0, Math.min(k, x - y));
|
|
759
|
+
var G = Math.max(0, Math.min(L, N - I));
|
|
762
760
|
return {
|
|
763
761
|
isScrolling: !0,
|
|
764
|
-
horizontalScrollDirection: E.scrollLeft <
|
|
765
|
-
scrollLeft:
|
|
762
|
+
horizontalScrollDirection: E.scrollLeft < R ? "forward" : "backward",
|
|
763
|
+
scrollLeft: k,
|
|
766
764
|
scrollTop: G,
|
|
767
|
-
verticalScrollDirection: E.scrollTop <
|
|
765
|
+
verticalScrollDirection: E.scrollTop < L ? "forward" : "backward",
|
|
768
766
|
scrollUpdateWasRequested: !1
|
|
769
767
|
};
|
|
770
768
|
}, d._resetIsScrollingDebounced);
|
|
771
|
-
}, d._outerRefSetter = function(
|
|
772
|
-
var
|
|
773
|
-
d._outerRef =
|
|
769
|
+
}, d._outerRefSetter = function(C) {
|
|
770
|
+
var w = d.props.outerRef;
|
|
771
|
+
d._outerRef = C, typeof w == "function" ? w(C) : w != null && typeof w == "object" && w.hasOwnProperty("current") && (w.current = C);
|
|
774
772
|
}, d._resetIsScrollingDebounced = function() {
|
|
775
773
|
d._resetIsScrollingTimeoutId !== null && Dt(d._resetIsScrollingTimeoutId), d._resetIsScrollingTimeoutId = _o(d._resetIsScrolling, bo);
|
|
776
774
|
}, d._resetIsScrolling = function() {
|
|
@@ -781,70 +779,70 @@ function Po(e) {
|
|
|
781
779
|
});
|
|
782
780
|
}, d;
|
|
783
781
|
}
|
|
784
|
-
|
|
785
|
-
return So(d,
|
|
782
|
+
S.getDerivedStateFromProps = function(d, C) {
|
|
783
|
+
return So(d, C), g(d), null;
|
|
786
784
|
};
|
|
787
|
-
var
|
|
788
|
-
return
|
|
789
|
-
var
|
|
790
|
-
|
|
791
|
-
return
|
|
792
|
-
horizontalScrollDirection:
|
|
793
|
-
scrollLeft:
|
|
794
|
-
scrollTop:
|
|
785
|
+
var P = S.prototype;
|
|
786
|
+
return P.scrollTo = function(d) {
|
|
787
|
+
var C = d.scrollLeft, w = d.scrollTop;
|
|
788
|
+
C !== void 0 && (C = Math.max(0, C)), w !== void 0 && (w = Math.max(0, w)), this.setState(function(I) {
|
|
789
|
+
return C === void 0 && (C = I.scrollLeft), w === void 0 && (w = I.scrollTop), I.scrollLeft === C && I.scrollTop === w ? null : {
|
|
790
|
+
horizontalScrollDirection: I.scrollLeft < C ? "forward" : "backward",
|
|
791
|
+
scrollLeft: C,
|
|
792
|
+
scrollTop: w,
|
|
795
793
|
scrollUpdateWasRequested: !0,
|
|
796
|
-
verticalScrollDirection:
|
|
794
|
+
verticalScrollDirection: I.scrollTop < w ? "forward" : "backward"
|
|
797
795
|
};
|
|
798
796
|
}, this._resetIsScrollingDebounced);
|
|
799
|
-
},
|
|
800
|
-
var
|
|
801
|
-
|
|
802
|
-
var U = l(this.props, this._instanceProps), K = s(this.props, this._instanceProps), ue = K > E ? Z : 0, oe = U >
|
|
797
|
+
}, P.scrollToItem = function(d) {
|
|
798
|
+
var C = d.align, w = C === void 0 ? "auto" : C, I = d.columnIndex, y = d.rowIndex, R = this.props, L = R.columnCount, N = R.height, x = R.rowCount, E = R.width, z = this.state, k = z.scrollLeft, G = z.scrollTop, Z = wo();
|
|
799
|
+
I !== void 0 && (I = Math.max(0, Math.min(I, L - 1))), y !== void 0 && (y = Math.max(0, Math.min(y, x - 1)));
|
|
800
|
+
var U = l(this.props, this._instanceProps), K = s(this.props, this._instanceProps), ue = K > E ? Z : 0, oe = U > N ? Z : 0;
|
|
803
801
|
this.scrollTo({
|
|
804
|
-
scrollLeft:
|
|
805
|
-
scrollTop:
|
|
802
|
+
scrollLeft: I !== void 0 ? c(this.props, I, w, k, this._instanceProps, oe) : k,
|
|
803
|
+
scrollTop: y !== void 0 ? p(this.props, y, w, G, this._instanceProps, ue) : G
|
|
806
804
|
});
|
|
807
|
-
},
|
|
808
|
-
var d = this.props,
|
|
805
|
+
}, P.componentDidMount = function() {
|
|
806
|
+
var d = this.props, C = d.initialScrollLeft, w = d.initialScrollTop;
|
|
809
807
|
if (this._outerRef != null) {
|
|
810
|
-
var
|
|
811
|
-
typeof
|
|
808
|
+
var I = this._outerRef;
|
|
809
|
+
typeof C == "number" && (I.scrollLeft = C), typeof w == "number" && (I.scrollTop = w);
|
|
812
810
|
}
|
|
813
811
|
this._callPropsCallbacks();
|
|
814
|
-
},
|
|
815
|
-
var d = this.props.direction,
|
|
816
|
-
if (
|
|
817
|
-
var
|
|
812
|
+
}, P.componentDidUpdate = function() {
|
|
813
|
+
var d = this.props.direction, C = this.state, w = C.scrollLeft, I = C.scrollTop, y = C.scrollUpdateWasRequested;
|
|
814
|
+
if (y && this._outerRef != null) {
|
|
815
|
+
var R = this._outerRef;
|
|
818
816
|
if (d === "rtl")
|
|
819
817
|
switch (At()) {
|
|
820
818
|
case "negative":
|
|
821
|
-
|
|
819
|
+
R.scrollLeft = -w;
|
|
822
820
|
break;
|
|
823
821
|
case "positive-ascending":
|
|
824
|
-
|
|
822
|
+
R.scrollLeft = w;
|
|
825
823
|
break;
|
|
826
824
|
default:
|
|
827
|
-
var
|
|
828
|
-
|
|
825
|
+
var L = R.clientWidth, N = R.scrollWidth;
|
|
826
|
+
R.scrollLeft = N - L - w;
|
|
829
827
|
break;
|
|
830
828
|
}
|
|
831
829
|
else
|
|
832
|
-
|
|
833
|
-
|
|
830
|
+
R.scrollLeft = Math.max(0, w);
|
|
831
|
+
R.scrollTop = Math.max(0, I);
|
|
834
832
|
}
|
|
835
833
|
this._callPropsCallbacks();
|
|
836
|
-
},
|
|
834
|
+
}, P.componentWillUnmount = function() {
|
|
837
835
|
this._resetIsScrollingTimeoutId !== null && Dt(this._resetIsScrollingTimeoutId);
|
|
838
|
-
},
|
|
839
|
-
var d = this.props,
|
|
840
|
-
if (
|
|
836
|
+
}, P.render = function() {
|
|
837
|
+
var d = this.props, C = d.children, w = d.className, I = d.columnCount, y = d.direction, R = d.height, L = d.innerRef, N = d.innerElementType, x = d.innerTagName, E = d.itemData, z = d.itemKey, k = z === void 0 ? Co : z, G = d.outerElementType, Z = d.outerTagName, U = d.rowCount, K = d.style, ue = d.useIsScrolling, oe = d.width, ve = this.state.isScrolling, _e = this._getHorizontalRangeToRender(), Se = _e[0], W = _e[1], H = this._getVerticalRangeToRender(), q = H[0], le = H[1], Te = [];
|
|
838
|
+
if (I > 0 && U)
|
|
841
839
|
for (var de = q; de <= le; de++)
|
|
842
|
-
for (var pe = Se; pe <=
|
|
843
|
-
Te.push(Ne(
|
|
840
|
+
for (var pe = Se; pe <= W; pe++)
|
|
841
|
+
Te.push(Ne(C, {
|
|
844
842
|
columnIndex: pe,
|
|
845
843
|
data: E,
|
|
846
844
|
isScrolling: ue ? ve : void 0,
|
|
847
|
-
key:
|
|
845
|
+
key: k({
|
|
848
846
|
columnIndex: pe,
|
|
849
847
|
data: E,
|
|
850
848
|
rowIndex: de
|
|
@@ -854,50 +852,50 @@ function Po(e) {
|
|
|
854
852
|
}));
|
|
855
853
|
var Ze = l(this.props, this._instanceProps), je = s(this.props, this._instanceProps);
|
|
856
854
|
return Ne(G || Z || "div", {
|
|
857
|
-
className:
|
|
855
|
+
className: w,
|
|
858
856
|
onScroll: this._onScroll,
|
|
859
857
|
ref: this._outerRefSetter,
|
|
860
858
|
style: lt({
|
|
861
859
|
position: "relative",
|
|
862
|
-
height:
|
|
860
|
+
height: R,
|
|
863
861
|
width: oe,
|
|
864
862
|
overflow: "auto",
|
|
865
863
|
WebkitOverflowScrolling: "touch",
|
|
866
864
|
willChange: "transform",
|
|
867
|
-
direction:
|
|
865
|
+
direction: y
|
|
868
866
|
}, K)
|
|
869
|
-
}, Ne(
|
|
867
|
+
}, Ne(N || x || "div", {
|
|
870
868
|
children: Te,
|
|
871
|
-
ref:
|
|
869
|
+
ref: L,
|
|
872
870
|
style: {
|
|
873
871
|
height: Ze,
|
|
874
872
|
pointerEvents: ve ? "none" : void 0,
|
|
875
873
|
width: je
|
|
876
874
|
}
|
|
877
875
|
}));
|
|
878
|
-
},
|
|
879
|
-
var d = this.props,
|
|
880
|
-
if (typeof
|
|
881
|
-
var
|
|
882
|
-
this._callOnItemsRendered(
|
|
876
|
+
}, P._callPropsCallbacks = function() {
|
|
877
|
+
var d = this.props, C = d.columnCount, w = d.onItemsRendered, I = d.onScroll, y = d.rowCount;
|
|
878
|
+
if (typeof w == "function" && C > 0 && y > 0) {
|
|
879
|
+
var R = this._getHorizontalRangeToRender(), L = R[0], N = R[1], x = R[2], E = R[3], z = this._getVerticalRangeToRender(), k = z[0], G = z[1], Z = z[2], U = z[3];
|
|
880
|
+
this._callOnItemsRendered(L, N, k, G, x, E, Z, U);
|
|
883
881
|
}
|
|
884
|
-
if (typeof
|
|
882
|
+
if (typeof I == "function") {
|
|
885
883
|
var K = this.state, ue = K.horizontalScrollDirection, oe = K.scrollLeft, ve = K.scrollTop, _e = K.scrollUpdateWasRequested, Se = K.verticalScrollDirection;
|
|
886
884
|
this._callOnScroll(oe, ve, ue, Se, _e);
|
|
887
885
|
}
|
|
888
|
-
},
|
|
889
|
-
var d = this.props,
|
|
890
|
-
if (
|
|
886
|
+
}, P._getHorizontalRangeToRender = function() {
|
|
887
|
+
var d = this.props, C = d.columnCount, w = d.overscanColumnCount, I = d.overscanColumnsCount, y = d.overscanCount, R = d.rowCount, L = this.state, N = L.horizontalScrollDirection, x = L.isScrolling, E = L.scrollLeft, z = w || I || y || 1;
|
|
888
|
+
if (C === 0 || R === 0)
|
|
891
889
|
return [0, 0, 0, 0];
|
|
892
|
-
var
|
|
893
|
-
return [Math.max(0,
|
|
894
|
-
},
|
|
895
|
-
var d = this.props,
|
|
896
|
-
if (
|
|
890
|
+
var k = r(this.props, E, this._instanceProps), G = o(this.props, k, E, this._instanceProps), Z = !x || N === "backward" ? Math.max(1, z) : 1, U = !x || N === "forward" ? Math.max(1, z) : 1;
|
|
891
|
+
return [Math.max(0, k - Z), Math.max(0, Math.min(C - 1, G + U)), k, G];
|
|
892
|
+
}, P._getVerticalRangeToRender = function() {
|
|
893
|
+
var d = this.props, C = d.columnCount, w = d.overscanCount, I = d.overscanRowCount, y = d.overscanRowsCount, R = d.rowCount, L = this.state, N = L.isScrolling, x = L.verticalScrollDirection, E = L.scrollTop, z = I || y || w || 1;
|
|
894
|
+
if (C === 0 || R === 0)
|
|
897
895
|
return [0, 0, 0, 0];
|
|
898
|
-
var
|
|
899
|
-
return [Math.max(0,
|
|
900
|
-
},
|
|
896
|
+
var k = u(this.props, E, this._instanceProps), G = f(this.props, k, E, this._instanceProps), Z = !N || x === "backward" ? Math.max(1, z) : 1, U = !N || x === "forward" ? Math.max(1, z) : 1;
|
|
897
|
+
return [Math.max(0, k - Z), Math.max(0, Math.min(R - 1, G + U)), k, G];
|
|
898
|
+
}, S;
|
|
901
899
|
}(zn), t.defaultProps = {
|
|
902
900
|
direction: "ltr",
|
|
903
901
|
itemData: void 0,
|
|
@@ -905,9 +903,9 @@ function Po(e) {
|
|
|
905
903
|
}, t;
|
|
906
904
|
}
|
|
907
905
|
var So = function(t, n) {
|
|
908
|
-
var r = t.children, o = t.direction, i = t.height, l = t.innerTagName, s = t.outerTagName, c = t.overscanColumnsCount,
|
|
906
|
+
var r = t.children, o = t.direction, i = t.height, l = t.innerTagName, s = t.outerTagName, c = t.overscanColumnsCount, p = t.overscanCount, h = t.overscanRowsCount, m = t.width, u = n.instance;
|
|
909
907
|
if (process.env.NODE_ENV !== "production") {
|
|
910
|
-
if (typeof
|
|
908
|
+
if (typeof p == "number" && Ee && !Ee.has(u) && (Ee.add(u), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof c == "number" || typeof h == "number") && Oe && !Oe.has(u) && (Oe.add(u), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (l != null || s != null) && De && !De.has(u) && (De.add(u), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
|
|
911
909
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
912
910
|
switch (o) {
|
|
913
911
|
case "ltr":
|
|
@@ -927,27 +925,27 @@ var So = function(t, n) {
|
|
|
927
925
|
var c = o[l];
|
|
928
926
|
s = c.offset + c.size;
|
|
929
927
|
}
|
|
930
|
-
var
|
|
931
|
-
return s +
|
|
928
|
+
var p = r - l - 1, h = p * i;
|
|
929
|
+
return s + h;
|
|
932
930
|
}, ln = function(t, n) {
|
|
933
931
|
var r = t.columnCount, o = n.columnMetadataMap, i = n.estimatedColumnWidth, l = n.lastMeasuredColumnIndex, s = 0;
|
|
934
932
|
if (l >= r && (l = r - 1), l >= 0) {
|
|
935
933
|
var c = o[l];
|
|
936
934
|
s = c.offset + c.size;
|
|
937
935
|
}
|
|
938
|
-
var
|
|
939
|
-
return s +
|
|
936
|
+
var p = r - l - 1, h = p * i;
|
|
937
|
+
return s + h;
|
|
940
938
|
}, ie = function(t, n, r, o) {
|
|
941
939
|
var i, l, s;
|
|
942
940
|
if (t === "column" ? (i = o.columnMetadataMap, l = n.columnWidth, s = o.lastMeasuredColumnIndex) : (i = o.rowMetadataMap, l = n.rowHeight, s = o.lastMeasuredRowIndex), r > s) {
|
|
943
941
|
var c = 0;
|
|
944
942
|
if (s >= 0) {
|
|
945
|
-
var
|
|
946
|
-
c =
|
|
943
|
+
var p = i[s];
|
|
944
|
+
c = p.offset + p.size;
|
|
947
945
|
}
|
|
948
|
-
for (var
|
|
949
|
-
var m = l(
|
|
950
|
-
i[
|
|
946
|
+
for (var h = s + 1; h <= r; h++) {
|
|
947
|
+
var m = l(h);
|
|
948
|
+
i[h] = {
|
|
951
949
|
offset: c,
|
|
952
950
|
size: m
|
|
953
951
|
}, c += m;
|
|
@@ -973,7 +971,7 @@ var So = function(t, n) {
|
|
|
973
971
|
o += s, s *= 2;
|
|
974
972
|
return cn(t, n, r, Math.min(o, l - 1), Math.floor(o / 2), i);
|
|
975
973
|
}, kt = function(t, n, r, o, i, l, s) {
|
|
976
|
-
var c = t === "column" ? n.width : n.height,
|
|
974
|
+
var c = t === "column" ? n.width : n.height, p = ie(t, n, r, l), h = t === "column" ? ln(n, l) : sn(n, l), m = Math.max(0, Math.min(h - c, p.offset)), u = Math.max(0, p.offset - c + s + p.size);
|
|
977
975
|
switch (o === "smart" && (i >= u - c && i <= m + c ? o = "auto" : o = "center"), o) {
|
|
978
976
|
case "start":
|
|
979
977
|
return m;
|
|
@@ -993,9 +991,9 @@ var So = function(t, n) {
|
|
|
993
991
|
return Ft("column", t, r, n);
|
|
994
992
|
},
|
|
995
993
|
getColumnStopIndexForStartIndex: function(t, n, r, o) {
|
|
996
|
-
for (var i = t.columnCount, l = t.width, s = ie("column", t, n, o), c = r + l,
|
|
997
|
-
|
|
998
|
-
return
|
|
994
|
+
for (var i = t.columnCount, l = t.width, s = ie("column", t, n, o), c = r + l, p = s.offset + s.size, h = n; h < i - 1 && p < c; )
|
|
995
|
+
h++, p += ie("column", t, h, o).size;
|
|
996
|
+
return h;
|
|
999
997
|
},
|
|
1000
998
|
getColumnWidth: function(t, n, r) {
|
|
1001
999
|
return r.columnMetadataMap[n].size;
|
|
@@ -1018,9 +1016,9 @@ var So = function(t, n) {
|
|
|
1018
1016
|
return Ft("row", t, r, n);
|
|
1019
1017
|
},
|
|
1020
1018
|
getRowStopIndexForStartIndex: function(t, n, r, o) {
|
|
1021
|
-
for (var i = t.rowCount, l = t.height, s = ie("row", t, n, o), c = r + l,
|
|
1022
|
-
|
|
1023
|
-
return
|
|
1019
|
+
for (var i = t.rowCount, l = t.height, s = ie("row", t, n, o), c = r + l, p = s.offset + s.size, h = n; h < i - 1 && p < c; )
|
|
1020
|
+
h++, p += ie("row", t, h, o).size;
|
|
1021
|
+
return h;
|
|
1024
1022
|
},
|
|
1025
1023
|
initInstanceProps: function(t, n) {
|
|
1026
1024
|
var r = t, o = r.estimatedColumnWidth, i = r.estimatedRowHeight, l = {
|
|
@@ -1042,8 +1040,8 @@ var So = function(t, n) {
|
|
|
1042
1040
|
shouldForceUpdate: c
|
|
1043
1041
|
});
|
|
1044
1042
|
}, n.resetAfterIndices = function(s) {
|
|
1045
|
-
var c = s.columnIndex,
|
|
1046
|
-
typeof c == "number" && (l.lastMeasuredColumnIndex = Math.min(l.lastMeasuredColumnIndex, c - 1)), typeof
|
|
1043
|
+
var c = s.columnIndex, p = s.rowIndex, h = s.shouldForceUpdate, m = h === void 0 ? !0 : h;
|
|
1044
|
+
typeof c == "number" && (l.lastMeasuredColumnIndex = Math.min(l.lastMeasuredColumnIndex, c - 1)), typeof p == "number" && (l.lastMeasuredRowIndex = Math.min(l.lastMeasuredRowIndex, p - 1)), n._getItemStyleCache(-1), m && n.forceUpdate();
|
|
1047
1045
|
}, l;
|
|
1048
1046
|
},
|
|
1049
1047
|
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
@@ -1067,27 +1065,27 @@ function Wt(e, t) {
|
|
|
1067
1065
|
return !0;
|
|
1068
1066
|
return !1;
|
|
1069
1067
|
}
|
|
1070
|
-
var yo = ["style"],
|
|
1071
|
-
function
|
|
1072
|
-
var n = e.style, r = Et(e, yo), o = t.style, i = Et(t,
|
|
1068
|
+
var yo = ["style"], Ro = ["style"];
|
|
1069
|
+
function xo(e, t) {
|
|
1070
|
+
var n = e.style, r = Et(e, yo), o = t.style, i = Et(t, Ro);
|
|
1073
1071
|
return !Wt(n, o) && !Wt(r, i);
|
|
1074
1072
|
}
|
|
1075
1073
|
const Mo = () => {
|
|
1076
|
-
const { viewMode: e } = Ge(), { scrollMode: t } = Pe(), { setColumnCount: n } = Bt(), { virtualScrollableElementRef: r } = Ue(), o = Xt(), i =
|
|
1074
|
+
const { viewMode: e } = Ge(), { scrollMode: t } = Pe(), { setColumnCount: n } = Bt(), { virtualScrollableElementRef: r } = Ue(), o = Xt(), i = M(
|
|
1077
1075
|
(f) => o.widths[f] || 0,
|
|
1078
1076
|
[o]
|
|
1079
|
-
), l =
|
|
1077
|
+
), l = M(
|
|
1080
1078
|
(f) => o.heights[f] || 0,
|
|
1081
1079
|
[o]
|
|
1082
|
-
), s = D(() => o.heights.length, [o]), c = D(() => Math.max(...o.widths), [o]),
|
|
1083
|
-
|
|
1084
|
-
n(
|
|
1085
|
-
}, [
|
|
1086
|
-
const
|
|
1080
|
+
), s = D(() => o.heights.length, [o]), c = D(() => Math.max(...o.widths), [o]), p = D(() => t === Q.HORIZONTAL_SCROLLING ? s : e === ze.DUAL_PAGE ? 2 : 1, [e, t, t, s, r, c]);
|
|
1081
|
+
A(() => {
|
|
1082
|
+
n(p);
|
|
1083
|
+
}, [p, n]);
|
|
1084
|
+
const h = D(() => t === Q.HORIZONTAL_SCROLLING || t === Q.PAGE_SCROLLING ? 1 : Math.round(s / p), [p, s, t]), m = D(() => o.heights.reduce((f, v) => f + v, 0) / o.heights.length || 0, [o]), u = D(() => o.widths.reduce((f, v) => f + v, 0) / o.heights.length || 0, [o]);
|
|
1087
1085
|
return {
|
|
1088
|
-
rowCount:
|
|
1086
|
+
rowCount: h,
|
|
1089
1087
|
rowHeight: l,
|
|
1090
|
-
columnCount:
|
|
1088
|
+
columnCount: p,
|
|
1091
1089
|
columnWidth: i,
|
|
1092
1090
|
pageDimension: o,
|
|
1093
1091
|
estimatedRowHeight: m,
|
|
@@ -1114,18 +1112,18 @@ function Lo(e) {
|
|
|
1114
1112
|
let t, n, r, o, i, l, s;
|
|
1115
1113
|
const c = typeof document < "u" && document.attachEvent;
|
|
1116
1114
|
if (!c) {
|
|
1117
|
-
l = function(
|
|
1118
|
-
const
|
|
1119
|
-
T.scrollLeft = T.scrollWidth, T.scrollTop = T.scrollHeight, d.style.width =
|
|
1120
|
-
}, i = function(
|
|
1121
|
-
return
|
|
1122
|
-
}, s = function(
|
|
1123
|
-
if (
|
|
1115
|
+
l = function(b) {
|
|
1116
|
+
const S = b.__resizeTriggers__, P = S.firstElementChild, T = S.lastElementChild, d = P.firstElementChild;
|
|
1117
|
+
T.scrollLeft = T.scrollWidth, T.scrollTop = T.scrollHeight, d.style.width = P.offsetWidth + 1 + "px", d.style.height = P.offsetHeight + 1 + "px", P.scrollLeft = P.scrollWidth, P.scrollTop = P.scrollHeight;
|
|
1118
|
+
}, i = function(b) {
|
|
1119
|
+
return b.offsetWidth !== b.__resizeLast__.width || b.offsetHeight !== b.__resizeLast__.height;
|
|
1120
|
+
}, s = function(b) {
|
|
1121
|
+
if (b.target.className && typeof b.target.className.indexOf == "function" && b.target.className.indexOf("contract-trigger") < 0 && b.target.className.indexOf("expand-trigger") < 0)
|
|
1124
1122
|
return;
|
|
1125
|
-
const
|
|
1123
|
+
const S = this;
|
|
1126
1124
|
l(this), this.__resizeRAF__ && ut(this.__resizeRAF__), this.__resizeRAF__ = dt(function() {
|
|
1127
|
-
i(
|
|
1128
|
-
d.call(
|
|
1125
|
+
i(S) && (S.__resizeLast__.width = S.offsetWidth, S.__resizeLast__.height = S.offsetHeight, S.__resizeListeners__.forEach(function(d) {
|
|
1126
|
+
d.call(S, b);
|
|
1129
1127
|
}));
|
|
1130
1128
|
});
|
|
1131
1129
|
};
|
|
@@ -1134,18 +1132,18 @@ function Lo(e) {
|
|
|
1134
1132
|
const v = "Webkit Moz O ms".split(" ");
|
|
1135
1133
|
let _ = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), g = "";
|
|
1136
1134
|
{
|
|
1137
|
-
const
|
|
1138
|
-
if (
|
|
1139
|
-
for (let
|
|
1140
|
-
if (
|
|
1141
|
-
g = v[
|
|
1135
|
+
const b = document.createElement("fakeelement");
|
|
1136
|
+
if (b.style.animationName !== void 0 && (u = !0), u === !1) {
|
|
1137
|
+
for (let S = 0; S < v.length; S++)
|
|
1138
|
+
if (b.style[v[S] + "AnimationName"] !== void 0) {
|
|
1139
|
+
g = v[S], f = "-" + g.toLowerCase() + "-", r = _[S], u = !0;
|
|
1142
1140
|
break;
|
|
1143
1141
|
}
|
|
1144
1142
|
}
|
|
1145
1143
|
}
|
|
1146
1144
|
n = "resizeanim", t = "@" + f + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", o = f + "animation: 1ms " + n + "; ";
|
|
1147
1145
|
}
|
|
1148
|
-
const
|
|
1146
|
+
const p = function(u) {
|
|
1149
1147
|
if (!u.getElementById("detectElementResize")) {
|
|
1150
1148
|
const f = (t || "") + ".resize-triggers { " + (o || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', v = u.head || u.getElementsByTagName("head")[0], _ = u.createElement("style");
|
|
1151
1149
|
_.id = "detectElementResize", _.type = "text/css", e != null && _.setAttribute("nonce", e), _.styleSheet ? _.styleSheet.cssText = f : _.appendChild(u.createTextNode(f)), v.appendChild(_);
|
|
@@ -1158,12 +1156,12 @@ function Lo(e) {
|
|
|
1158
1156
|
else {
|
|
1159
1157
|
if (!u.__resizeTriggers__) {
|
|
1160
1158
|
const v = u.ownerDocument, _ = J.getComputedStyle(u);
|
|
1161
|
-
_ && _.position === "static" && (u.style.position = "relative"),
|
|
1159
|
+
_ && _.position === "static" && (u.style.position = "relative"), p(v), u.__resizeLast__ = {}, u.__resizeListeners__ = [], (u.__resizeTriggers__ = v.createElement("div")).className = "resize-triggers";
|
|
1162
1160
|
const g = v.createElement("div");
|
|
1163
1161
|
g.className = "expand-trigger", g.appendChild(v.createElement("div"));
|
|
1164
|
-
const
|
|
1165
|
-
|
|
1166
|
-
|
|
1162
|
+
const b = v.createElement("div");
|
|
1163
|
+
b.className = "contract-trigger", u.__resizeTriggers__.appendChild(g), u.__resizeTriggers__.appendChild(b), u.appendChild(u.__resizeTriggers__), l(u), u.addEventListener("scroll", s, !0), r && (u.__resizeTriggers__.__animationListener__ = function(P) {
|
|
1164
|
+
P.animationName === n && l(u);
|
|
1167
1165
|
}, u.__resizeTriggers__.addEventListener(r, u.__resizeTriggers__.__animationListener__));
|
|
1168
1166
|
}
|
|
1169
1167
|
u.__resizeListeners__.push(f);
|
|
@@ -1197,7 +1195,7 @@ class No extends Fn {
|
|
|
1197
1195
|
onResize: o
|
|
1198
1196
|
} = this.props;
|
|
1199
1197
|
if (this._parentNode) {
|
|
1200
|
-
const i = window.getComputedStyle(this._parentNode) || {}, l = parseFloat(i.paddingLeft || "0"), s = parseFloat(i.paddingRight || "0"), c = parseFloat(i.paddingTop || "0"),
|
|
1198
|
+
const i = window.getComputedStyle(this._parentNode) || {}, l = parseFloat(i.paddingLeft || "0"), s = parseFloat(i.paddingRight || "0"), c = parseFloat(i.paddingTop || "0"), p = parseFloat(i.paddingBottom || "0"), h = this._parentNode.getBoundingClientRect(), m = h.height - c - p, u = h.width - l - s, f = this._parentNode.offsetHeight - c - p, v = this._parentNode.offsetWidth - l - s;
|
|
1201
1199
|
(!n && (this.state.height !== f || this.state.scaledHeight !== m) || !r && (this.state.width !== v || this.state.scaledWidth !== u)) && (this.setState({
|
|
1202
1200
|
height: f,
|
|
1203
1201
|
width: v,
|
|
@@ -1239,8 +1237,8 @@ class No extends Fn {
|
|
|
1239
1237
|
doNotBailOutOnEmptyChildren: l = !1,
|
|
1240
1238
|
nonce: s,
|
|
1241
1239
|
onResize: c,
|
|
1242
|
-
style:
|
|
1243
|
-
tagName:
|
|
1240
|
+
style: p = {},
|
|
1241
|
+
tagName: h = "div",
|
|
1244
1242
|
...m
|
|
1245
1243
|
} = this.props, {
|
|
1246
1244
|
height: u,
|
|
@@ -1249,42 +1247,42 @@ class No extends Fn {
|
|
|
1249
1247
|
width: _
|
|
1250
1248
|
} = this.state, g = {
|
|
1251
1249
|
overflow: "visible"
|
|
1252
|
-
},
|
|
1253
|
-
let
|
|
1254
|
-
return o || (u === 0 && (
|
|
1250
|
+
}, b = {};
|
|
1251
|
+
let S = !1;
|
|
1252
|
+
return o || (u === 0 && (S = !0), g.height = 0, b.height = u, b.scaledHeight = f), i || (_ === 0 && (S = !0), g.width = 0, b.width = _, b.scaledWidth = v), l && (S = !1), Ne(h, {
|
|
1255
1253
|
ref: this._setRef,
|
|
1256
1254
|
style: {
|
|
1257
1255
|
...g,
|
|
1258
|
-
...
|
|
1256
|
+
...p
|
|
1259
1257
|
},
|
|
1260
1258
|
...m
|
|
1261
|
-
}, !
|
|
1259
|
+
}, !S && t(b));
|
|
1262
1260
|
}
|
|
1263
1261
|
}
|
|
1264
1262
|
const Eo = (e = 1) => {
|
|
1265
|
-
const [t, n] = F(e), [r, o] = F(0), { scrollToPage: i } = _t(), l = $(1), { isScrolling: s } = Kt(), { viewMode: c } = Ge(), { scrollMode:
|
|
1263
|
+
const [t, n] = F(e), [r, o] = F(0), { scrollToPage: i } = _t(), l = $(1), { isScrolling: s } = Kt(), { viewMode: c } = Ge(), { scrollMode: p } = Pe(), h = yr(t, 100), m = M(
|
|
1266
1264
|
(g) => {
|
|
1267
1265
|
if (!/^[0-9]*$/g.test(g.toString()) || !g)
|
|
1268
1266
|
return { success: !1, currentPage: l.current };
|
|
1269
|
-
const
|
|
1270
|
-
return
|
|
1267
|
+
const S = +g;
|
|
1268
|
+
return S < 0 || S > r ? { success: !1, currentPage: l.current } : (n(S), l.current = S, { success: !0, currentPage: +g });
|
|
1271
1269
|
},
|
|
1272
1270
|
[r]
|
|
1273
|
-
), u =
|
|
1271
|
+
), u = M(m, [m]), f = M(
|
|
1274
1272
|
(g) => {
|
|
1275
|
-
const
|
|
1276
|
-
return
|
|
1273
|
+
const b = m(g);
|
|
1274
|
+
return b.success && (s.current = !0, i(b.currentPage)), b;
|
|
1277
1275
|
},
|
|
1278
1276
|
[m, i]
|
|
1279
|
-
), v =
|
|
1277
|
+
), v = M(() => {
|
|
1280
1278
|
let g = t - 1;
|
|
1281
1279
|
f(g);
|
|
1282
|
-
}, [f, t, c,
|
|
1280
|
+
}, [f, t, c, p]), _ = M(() => {
|
|
1283
1281
|
let g = t + 1;
|
|
1284
1282
|
f(g);
|
|
1285
|
-
}, [f, t, c,
|
|
1283
|
+
}, [f, t, c, p]);
|
|
1286
1284
|
return {
|
|
1287
|
-
focusedPage:
|
|
1285
|
+
focusedPage: h,
|
|
1288
1286
|
totalPages: r,
|
|
1289
1287
|
setFocusedPage: u,
|
|
1290
1288
|
setTotalPages: o,
|
|
@@ -1304,14 +1302,14 @@ const Eo = (e = 1) => {
|
|
|
1304
1302
|
},
|
|
1305
1303
|
nextPage: () => {
|
|
1306
1304
|
}
|
|
1307
|
-
}),
|
|
1305
|
+
}), ee = () => {
|
|
1308
1306
|
const e = He(un);
|
|
1309
|
-
return typeof (e == null ? void 0 : e.focusedPage) > "u" &&
|
|
1307
|
+
return typeof (e == null ? void 0 : e.focusedPage) > "u" && Rr.error("Please use this hooks inside children component of RPController or RPLayout"), e;
|
|
1310
1308
|
}, Oo = ({ children: e }) => {
|
|
1311
|
-
const { initialPage: t = 1 } = gr(), { pdf: n } = Y(), { focusedPage: r, totalPages: o, setFocusedPage: i, setTotalPages: l, goToPage: s, nextPage: c, prevPage:
|
|
1312
|
-
return
|
|
1309
|
+
const { initialPage: t = 1 } = gr(), { pdf: n } = Y(), { focusedPage: r, totalPages: o, setFocusedPage: i, setTotalPages: l, goToPage: s, nextPage: c, prevPage: p } = Eo(t);
|
|
1310
|
+
return A(() => {
|
|
1313
1311
|
n != null && n.numPages && l(n.numPages);
|
|
1314
|
-
}, [n, l, o, t]),
|
|
1312
|
+
}, [n, l, o, t]), A(() => {
|
|
1315
1313
|
requestAnimationFrame(() => {
|
|
1316
1314
|
s(t);
|
|
1317
1315
|
});
|
|
@@ -1324,18 +1322,18 @@ const Eo = (e = 1) => {
|
|
|
1324
1322
|
setFocusedPage: i,
|
|
1325
1323
|
setTotalPages: l,
|
|
1326
1324
|
nextPage: c,
|
|
1327
|
-
prevPage:
|
|
1325
|
+
prevPage: p,
|
|
1328
1326
|
goToPage: s
|
|
1329
1327
|
},
|
|
1330
1328
|
children: e
|
|
1331
1329
|
}
|
|
1332
1330
|
);
|
|
1333
1331
|
}, Do = ({ widths: e, heights: t }) => {
|
|
1334
|
-
const { focusedPage: n, totalPages: r } =
|
|
1332
|
+
const { focusedPage: n, totalPages: r } = ee(), o = D(() => {
|
|
1335
1333
|
const s = [], c = Math.ceil(n / 2) * 2 - 1;
|
|
1336
1334
|
if (s.push(c), c + 1 < r) {
|
|
1337
|
-
const
|
|
1338
|
-
s.push(
|
|
1335
|
+
const p = c + 1;
|
|
1336
|
+
s.push(p);
|
|
1339
1337
|
}
|
|
1340
1338
|
return s;
|
|
1341
1339
|
}, [n, r]), i = D(() => [
|
|
@@ -1355,7 +1353,7 @@ const Eo = (e = 1) => {
|
|
|
1355
1353
|
], [e, t, o]), l = D(() => i.reduce((s, c) => s + Number(c.width || 0), 0), [i]);
|
|
1356
1354
|
return /* @__PURE__ */ a("div", { style: { width: l, position: "relative" }, children: o.map((s, c) => /* @__PURE__ */ a(wt, { style: i[c], pageNumber: s }, s)) });
|
|
1357
1355
|
}, Ao = ({ widths: e, heights: t }) => {
|
|
1358
|
-
const { focusedPage: n } =
|
|
1356
|
+
const { focusedPage: n } = ee(), r = D(() => ({
|
|
1359
1357
|
position: "absolute",
|
|
1360
1358
|
width: e(n - 1),
|
|
1361
1359
|
height: t(n - 1)
|
|
@@ -1381,7 +1379,7 @@ const Eo = (e = 1) => {
|
|
|
1381
1379
|
},
|
|
1382
1380
|
o
|
|
1383
1381
|
);
|
|
1384
|
-
},
|
|
1382
|
+
}, xo), es = () => {
|
|
1385
1383
|
const { getContainer: e, container: t } = Sr(), { scrollToPage: n } = _t(), {
|
|
1386
1384
|
virtualScrollRef: r,
|
|
1387
1385
|
getVirtualScrollRef: o,
|
|
@@ -1389,73 +1387,73 @@ const Eo = (e = 1) => {
|
|
|
1389
1387
|
getVirtualScrollableElementRef: l,
|
|
1390
1388
|
setTotalInnerDimensions: s,
|
|
1391
1389
|
totalInnerDimensions: c
|
|
1392
|
-
} = Ue(), { nextPage:
|
|
1390
|
+
} = Ue(), { nextPage: p, prevPage: h, setFocusedPage: m, focusedPage: u } = ee(), { scrollMode: f } = Pe(), { viewMode: v } = Ge(), _ = $(null), g = $({
|
|
1393
1391
|
height: 0,
|
|
1394
1392
|
width: 0
|
|
1395
|
-
}),
|
|
1393
|
+
}), b = $({
|
|
1396
1394
|
viewMode: v,
|
|
1397
1395
|
scrollMode: f
|
|
1398
|
-
}), { isFullScreen:
|
|
1399
|
-
pageDimension:
|
|
1396
|
+
}), { isFullScreen: S } = _r(), {
|
|
1397
|
+
pageDimension: P,
|
|
1400
1398
|
rowCount: T,
|
|
1401
1399
|
rowHeight: d,
|
|
1402
|
-
columnCount:
|
|
1403
|
-
columnWidth:
|
|
1404
|
-
estimatedColumnWidth:
|
|
1405
|
-
estimatedRowHeight:
|
|
1406
|
-
} = Mo(), [
|
|
1400
|
+
columnCount: C,
|
|
1401
|
+
columnWidth: w,
|
|
1402
|
+
estimatedColumnWidth: I,
|
|
1403
|
+
estimatedRowHeight: y
|
|
1404
|
+
} = Mo(), [R, L] = F({}), { isScrolling: N } = Kt(), x = $(), E = $({
|
|
1407
1405
|
scrollTop: 0,
|
|
1408
1406
|
scrollLeft: 0
|
|
1409
|
-
}), { isPressed:
|
|
1410
|
-
isPressed:
|
|
1411
|
-
}), U = D(() =>
|
|
1412
|
-
|
|
1407
|
+
}), { isPressed: z } = Tr(), { selectionMode: k } = fr(), { initializeGrabScroll: G, scrollBehavior: Z } = Ir({
|
|
1408
|
+
isPressed: z
|
|
1409
|
+
}), U = D(() => k === jt.HAND, [k]), K = M((W, H) => {
|
|
1410
|
+
L((q) => ({ ...q, [W]: Math.round(H * 100) }));
|
|
1413
1411
|
}, []), ue = D(() => ({
|
|
1414
|
-
columnCount:
|
|
1412
|
+
columnCount: C,
|
|
1415
1413
|
handleIntersectRatioChange: K
|
|
1416
|
-
}), [
|
|
1417
|
-
(
|
|
1414
|
+
}), [C, K]), oe = M(
|
|
1415
|
+
(W) => {
|
|
1418
1416
|
const H = document.activeElement !== t;
|
|
1419
|
-
!
|
|
1417
|
+
!S && H || (["ArrowUp", "ArrowLeft"].includes(W.key) ? (W.preventDefault(), h()) : ["ArrowDown", "ArrowRight"].includes(W.key) && (W.preventDefault(), p()));
|
|
1420
1418
|
},
|
|
1421
|
-
[
|
|
1422
|
-
), ve =
|
|
1419
|
+
[p, h, S, f]
|
|
1420
|
+
), ve = M((W) => {
|
|
1423
1421
|
E.current = {
|
|
1424
|
-
scrollTop:
|
|
1425
|
-
scrollLeft:
|
|
1422
|
+
scrollTop: W.scrollTop,
|
|
1423
|
+
scrollLeft: W.scrollLeft
|
|
1426
1424
|
};
|
|
1427
1425
|
}, []);
|
|
1428
|
-
|
|
1426
|
+
A(() => (window.addEventListener("keydown", oe), () => {
|
|
1429
1427
|
window.removeEventListener("keydown", oe);
|
|
1430
|
-
}), [oe]),
|
|
1428
|
+
}), [oe]), A(() => {
|
|
1431
1429
|
if (_.current && (_.current.style.position = "relative"), !!r) {
|
|
1432
1430
|
g.current = c, s({
|
|
1433
1431
|
height: Array.from({ length: T }).reduce(
|
|
1434
|
-
(
|
|
1432
|
+
(W, H, q) => W + d(q),
|
|
1435
1433
|
0
|
|
1436
1434
|
),
|
|
1437
|
-
width: Array.from({ length:
|
|
1438
|
-
(
|
|
1435
|
+
width: Array.from({ length: C }).reduce(
|
|
1436
|
+
(W, H, q) => W + w(q),
|
|
1439
1437
|
0
|
|
1440
1438
|
)
|
|
1441
1439
|
});
|
|
1442
|
-
for (let
|
|
1443
|
-
for (let H = 0; H <
|
|
1440
|
+
for (let W = 0; W < T; W++)
|
|
1441
|
+
for (let H = 0; H < C; H++)
|
|
1444
1442
|
r.resetAfterIndices({
|
|
1445
1443
|
columnIndex: H,
|
|
1446
|
-
rowIndex:
|
|
1444
|
+
rowIndex: W,
|
|
1447
1445
|
shouldForceUpdate: !0
|
|
1448
1446
|
});
|
|
1449
1447
|
}
|
|
1450
|
-
}, [T,
|
|
1451
|
-
if (
|
|
1448
|
+
}, [T, C, P, r, n]), A(() => {
|
|
1449
|
+
if (N.current)
|
|
1452
1450
|
return;
|
|
1453
|
-
if (
|
|
1454
|
-
|
|
1451
|
+
if (b.current.viewMode !== v || b.current.scrollMode !== f) {
|
|
1452
|
+
x.current && clearTimeout(x.current), L({}), n(u), f === Q.HORIZONTAL_SCROLLING && (r == null || r.scrollTo({
|
|
1455
1453
|
scrollTop: 0
|
|
1456
|
-
})),
|
|
1454
|
+
})), x.current = setTimeout(() => {
|
|
1457
1455
|
requestAnimationFrame(() => {
|
|
1458
|
-
|
|
1456
|
+
b.current = { viewMode: v, scrollMode: f };
|
|
1459
1457
|
});
|
|
1460
1458
|
}, 100);
|
|
1461
1459
|
return;
|
|
@@ -1468,46 +1466,46 @@ const Eo = (e = 1) => {
|
|
|
1468
1466
|
scrollLeft: An
|
|
1469
1467
|
});
|
|
1470
1468
|
}
|
|
1471
|
-
}, [c, v, f]),
|
|
1472
|
-
const
|
|
1473
|
-
if (
|
|
1474
|
-
|
|
1469
|
+
}, [c, v, f]), A(() => {
|
|
1470
|
+
const W = Object.entries(R);
|
|
1471
|
+
if (N.current) {
|
|
1472
|
+
N.current && (N.current = !1);
|
|
1475
1473
|
return;
|
|
1476
1474
|
}
|
|
1477
1475
|
let H = 0, q = -1;
|
|
1478
|
-
|
|
1476
|
+
W.forEach((le) => {
|
|
1479
1477
|
q < le[1] && (H = Number(le[0]), q = le[1]);
|
|
1480
1478
|
}), H && m(H);
|
|
1481
|
-
}, [
|
|
1482
|
-
|
|
1479
|
+
}, [R, m]), A(() => () => {
|
|
1480
|
+
x.current && clearTimeout(x.current);
|
|
1483
1481
|
}, []);
|
|
1484
1482
|
const _e = D(() => j(ae["rp-pages-container"], {
|
|
1485
|
-
[ae["rp-cursor-grab"]]: U && !
|
|
1486
|
-
[ae["rp-cursor-grabbing"]]: U &&
|
|
1487
|
-
}), [U,
|
|
1488
|
-
(
|
|
1489
|
-
if (U &&
|
|
1483
|
+
[ae["rp-cursor-grab"]]: U && !z,
|
|
1484
|
+
[ae["rp-cursor-grabbing"]]: U && z
|
|
1485
|
+
}), [U, z]), Se = M(
|
|
1486
|
+
(W) => {
|
|
1487
|
+
if (U && W) {
|
|
1490
1488
|
const H = j(ae["rp-pages"]), q = document.querySelector(`.${H}`);
|
|
1491
1489
|
G(q);
|
|
1492
1490
|
}
|
|
1493
1491
|
},
|
|
1494
1492
|
[U, G, ae]
|
|
1495
1493
|
);
|
|
1496
|
-
return /* @__PURE__ */ a("div", { ref: e, tabIndex: -1, className: _e, children: /* @__PURE__ */ a(No, { children: ({ width:
|
|
1494
|
+
return /* @__PURE__ */ a("div", { ref: e, tabIndex: -1, className: _e, children: /* @__PURE__ */ a(No, { children: ({ width: W, height: H }) => /* @__PURE__ */ a(
|
|
1497
1495
|
"div",
|
|
1498
1496
|
{
|
|
1499
1497
|
"data-rp": "pagesWrapper",
|
|
1500
1498
|
ref: Se,
|
|
1501
|
-
style: { width:
|
|
1499
|
+
style: { width: W, height: H, scrollBehavior: Z },
|
|
1502
1500
|
children: f === Q.PAGE_SCROLLING ? /* @__PURE__ */ a(
|
|
1503
1501
|
"div",
|
|
1504
1502
|
{
|
|
1505
1503
|
ref: i,
|
|
1506
|
-
style: { width:
|
|
1504
|
+
style: { width: W, height: H },
|
|
1507
1505
|
className: j(ae["rp-pages"], ae["rp-page-scrolling-wrapper"]),
|
|
1508
|
-
children: v === ze.DUAL_PAGE ? /* @__PURE__ */ a(Do, { widths:
|
|
1506
|
+
children: v === ze.DUAL_PAGE ? /* @__PURE__ */ a(Do, { widths: w, heights: d }) : /* @__PURE__ */ a(Ao, { widths: w, heights: d })
|
|
1509
1507
|
}
|
|
1510
|
-
) :
|
|
1508
|
+
) : I ? /* @__PURE__ */ a(
|
|
1511
1509
|
Io,
|
|
1512
1510
|
{
|
|
1513
1511
|
ref: o,
|
|
@@ -1515,13 +1513,13 @@ const Eo = (e = 1) => {
|
|
|
1515
1513
|
outerRef: l,
|
|
1516
1514
|
innerRef: _,
|
|
1517
1515
|
onScroll: ve,
|
|
1518
|
-
columnCount:
|
|
1519
|
-
columnWidth:
|
|
1516
|
+
columnCount: C,
|
|
1517
|
+
columnWidth: w,
|
|
1520
1518
|
rowHeight: d,
|
|
1521
1519
|
height: H,
|
|
1522
|
-
width:
|
|
1523
|
-
estimatedColumnWidth:
|
|
1524
|
-
estimatedRowHeight:
|
|
1520
|
+
width: W,
|
|
1521
|
+
estimatedColumnWidth: I,
|
|
1522
|
+
estimatedRowHeight: y,
|
|
1525
1523
|
rowCount: T,
|
|
1526
1524
|
className: j(
|
|
1527
1525
|
ae["rp-pages"],
|
|
@@ -1544,25 +1542,25 @@ const Eo = (e = 1) => {
|
|
|
1544
1542
|
"rp-page-input": "_rp-page-input_1vu6o_6",
|
|
1545
1543
|
"rp-total-page": "_rp-total-page_1vu6o_12"
|
|
1546
1544
|
}, Fo = () => {
|
|
1547
|
-
const { prevIcon: e } =
|
|
1545
|
+
const { prevIcon: e } = re();
|
|
1548
1546
|
return e || /* @__PURE__ */ a(Me, {});
|
|
1549
1547
|
}, ko = () => {
|
|
1550
|
-
const { nextIcon: e } =
|
|
1548
|
+
const { nextIcon: e } = re();
|
|
1551
1549
|
return e || /* @__PURE__ */ a(Me, { style: { transform: "rotate(180deg" } });
|
|
1552
1550
|
}, Wo = () => {
|
|
1553
|
-
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: i } =
|
|
1554
|
-
|
|
1551
|
+
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: i } = ee(), [l, s] = F(e.toString()), { pageNavigationTool: c = !0 } = se(), { isSmallScreen: p } = ge();
|
|
1552
|
+
A(() => {
|
|
1555
1553
|
s(e.toString());
|
|
1556
1554
|
}, [e]);
|
|
1557
|
-
const
|
|
1555
|
+
const h = M((v) => {
|
|
1558
1556
|
const _ = v.target.value;
|
|
1559
1557
|
s(_);
|
|
1560
|
-
}, []), m =
|
|
1558
|
+
}, []), m = M(() => {
|
|
1561
1559
|
const v = i(l);
|
|
1562
1560
|
v.success || s(v.currentPage.toString());
|
|
1563
|
-
}, [i, l, t]), u =
|
|
1561
|
+
}, [i, l, t]), u = M(() => {
|
|
1564
1562
|
s(e.toString());
|
|
1565
|
-
}, [e]), f =
|
|
1563
|
+
}, [e]), f = M(
|
|
1566
1564
|
(v) => {
|
|
1567
1565
|
v.key === "Enter" && m();
|
|
1568
1566
|
},
|
|
@@ -1579,13 +1577,13 @@ const Eo = (e = 1) => {
|
|
|
1579
1577
|
changePage: n
|
|
1580
1578
|
}
|
|
1581
1579
|
) : c ? /* @__PURE__ */ O("div", { className: tt["rp-paginate"], children: [
|
|
1582
|
-
!
|
|
1580
|
+
!p && /* @__PURE__ */ a(X, { content: "Previous page", children: /* @__PURE__ */ a(B, { onClick: o, disabled: e === 1, children: /* @__PURE__ */ a(Fo, {}) }) }),
|
|
1583
1581
|
/* @__PURE__ */ a(
|
|
1584
1582
|
Zt,
|
|
1585
1583
|
{
|
|
1586
1584
|
onKeyDown: f,
|
|
1587
1585
|
onBlur: u,
|
|
1588
|
-
onChange:
|
|
1586
|
+
onChange: h,
|
|
1589
1587
|
value: l,
|
|
1590
1588
|
className: tt["rp-page-input"]
|
|
1591
1589
|
}
|
|
@@ -1594,10 +1592,10 @@ const Eo = (e = 1) => {
|
|
|
1594
1592
|
"/",
|
|
1595
1593
|
t
|
|
1596
1594
|
] }),
|
|
1597
|
-
!
|
|
1595
|
+
!p && /* @__PURE__ */ a(X, { content: "Next page", children: /* @__PURE__ */ a(B, { onClick: r, disabled: e === t, children: /* @__PURE__ */ a(ko, {}) }) })
|
|
1598
1596
|
] }) : null;
|
|
1599
1597
|
};
|
|
1600
|
-
var bt = "Dialog", [dn, ts] = Lr(bt), [Ho,
|
|
1598
|
+
var bt = "Dialog", [dn, ts] = Lr(bt), [Ho, te] = dn(bt), pn = (e) => {
|
|
1601
1599
|
const {
|
|
1602
1600
|
__scopeDialog: t,
|
|
1603
1601
|
children: n,
|
|
@@ -1605,7 +1603,7 @@ var bt = "Dialog", [dn, ts] = Lr(bt), [Ho, ee] = dn(bt), pn = (e) => {
|
|
|
1605
1603
|
defaultOpen: o,
|
|
1606
1604
|
onOpenChange: i,
|
|
1607
1605
|
modal: l = !0
|
|
1608
|
-
} = e, s = V.useRef(null), c = V.useRef(null), [
|
|
1606
|
+
} = e, s = V.useRef(null), c = V.useRef(null), [p = !1, h] = kr({
|
|
1609
1607
|
prop: r,
|
|
1610
1608
|
defaultProp: o,
|
|
1611
1609
|
onChange: i
|
|
@@ -1619,9 +1617,9 @@ var bt = "Dialog", [dn, ts] = Lr(bt), [Ho, ee] = dn(bt), pn = (e) => {
|
|
|
1619
1617
|
contentId: Be(),
|
|
1620
1618
|
titleId: Be(),
|
|
1621
1619
|
descriptionId: Be(),
|
|
1622
|
-
open:
|
|
1623
|
-
onOpenChange:
|
|
1624
|
-
onOpenToggle: V.useCallback(() =>
|
|
1620
|
+
open: p,
|
|
1621
|
+
onOpenChange: h,
|
|
1622
|
+
onOpenToggle: V.useCallback(() => h((m) => !m), [h]),
|
|
1625
1623
|
modal: l,
|
|
1626
1624
|
children: n
|
|
1627
1625
|
}
|
|
@@ -1630,7 +1628,7 @@ var bt = "Dialog", [dn, ts] = Lr(bt), [Ho, ee] = dn(bt), pn = (e) => {
|
|
|
1630
1628
|
pn.displayName = bt;
|
|
1631
1629
|
var hn = "DialogTrigger", $o = V.forwardRef(
|
|
1632
1630
|
(e, t) => {
|
|
1633
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1631
|
+
const { __scopeDialog: n, ...r } = e, o = te(hn, n), i = mt(t, o.triggerRef);
|
|
1634
1632
|
return /* @__PURE__ */ a(
|
|
1635
1633
|
Le.button,
|
|
1636
1634
|
{
|
|
@@ -1641,7 +1639,7 @@ var hn = "DialogTrigger", $o = V.forwardRef(
|
|
|
1641
1639
|
"data-state": St(o.open),
|
|
1642
1640
|
...r,
|
|
1643
1641
|
ref: i,
|
|
1644
|
-
onClick:
|
|
1642
|
+
onClick: xe(e.onClick, o.onOpenToggle)
|
|
1645
1643
|
}
|
|
1646
1644
|
);
|
|
1647
1645
|
}
|
|
@@ -1650,20 +1648,20 @@ $o.displayName = hn;
|
|
|
1650
1648
|
var Ct = "DialogPortal", [Vo, fn] = dn(Ct, {
|
|
1651
1649
|
forceMount: void 0
|
|
1652
1650
|
}), mn = (e) => {
|
|
1653
|
-
const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, i =
|
|
1651
|
+
const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, i = te(Ct, t);
|
|
1654
1652
|
return /* @__PURE__ */ a(Vo, { scope: t, forceMount: n, children: V.Children.map(r, (l) => /* @__PURE__ */ a(gt, { present: n || i.open, children: /* @__PURE__ */ a(Wr, { asChild: !0, container: o, children: l }) })) });
|
|
1655
1653
|
};
|
|
1656
1654
|
mn.displayName = Ct;
|
|
1657
1655
|
var ke = "DialogOverlay", gn = V.forwardRef(
|
|
1658
1656
|
(e, t) => {
|
|
1659
|
-
const n = fn(ke, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, i =
|
|
1657
|
+
const n = fn(ke, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, i = te(ke, e.__scopeDialog);
|
|
1660
1658
|
return i.modal ? /* @__PURE__ */ a(gt, { present: r || i.open, children: /* @__PURE__ */ a(Go, { ...o, ref: t }) }) : null;
|
|
1661
1659
|
}
|
|
1662
1660
|
);
|
|
1663
1661
|
gn.displayName = ke;
|
|
1664
1662
|
var Go = V.forwardRef(
|
|
1665
1663
|
(e, t) => {
|
|
1666
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1664
|
+
const { __scopeDialog: n, ...r } = e, o = te(ke, n);
|
|
1667
1665
|
return (
|
|
1668
1666
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
1669
1667
|
// ie. when `Overlay` and `Content` are siblings
|
|
@@ -1680,14 +1678,14 @@ var Go = V.forwardRef(
|
|
|
1680
1678
|
}
|
|
1681
1679
|
), me = "DialogContent", vn = V.forwardRef(
|
|
1682
1680
|
(e, t) => {
|
|
1683
|
-
const n = fn(me, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, i =
|
|
1681
|
+
const n = fn(me, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, i = te(me, e.__scopeDialog);
|
|
1684
1682
|
return /* @__PURE__ */ a(gt, { present: r || i.open, children: i.modal ? /* @__PURE__ */ a(Uo, { ...o, ref: t }) : /* @__PURE__ */ a(qo, { ...o, ref: t }) });
|
|
1685
1683
|
}
|
|
1686
1684
|
);
|
|
1687
1685
|
vn.displayName = me;
|
|
1688
1686
|
var Uo = V.forwardRef(
|
|
1689
1687
|
(e, t) => {
|
|
1690
|
-
const n =
|
|
1688
|
+
const n = te(me, e.__scopeDialog), r = V.useRef(null), o = mt(t, n.contentRef, r);
|
|
1691
1689
|
return V.useEffect(() => {
|
|
1692
1690
|
const i = r.current;
|
|
1693
1691
|
if (i)
|
|
@@ -1699,15 +1697,15 @@ var Uo = V.forwardRef(
|
|
|
1699
1697
|
ref: o,
|
|
1700
1698
|
trapFocus: n.open,
|
|
1701
1699
|
disableOutsidePointerEvents: !0,
|
|
1702
|
-
onCloseAutoFocus:
|
|
1700
|
+
onCloseAutoFocus: xe(e.onCloseAutoFocus, (i) => {
|
|
1703
1701
|
var l;
|
|
1704
1702
|
i.preventDefault(), (l = n.triggerRef.current) == null || l.focus();
|
|
1705
1703
|
}),
|
|
1706
|
-
onPointerDownOutside:
|
|
1704
|
+
onPointerDownOutside: xe(e.onPointerDownOutside, (i) => {
|
|
1707
1705
|
const l = i.detail.originalEvent, s = l.button === 0 && l.ctrlKey === !0;
|
|
1708
1706
|
(l.button === 2 || s) && i.preventDefault();
|
|
1709
1707
|
}),
|
|
1710
|
-
onFocusOutside:
|
|
1708
|
+
onFocusOutside: xe(
|
|
1711
1709
|
e.onFocusOutside,
|
|
1712
1710
|
(i) => i.preventDefault()
|
|
1713
1711
|
)
|
|
@@ -1716,7 +1714,7 @@ var Uo = V.forwardRef(
|
|
|
1716
1714
|
}
|
|
1717
1715
|
), qo = V.forwardRef(
|
|
1718
1716
|
(e, t) => {
|
|
1719
|
-
const n =
|
|
1717
|
+
const n = te(me, e.__scopeDialog), r = V.useRef(!1), o = V.useRef(!1);
|
|
1720
1718
|
return /* @__PURE__ */ a(
|
|
1721
1719
|
_n,
|
|
1722
1720
|
{
|
|
@@ -1729,17 +1727,17 @@ var Uo = V.forwardRef(
|
|
|
1729
1727
|
(l = e.onCloseAutoFocus) == null || l.call(e, i), i.defaultPrevented || (r.current || (s = n.triggerRef.current) == null || s.focus(), i.preventDefault()), r.current = !1, o.current = !1;
|
|
1730
1728
|
},
|
|
1731
1729
|
onInteractOutside: (i) => {
|
|
1732
|
-
var c,
|
|
1730
|
+
var c, p;
|
|
1733
1731
|
(c = e.onInteractOutside) == null || c.call(e, i), i.defaultPrevented || (r.current = !0, i.detail.originalEvent.type === "pointerdown" && (o.current = !0));
|
|
1734
1732
|
const l = i.target;
|
|
1735
|
-
((
|
|
1733
|
+
((p = n.triggerRef.current) == null ? void 0 : p.contains(l)) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && o.current && i.preventDefault();
|
|
1736
1734
|
}
|
|
1737
1735
|
}
|
|
1738
1736
|
);
|
|
1739
1737
|
}
|
|
1740
1738
|
), _n = V.forwardRef(
|
|
1741
1739
|
(e, t) => {
|
|
1742
|
-
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...l } = e, s =
|
|
1740
|
+
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...l } = e, s = te(me, n), c = V.useRef(null), p = mt(t, c);
|
|
1743
1741
|
return Dr(), /* @__PURE__ */ O(Ae, { children: [
|
|
1744
1742
|
/* @__PURE__ */ a(
|
|
1745
1743
|
Ar,
|
|
@@ -1758,7 +1756,7 @@ var Uo = V.forwardRef(
|
|
|
1758
1756
|
"aria-labelledby": s.titleId,
|
|
1759
1757
|
"data-state": St(s.open),
|
|
1760
1758
|
...l,
|
|
1761
|
-
ref:
|
|
1759
|
+
ref: p,
|
|
1762
1760
|
onDismiss: () => s.onOpenChange(!1)
|
|
1763
1761
|
}
|
|
1764
1762
|
)
|
|
@@ -1772,28 +1770,28 @@ var Uo = V.forwardRef(
|
|
|
1772
1770
|
}
|
|
1773
1771
|
), Pt = "DialogTitle", wn = V.forwardRef(
|
|
1774
1772
|
(e, t) => {
|
|
1775
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1773
|
+
const { __scopeDialog: n, ...r } = e, o = te(Pt, n);
|
|
1776
1774
|
return /* @__PURE__ */ a(Le.h2, { id: o.titleId, ...r, ref: t });
|
|
1777
1775
|
}
|
|
1778
1776
|
);
|
|
1779
1777
|
wn.displayName = Pt;
|
|
1780
1778
|
var bn = "DialogDescription", Zo = V.forwardRef(
|
|
1781
1779
|
(e, t) => {
|
|
1782
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1780
|
+
const { __scopeDialog: n, ...r } = e, o = te(bn, n);
|
|
1783
1781
|
return /* @__PURE__ */ a(Le.p, { id: o.descriptionId, ...r, ref: t });
|
|
1784
1782
|
}
|
|
1785
1783
|
);
|
|
1786
1784
|
Zo.displayName = bn;
|
|
1787
1785
|
var Cn = "DialogClose", Pn = V.forwardRef(
|
|
1788
1786
|
(e, t) => {
|
|
1789
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1787
|
+
const { __scopeDialog: n, ...r } = e, o = te(Cn, n);
|
|
1790
1788
|
return /* @__PURE__ */ a(
|
|
1791
1789
|
Le.button,
|
|
1792
1790
|
{
|
|
1793
1791
|
type: "button",
|
|
1794
1792
|
...r,
|
|
1795
1793
|
ref: t,
|
|
1796
|
-
onClick:
|
|
1794
|
+
onClick: xe(e.onClick, () => o.onOpenChange(!1))
|
|
1797
1795
|
}
|
|
1798
1796
|
);
|
|
1799
1797
|
}
|
|
@@ -1840,8 +1838,8 @@ const fe = {
|
|
|
1840
1838
|
filename: l,
|
|
1841
1839
|
title: s,
|
|
1842
1840
|
author: c,
|
|
1843
|
-
subject:
|
|
1844
|
-
createdOn:
|
|
1841
|
+
subject: p,
|
|
1842
|
+
createdOn: h,
|
|
1845
1843
|
creator: m,
|
|
1846
1844
|
keywords: u,
|
|
1847
1845
|
modifierOn: f,
|
|
@@ -1855,12 +1853,12 @@ const fe = {
|
|
|
1855
1853
|
{ separate: !0 },
|
|
1856
1854
|
{ label: "Title", value: s },
|
|
1857
1855
|
{ label: "Author", value: c },
|
|
1858
|
-
{ label: "Subject", value:
|
|
1856
|
+
{ label: "Subject", value: p },
|
|
1859
1857
|
{ label: "Keywords", value: u },
|
|
1860
1858
|
{ label: "Creator", value: m },
|
|
1861
1859
|
{
|
|
1862
1860
|
label: "Created on",
|
|
1863
|
-
value:
|
|
1861
|
+
value: h ? it(h) : ""
|
|
1864
1862
|
},
|
|
1865
1863
|
{
|
|
1866
1864
|
label: "Modified on",
|
|
@@ -1891,12 +1889,12 @@ const fe = {
|
|
|
1891
1889
|
r.href = t, r.download = e, document.body.appendChild(r), r.click(), document.body.removeChild(r);
|
|
1892
1890
|
} };
|
|
1893
1891
|
}, In = () => {
|
|
1894
|
-
const { downloadIcon: e } =
|
|
1892
|
+
const { downloadIcon: e } = re();
|
|
1895
1893
|
return e || /* @__PURE__ */ a(Zr, {});
|
|
1896
1894
|
}, yn = ({ children: e }) => /* @__PURE__ */ a(X, { content: "Download file", children: e }), aa = ({ downloadFile: e }) => /* @__PURE__ */ a(yn, { children: /* @__PURE__ */ a(B, { onClick: e, children: /* @__PURE__ */ a(In, {}) }) }), ia = ({ downloadFile: e }) => /* @__PURE__ */ a(yn, { children: /* @__PURE__ */ O(ce, { onClick: e, children: [
|
|
1897
1895
|
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(In, {}) }),
|
|
1898
1896
|
"Download file"
|
|
1899
|
-
] }) }),
|
|
1897
|
+
] }) }), Rn = () => {
|
|
1900
1898
|
const { downloadFile: e } = oa(), { downloadTool: t = !0 } = se(), { isSmallScreen: n } = ge();
|
|
1901
1899
|
return t ? n ? /* @__PURE__ */ a(ia, { downloadFile: e }) : typeof t == "function" ? /* @__PURE__ */ a(t, { downloadFile: e }) : t ? /* @__PURE__ */ a(aa, { downloadFile: e }) : null : null;
|
|
1902
1900
|
};
|
|
@@ -1905,162 +1903,162 @@ const sa = () => {
|
|
|
1905
1903
|
loadedPages: 0,
|
|
1906
1904
|
totalPages: 0,
|
|
1907
1905
|
percentage: 0
|
|
1908
|
-
}), [o, i] = F(!1), [l, s] = F(!1), [c,
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
}, [
|
|
1912
|
-
const m =
|
|
1906
|
+
}), [o, i] = F(!1), [l, s] = F(!1), [c, p] = F(null), h = $(!1);
|
|
1907
|
+
A(() => {
|
|
1908
|
+
h.current;
|
|
1909
|
+
}, [h]);
|
|
1910
|
+
const m = M(() => {
|
|
1913
1911
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
1914
|
-
const
|
|
1915
|
-
|
|
1916
|
-
}, []), u =
|
|
1917
|
-
|
|
1912
|
+
const P = document.querySelector(".rp-print-zone");
|
|
1913
|
+
P && P.remove();
|
|
1914
|
+
}, []), u = M(() => {
|
|
1915
|
+
h.current = !1, i(!1), s(!1), p(null), r({
|
|
1918
1916
|
loadedPages: 0,
|
|
1919
1917
|
totalPages: 0,
|
|
1920
1918
|
percentage: 0
|
|
1921
1919
|
});
|
|
1922
1920
|
}, []), f = () => {
|
|
1923
|
-
|
|
1921
|
+
h.current = !0;
|
|
1924
1922
|
}, v = async ({
|
|
1925
|
-
scratchCanvas:
|
|
1923
|
+
scratchCanvas: P,
|
|
1926
1924
|
pdfDocument: T,
|
|
1927
1925
|
pageNumber: d,
|
|
1928
|
-
viewerPdfPage:
|
|
1929
|
-
printResolution:
|
|
1930
|
-
optionalContentConfigPromise:
|
|
1931
|
-
printAnnotationStoragePromise:
|
|
1926
|
+
viewerPdfPage: C,
|
|
1927
|
+
printResolution: w,
|
|
1928
|
+
optionalContentConfigPromise: I,
|
|
1929
|
+
printAnnotationStoragePromise: y
|
|
1932
1930
|
}) => {
|
|
1933
|
-
if (
|
|
1931
|
+
if (h.current) {
|
|
1934
1932
|
u();
|
|
1935
1933
|
return;
|
|
1936
1934
|
}
|
|
1937
|
-
const
|
|
1938
|
-
|
|
1939
|
-
const
|
|
1940
|
-
|
|
1941
|
-
const [
|
|
1935
|
+
const R = w / tr.PDF;
|
|
1936
|
+
P.width = Math.floor(C.width * R), P.height = Math.floor(C.height * R);
|
|
1937
|
+
const L = P.getContext("2d");
|
|
1938
|
+
L.save(), L.fillStyle = "rgb(255, 255, 255)", L.fillRect(0, 0, P.width, P.height), L.restore();
|
|
1939
|
+
const [N, x] = await Promise.all([
|
|
1942
1940
|
T.getPage(d),
|
|
1943
|
-
|
|
1941
|
+
y
|
|
1944
1942
|
]);
|
|
1945
|
-
if (
|
|
1943
|
+
if (h.current) {
|
|
1946
1944
|
u();
|
|
1947
1945
|
return;
|
|
1948
1946
|
}
|
|
1949
1947
|
const E = {
|
|
1950
|
-
canvasContext:
|
|
1951
|
-
transform: [
|
|
1952
|
-
viewport:
|
|
1948
|
+
canvasContext: L,
|
|
1949
|
+
transform: [R, 0, 0, R, 0, 0],
|
|
1950
|
+
viewport: N.getViewport({ scale: 1, rotation: C.rotation }),
|
|
1953
1951
|
intent: "print",
|
|
1954
1952
|
annotationMode: nr.ENABLE_STORAGE,
|
|
1955
|
-
optionalContentConfigPromise:
|
|
1956
|
-
printAnnotationStorage:
|
|
1953
|
+
optionalContentConfigPromise: I,
|
|
1954
|
+
printAnnotationStorage: x
|
|
1957
1955
|
};
|
|
1958
1956
|
try {
|
|
1959
|
-
return
|
|
1960
|
-
} catch (
|
|
1961
|
-
throw
|
|
1957
|
+
return N.render(E).promise;
|
|
1958
|
+
} catch (z) {
|
|
1959
|
+
throw z instanceof rr || console.error(z), z;
|
|
1962
1960
|
}
|
|
1963
|
-
}, _ =
|
|
1964
|
-
const
|
|
1961
|
+
}, _ = M(() => {
|
|
1962
|
+
const P = window.print;
|
|
1965
1963
|
return new Promise((T) => {
|
|
1966
|
-
const d = (
|
|
1964
|
+
const d = (I) => {
|
|
1967
1965
|
setTimeout(() => {
|
|
1968
|
-
|
|
1966
|
+
P.call(window), setTimeout(() => I(), 20);
|
|
1969
1967
|
}, 0);
|
|
1970
1968
|
};
|
|
1971
1969
|
if (document.querySelector(".rp-print-zone")) {
|
|
1972
1970
|
d(T);
|
|
1973
1971
|
return;
|
|
1974
1972
|
}
|
|
1975
|
-
const
|
|
1976
|
-
document.querySelector(".rp-print-zone") && (d(T),
|
|
1973
|
+
const w = new MutationObserver(() => {
|
|
1974
|
+
document.querySelector(".rp-print-zone") && (d(T), w.disconnect());
|
|
1977
1975
|
});
|
|
1978
|
-
|
|
1976
|
+
w.observe(document.body, { childList: !0, subtree: !0 });
|
|
1979
1977
|
});
|
|
1980
|
-
}, []), g = async (
|
|
1978
|
+
}, []), g = async (P) => {
|
|
1981
1979
|
const T = document.createElement("img"), d = document.createElement("div");
|
|
1982
|
-
return d.classList.add("rp-print-page"), await new Promise((
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
URL.revokeObjectURL(T.src),
|
|
1986
|
-
}, T.onerror =
|
|
1980
|
+
return d.classList.add("rp-print-page"), await new Promise((C, w) => {
|
|
1981
|
+
P.toBlob((I) => {
|
|
1982
|
+
I ? (T.src = URL.createObjectURL(I), T.onload = () => {
|
|
1983
|
+
URL.revokeObjectURL(T.src), C();
|
|
1984
|
+
}, T.onerror = w) : w(new Error("Failed to create blob"));
|
|
1987
1985
|
});
|
|
1988
1986
|
}).catch(() => {
|
|
1989
1987
|
}), d.appendChild(T), d;
|
|
1990
|
-
},
|
|
1988
|
+
}, b = (P, T) => {
|
|
1991
1989
|
const d = document.createElement("div");
|
|
1992
1990
|
d.classList.add("rp-print-zone");
|
|
1993
|
-
const
|
|
1994
|
-
if (
|
|
1995
|
-
const { width:
|
|
1996
|
-
|
|
1991
|
+
const C = document.createElement("style"), w = T.get(1);
|
|
1992
|
+
if (w) {
|
|
1993
|
+
const { width: I, height: y } = w == null ? void 0 : w.page.getViewport({ scale: 1 });
|
|
1994
|
+
C.innerHTML = `@page { size: ${I}px ${y}px }`;
|
|
1997
1995
|
}
|
|
1998
|
-
return d.appendChild(
|
|
1999
|
-
},
|
|
1996
|
+
return d.appendChild(C), d.append(...P), d;
|
|
1997
|
+
}, S = M(async () => {
|
|
2000
1998
|
if (!e)
|
|
2001
1999
|
return;
|
|
2002
2000
|
u();
|
|
2003
|
-
const
|
|
2001
|
+
const P = document.createElement("canvas"), T = [];
|
|
2004
2002
|
try {
|
|
2005
2003
|
e.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
2006
|
-
const
|
|
2004
|
+
const C = e.getOptionalContentConfig({ intent: "print" }), w = Promise.resolve(
|
|
2007
2005
|
e.annotationStorage.print ?? void 0
|
|
2008
|
-
),
|
|
2009
|
-
for (const [
|
|
2010
|
-
if (
|
|
2006
|
+
), I = t.size;
|
|
2007
|
+
for (const [R, L] of t) {
|
|
2008
|
+
if (h.current) {
|
|
2011
2009
|
u();
|
|
2012
2010
|
return;
|
|
2013
2011
|
}
|
|
2014
|
-
const
|
|
2012
|
+
const N = L.page.getViewport({ scale: 1 });
|
|
2015
2013
|
if (await v({
|
|
2016
|
-
scratchCanvas:
|
|
2014
|
+
scratchCanvas: P,
|
|
2017
2015
|
pdfDocument: e,
|
|
2018
|
-
pageNumber:
|
|
2019
|
-
viewerPdfPage:
|
|
2016
|
+
pageNumber: R,
|
|
2017
|
+
viewerPdfPage: N,
|
|
2020
2018
|
printResolution: 150,
|
|
2021
|
-
optionalContentConfigPromise:
|
|
2022
|
-
printAnnotationStoragePromise:
|
|
2023
|
-
}),
|
|
2019
|
+
optionalContentConfigPromise: C,
|
|
2020
|
+
printAnnotationStoragePromise: w
|
|
2021
|
+
}), h.current) {
|
|
2024
2022
|
u();
|
|
2025
2023
|
return;
|
|
2026
2024
|
}
|
|
2027
|
-
const
|
|
2028
|
-
T.push(
|
|
2029
|
-
const E = parseFloat((T.length /
|
|
2025
|
+
const x = await g(P);
|
|
2026
|
+
T.push(x);
|
|
2027
|
+
const E = parseFloat((T.length / I * 100).toFixed(2));
|
|
2030
2028
|
r({
|
|
2031
|
-
loadedPages:
|
|
2032
|
-
totalPages:
|
|
2029
|
+
loadedPages: R,
|
|
2030
|
+
totalPages: I,
|
|
2033
2031
|
percentage: E
|
|
2034
2032
|
});
|
|
2035
2033
|
}
|
|
2036
|
-
if (
|
|
2034
|
+
if (h.current) {
|
|
2037
2035
|
u();
|
|
2038
2036
|
return;
|
|
2039
2037
|
}
|
|
2040
|
-
const
|
|
2041
|
-
document.body.appendChild(
|
|
2038
|
+
const y = b(T, t);
|
|
2039
|
+
document.body.appendChild(y), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), i(!0), await _();
|
|
2042
2040
|
} catch (d) {
|
|
2043
|
-
s(!0), d instanceof Error &&
|
|
2041
|
+
s(!0), d instanceof Error && p(d);
|
|
2044
2042
|
} finally {
|
|
2045
|
-
|
|
2043
|
+
P.height = 0, P.width = 0;
|
|
2046
2044
|
}
|
|
2047
|
-
}, [e, t,
|
|
2048
|
-
return
|
|
2049
|
-
const
|
|
2045
|
+
}, [e, t, h]);
|
|
2046
|
+
return A(() => {
|
|
2047
|
+
const P = () => {
|
|
2050
2048
|
u(), m();
|
|
2051
2049
|
};
|
|
2052
|
-
return window.addEventListener("afterprint",
|
|
2053
|
-
window.removeEventListener("afterprint",
|
|
2050
|
+
return window.addEventListener("afterprint", P, !0), () => {
|
|
2051
|
+
window.removeEventListener("afterprint", P, !0);
|
|
2054
2052
|
};
|
|
2055
2053
|
}, [m, u]), {
|
|
2056
|
-
print:
|
|
2054
|
+
print: S,
|
|
2057
2055
|
cancel: f,
|
|
2058
2056
|
progress: n,
|
|
2059
2057
|
isComplete: o,
|
|
2060
2058
|
isError: l,
|
|
2061
2059
|
error: c
|
|
2062
2060
|
};
|
|
2063
|
-
},
|
|
2061
|
+
}, xn = We({
|
|
2064
2062
|
print: () => {
|
|
2065
2063
|
},
|
|
2066
2064
|
cancel: () => {
|
|
@@ -2078,23 +2076,23 @@ const sa = () => {
|
|
|
2078
2076
|
}
|
|
2079
2077
|
}
|
|
2080
2078
|
}), la = ({ children: e }) => {
|
|
2081
|
-
const [t, n] = F(null), [r, o] = F(null), { print: i, cancel: l, progress: s, isComplete: c, isError:
|
|
2079
|
+
const [t, n] = F(null), [r, o] = F(null), { print: i, cancel: l, progress: s, isComplete: c, isError: p, error: h } = sa(), m = M((g) => {
|
|
2082
2080
|
g && typeof g == "function" && o(() => g);
|
|
2083
2081
|
}, []), u = (g) => {
|
|
2084
|
-
|
|
2085
|
-
}, f =
|
|
2082
|
+
h && g(h);
|
|
2083
|
+
}, f = M(
|
|
2086
2084
|
(g) => {
|
|
2087
2085
|
n(() => g);
|
|
2088
2086
|
},
|
|
2089
2087
|
[s, t]
|
|
2090
2088
|
);
|
|
2091
|
-
|
|
2089
|
+
A(() => {
|
|
2092
2090
|
c && r && v();
|
|
2093
|
-
}, [c, r]),
|
|
2094
|
-
|
|
2091
|
+
}, [c, r]), A(() => {
|
|
2092
|
+
p && u((g) => {
|
|
2095
2093
|
console.error(g);
|
|
2096
2094
|
});
|
|
2097
|
-
}, [
|
|
2095
|
+
}, [p]), A(() => {
|
|
2098
2096
|
s && t && t(s);
|
|
2099
2097
|
}, [s, t]);
|
|
2100
2098
|
const v = () => {
|
|
@@ -2107,14 +2105,14 @@ const sa = () => {
|
|
|
2107
2105
|
setOnError: u,
|
|
2108
2106
|
progress: s
|
|
2109
2107
|
};
|
|
2110
|
-
return /* @__PURE__ */ a(
|
|
2108
|
+
return /* @__PURE__ */ a(xn.Provider, { value: _, children: e });
|
|
2111
2109
|
}, Tt = () => {
|
|
2112
|
-
const e = He(
|
|
2110
|
+
const e = He(xn);
|
|
2113
2111
|
if (!e)
|
|
2114
2112
|
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
2115
2113
|
return e;
|
|
2116
2114
|
}, Mn = () => {
|
|
2117
|
-
const { printIcon: e } =
|
|
2115
|
+
const { printIcon: e } = re();
|
|
2118
2116
|
return e || /* @__PURE__ */ a(jr, {});
|
|
2119
2117
|
}, Ln = ({ children: e }) => /* @__PURE__ */ a(X, { content: "Print", children: e }), ca = ({ print: e }) => /* @__PURE__ */ a(Ln, { children: /* @__PURE__ */ a(B, { onClick: e, children: /* @__PURE__ */ a(Mn, {}) }) }), ua = ({ print: e }) => /* @__PURE__ */ a(Ln, { children: /* @__PURE__ */ O(ce, { onClick: e, children: [
|
|
2120
2118
|
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Mn, {}) }),
|
|
@@ -2135,15 +2133,15 @@ const sa = () => {
|
|
|
2135
2133
|
}, da = {
|
|
2136
2134
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2137
2135
|
}, pa = () => {
|
|
2138
|
-
const { goToFirstPageIcon: e } =
|
|
2136
|
+
const { goToFirstPageIcon: e } = re();
|
|
2139
2137
|
return e || /* @__PURE__ */ a(en, { className: da["rp-go-to-Top"] });
|
|
2140
2138
|
}, ha = () => {
|
|
2141
|
-
const { goToLastPageIcon: e } =
|
|
2139
|
+
const { goToLastPageIcon: e } = re();
|
|
2142
2140
|
return e || /* @__PURE__ */ a(en, {});
|
|
2143
2141
|
}, fa = () => {
|
|
2144
|
-
const { goToPage: e, totalPages: t, focusedPage: n } =
|
|
2142
|
+
const { goToPage: e, totalPages: t, focusedPage: n } = ee(), { jumpNavigationTool: r = !0 } = se(), o = D(() => n === 1, [n]), i = D(() => n === t, [n, t]), l = M(() => {
|
|
2145
2143
|
e(1);
|
|
2146
|
-
}, [e]), s =
|
|
2144
|
+
}, [e]), s = M(() => {
|
|
2147
2145
|
e(t);
|
|
2148
2146
|
}, [e, t]);
|
|
2149
2147
|
return r ? /* @__PURE__ */ O(Fe, { children: [
|
|
@@ -2166,13 +2164,13 @@ const sa = () => {
|
|
|
2166
2164
|
rotateTool: l,
|
|
2167
2165
|
selectionModeTool: s,
|
|
2168
2166
|
jumpNavigationTool: c,
|
|
2169
|
-
printTool:
|
|
2170
|
-
fullscreenTool:
|
|
2167
|
+
printTool: p,
|
|
2168
|
+
fullscreenTool: h
|
|
2171
2169
|
} = se();
|
|
2172
2170
|
return D(() => {
|
|
2173
2171
|
const u = c || l || s || i || o;
|
|
2174
2172
|
let f = !1;
|
|
2175
|
-
return t && (f = !(!n && !r && !
|
|
2173
|
+
return t && (f = !(!n && !r && !p && !h)), u || f;
|
|
2176
2174
|
}, [
|
|
2177
2175
|
n,
|
|
2178
2176
|
r,
|
|
@@ -2190,7 +2188,7 @@ const sa = () => {
|
|
|
2190
2188
|
children: /* @__PURE__ */ O("div", { className: ra["rp-other-tool-content"], children: [
|
|
2191
2189
|
t && /* @__PURE__ */ O(Fe, { children: [
|
|
2192
2190
|
/* @__PURE__ */ a(Jt, {}),
|
|
2193
|
-
/* @__PURE__ */ a(
|
|
2191
|
+
/* @__PURE__ */ a(Rn, {}),
|
|
2194
2192
|
/* @__PURE__ */ a(Nn, {}),
|
|
2195
2193
|
/* @__PURE__ */ a(Qt, {}),
|
|
2196
2194
|
/* @__PURE__ */ a(vt, {})
|
|
@@ -2208,10 +2206,10 @@ const sa = () => {
|
|
|
2208
2206
|
}, ga = () => {
|
|
2209
2207
|
const { isSmallScreen: e } = ge();
|
|
2210
2208
|
return /* @__PURE__ */ O(Ae, { children: [
|
|
2211
|
-
/* @__PURE__ */ a(
|
|
2209
|
+
/* @__PURE__ */ a(xr, {}),
|
|
2212
2210
|
!e && /* @__PURE__ */ O(Ae, { children: [
|
|
2213
2211
|
/* @__PURE__ */ a(Jt, {}),
|
|
2214
|
-
/* @__PURE__ */ a(
|
|
2212
|
+
/* @__PURE__ */ a(Rn, {}),
|
|
2215
2213
|
/* @__PURE__ */ a(Nn, {}),
|
|
2216
2214
|
/* @__PURE__ */ a(Qt, {})
|
|
2217
2215
|
] }),
|
|
@@ -2224,53 +2222,53 @@ const sa = () => {
|
|
|
2224
2222
|
"rp-current-zoom": "_rp-current-zoom_163s9_6",
|
|
2225
2223
|
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_163s9_20"
|
|
2226
2224
|
}, va = 25, nt = 1e3, _a = [50, 75, 100, 125, 150, 200, 300, 400], wa = () => {
|
|
2227
|
-
const { zoomInIcon: e } =
|
|
2225
|
+
const { zoomInIcon: e } = re();
|
|
2228
2226
|
return e || /* @__PURE__ */ a(Kr, {});
|
|
2229
2227
|
}, ba = () => {
|
|
2230
|
-
const { zoomOutIcon: e } =
|
|
2228
|
+
const { zoomOutIcon: e } = re();
|
|
2231
2229
|
return e || /* @__PURE__ */ a(Xr, {});
|
|
2232
2230
|
}, Ca = () => {
|
|
2233
|
-
const { zoomLevel: e, setZoomLevel: t } = ht(), { container: n, contentRef: r } = qe(), { zoomTool: o = !0 } = se(), { focusedPage: i } =
|
|
2231
|
+
const { zoomLevel: e, setZoomLevel: t } = ht(), { container: n, contentRef: r } = qe(), { zoomTool: o = !0 } = se(), { focusedPage: i } = ee(), { rotate: l } = Ve(), { pages: s } = Y(), { isSmallScreen: c } = ge(), p = M(() => {
|
|
2234
2232
|
t((g) => {
|
|
2235
|
-
const
|
|
2236
|
-
return Math.min(
|
|
2233
|
+
const b = Math.floor(g / 25) * 25;
|
|
2234
|
+
return Math.min(b + 25, nt);
|
|
2237
2235
|
});
|
|
2238
|
-
}, [t]),
|
|
2236
|
+
}, [t]), h = M(() => {
|
|
2239
2237
|
t((g) => {
|
|
2240
|
-
const
|
|
2241
|
-
return Math.min(
|
|
2238
|
+
const b = Math.ceil(g / 25) * 25;
|
|
2239
|
+
return Math.min(b - 25, nt);
|
|
2242
2240
|
});
|
|
2243
2241
|
}, [t]), m = D(() => e === va, [e]), u = D(() => e === nt, [e]), f = D(() => {
|
|
2244
2242
|
var g;
|
|
2245
2243
|
return (g = s.get(i)) == null ? void 0 : g.page.getViewport({ scale: 1, rotation: l });
|
|
2246
|
-
}, [s, i, l]), v =
|
|
2244
|
+
}, [s, i, l]), v = M(
|
|
2247
2245
|
(g) => {
|
|
2248
|
-
const
|
|
2246
|
+
const b = ((f == null ? void 0 : f.width) || 0) + 2 * yt, S = ((f == null ? void 0 : f.height) || 0) + 2 * yt, P = (r == null ? void 0 : r.clientWidth) || 0, T = (r == null ? void 0 : r.clientHeight) || 0;
|
|
2249
2247
|
switch (g) {
|
|
2250
2248
|
case we.ACTUAL:
|
|
2251
2249
|
t(100);
|
|
2252
2250
|
break;
|
|
2253
2251
|
case we.PAGE_FIT:
|
|
2254
2252
|
let d = 0;
|
|
2255
|
-
const
|
|
2256
|
-
|
|
2257
|
-
const
|
|
2258
|
-
t(
|
|
2253
|
+
const C = P > T;
|
|
2254
|
+
S > b && C ? d = T / S : d = P / b;
|
|
2255
|
+
const w = Math.floor(d * 100);
|
|
2256
|
+
t(w);
|
|
2259
2257
|
break;
|
|
2260
2258
|
case we.PAGE_WIDTH:
|
|
2261
|
-
t(Math.floor(
|
|
2259
|
+
t(Math.floor(P / b * 100));
|
|
2262
2260
|
break;
|
|
2263
2261
|
}
|
|
2264
2262
|
},
|
|
2265
2263
|
[t, f]
|
|
2266
|
-
), _ =
|
|
2264
|
+
), _ = M(
|
|
2267
2265
|
(g) => {
|
|
2268
2266
|
typeof g == "number" ? t(g) : v(g);
|
|
2269
2267
|
},
|
|
2270
2268
|
[t, v]
|
|
2271
2269
|
);
|
|
2272
2270
|
return typeof o != "boolean" ? /* @__PURE__ */ a(o, { zoomLevel: e, setZoomLevel: t }) : o ? /* @__PURE__ */ O("div", { className: ye["rp-zoom-wrapper"], children: [
|
|
2273
|
-
/* @__PURE__ */ a(X, { content: "Zoom out", children: /* @__PURE__ */ a(B, { disabled: m, onClick:
|
|
2271
|
+
/* @__PURE__ */ a(X, { content: "Zoom out", children: /* @__PURE__ */ a(B, { disabled: m, onClick: h, children: /* @__PURE__ */ a(ba, {}) }) }),
|
|
2274
2272
|
!c && /* @__PURE__ */ a(X, { content: "Select zoom level", children: /* @__PURE__ */ a(
|
|
2275
2273
|
ft,
|
|
2276
2274
|
{
|
|
@@ -2298,9 +2296,9 @@ const sa = () => {
|
|
|
2298
2296
|
] })
|
|
2299
2297
|
}
|
|
2300
2298
|
) }),
|
|
2301
|
-
/* @__PURE__ */ a(X, { content: "Zoom in", children: /* @__PURE__ */ a(B, { disabled: u, onClick:
|
|
2299
|
+
/* @__PURE__ */ a(X, { content: "Zoom in", children: /* @__PURE__ */ a(B, { disabled: u, onClick: p, children: /* @__PURE__ */ a(wa, {}) }) })
|
|
2302
2300
|
] }) : null;
|
|
2303
|
-
},
|
|
2301
|
+
}, ne = {
|
|
2304
2302
|
"rp-search-tool-content": "_rp-search-tool-content_1vxow_1",
|
|
2305
2303
|
"rp-search-tool-input": "_rp-search-tool-input_1vxow_6",
|
|
2306
2304
|
"rp-search-tool-input-icon": "_rp-search-tool-input-icon_1vxow_12",
|
|
@@ -2310,96 +2308,96 @@ const sa = () => {
|
|
|
2310
2308
|
"rp-search-tool-input-clear": "_rp-search-tool-input-clear_1vxow_35",
|
|
2311
2309
|
"rp-search-input": "_rp-search-input_1vxow_49"
|
|
2312
2310
|
}, Gt = () => {
|
|
2313
|
-
const { searchIcon: e } =
|
|
2311
|
+
const { searchIcon: e } = re();
|
|
2314
2312
|
return e || /* @__PURE__ */ a(Jr, {});
|
|
2315
2313
|
}, Pa = () => {
|
|
2316
2314
|
const { container: e } = qe(), [t, n] = F(!1), { pdf: r } = Y(), [o, i] = F(null), {
|
|
2317
2315
|
searchOptions: l,
|
|
2318
2316
|
setSearchOptions: s,
|
|
2319
2317
|
loading: c,
|
|
2320
|
-
setSearch:
|
|
2321
|
-
totalMatches:
|
|
2318
|
+
setSearch: p,
|
|
2319
|
+
totalMatches: h,
|
|
2322
2320
|
currentMatchPosition: m,
|
|
2323
2321
|
nextMatch: u,
|
|
2324
2322
|
prevMatch: f,
|
|
2325
2323
|
search: v
|
|
2326
|
-
} = nn(), { searchTool: _ } = se(), [g,
|
|
2324
|
+
} = nn(), { searchTool: _ = !0 } = se(), [g, b] = F(v), S = M(() => {
|
|
2327
2325
|
n(!0);
|
|
2328
|
-
}, []),
|
|
2329
|
-
|
|
2330
|
-
}, [
|
|
2331
|
-
(
|
|
2332
|
-
|
|
2326
|
+
}, []), P = M(() => {
|
|
2327
|
+
p(""), b(""), n(!1);
|
|
2328
|
+
}, [p]), T = M(
|
|
2329
|
+
(x) => {
|
|
2330
|
+
x.key === "Escape" && t && P();
|
|
2333
2331
|
},
|
|
2334
2332
|
[t]
|
|
2335
|
-
), d =
|
|
2336
|
-
(
|
|
2337
|
-
|
|
2333
|
+
), d = M(
|
|
2334
|
+
(x) => {
|
|
2335
|
+
x.shiftKey && x.key === "Enter" ? f() : x.key === "Enter" && p((E) => (g === E && u(), g));
|
|
2338
2336
|
},
|
|
2339
|
-
[g, f, u,
|
|
2337
|
+
[g, f, u, p]
|
|
2340
2338
|
);
|
|
2341
|
-
|
|
2339
|
+
A(() => (window.addEventListener("keydown", T), () => {
|
|
2342
2340
|
window.removeEventListener("keydown", T);
|
|
2343
|
-
}), [T]),
|
|
2341
|
+
}), [T]), A(() => {
|
|
2344
2342
|
o && o.focus();
|
|
2345
2343
|
}, [o]);
|
|
2346
|
-
const
|
|
2347
|
-
|
|
2348
|
-
}, []),
|
|
2349
|
-
|
|
2350
|
-
}, [
|
|
2351
|
-
(
|
|
2352
|
-
s((E) => ({ ...E, matchCase:
|
|
2344
|
+
const C = M((x) => {
|
|
2345
|
+
b(x.target.value);
|
|
2346
|
+
}, []), w = M(() => {
|
|
2347
|
+
b(""), p("");
|
|
2348
|
+
}, [p]), I = D(() => `${m} / ${h}`, [m, h]), { wholeWords: y, matchCase: R } = D(() => l, [l]), L = M(
|
|
2349
|
+
(x) => {
|
|
2350
|
+
s((E) => ({ ...E, matchCase: x }));
|
|
2353
2351
|
},
|
|
2354
2352
|
[s]
|
|
2355
|
-
),
|
|
2356
|
-
(
|
|
2357
|
-
s((E) => ({ ...E, wholeWords:
|
|
2353
|
+
), N = M(
|
|
2354
|
+
(x) => {
|
|
2355
|
+
s((E) => ({ ...E, wholeWords: x }));
|
|
2358
2356
|
},
|
|
2359
2357
|
[s]
|
|
2360
2358
|
);
|
|
2361
|
-
return
|
|
2362
|
-
|
|
2363
|
-
}, [r,
|
|
2359
|
+
return A(() => {
|
|
2360
|
+
P();
|
|
2361
|
+
}, [r, P]), _ ? /* @__PURE__ */ a(
|
|
2364
2362
|
ft,
|
|
2365
2363
|
{
|
|
2366
2364
|
open: t,
|
|
2367
2365
|
container: e,
|
|
2368
2366
|
align: "start",
|
|
2369
|
-
triggerComponent: /* @__PURE__ */ a(X, { content: "Search in Document", children: /* @__PURE__ */ a(B, { onClick:
|
|
2370
|
-
children: /* @__PURE__ */ O("div", { className:
|
|
2371
|
-
/* @__PURE__ */ O("div", { className:
|
|
2372
|
-
/* @__PURE__ */ O("div", { className:
|
|
2367
|
+
triggerComponent: /* @__PURE__ */ a(X, { content: "Search in Document", children: /* @__PURE__ */ a(B, { onClick: S, children: /* @__PURE__ */ a(Gt, {}) }) }),
|
|
2368
|
+
children: /* @__PURE__ */ O("div", { className: ne["rp-search-tool-content"], children: [
|
|
2369
|
+
/* @__PURE__ */ O("div", { className: ne["rp-search-tool-input-wrapper"], children: [
|
|
2370
|
+
/* @__PURE__ */ O("div", { className: ne["rp-search-tool-input"], children: [
|
|
2373
2371
|
/* @__PURE__ */ a(
|
|
2374
2372
|
Zt,
|
|
2375
2373
|
{
|
|
2376
2374
|
value: g,
|
|
2377
2375
|
onKeyDown: d,
|
|
2378
|
-
onChange:
|
|
2376
|
+
onChange: C,
|
|
2379
2377
|
icon: /* @__PURE__ */ a(Gt, {}),
|
|
2380
2378
|
placeholder: "Enter to Search",
|
|
2381
|
-
className:
|
|
2379
|
+
className: ne["rp-search-input"],
|
|
2382
2380
|
ref: i,
|
|
2383
|
-
children: !!g && /* @__PURE__ */ a("span", { className:
|
|
2381
|
+
children: !!g && /* @__PURE__ */ a("span", { className: ne["rp-search-tool-input-clear"], onClick: w, children: /* @__PURE__ */ a(Yr, {}) })
|
|
2384
2382
|
}
|
|
2385
2383
|
),
|
|
2386
|
-
c ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(pt, {}) }) : /* @__PURE__ */ a("span", { children:
|
|
2384
|
+
c ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(pt, {}) }) : /* @__PURE__ */ a("span", { children: I })
|
|
2387
2385
|
] }),
|
|
2388
|
-
/* @__PURE__ */ O("div", { className:
|
|
2389
|
-
/* @__PURE__ */ a(
|
|
2390
|
-
/* @__PURE__ */ a(
|
|
2386
|
+
/* @__PURE__ */ O("div", { className: ne["rp-search-tool-input-checkboxes"], children: [
|
|
2387
|
+
/* @__PURE__ */ a(Rt, { name: "matchCase", value: R, onChange: L, children: "Match Case" }),
|
|
2388
|
+
/* @__PURE__ */ a(Rt, { name: "wholeWord", value: y, onChange: N, children: "Whole Word" })
|
|
2391
2389
|
] })
|
|
2392
2390
|
] }),
|
|
2393
|
-
/* @__PURE__ */ O("div", { className:
|
|
2394
|
-
/* @__PURE__ */ a(B, { onClick: f, children: /* @__PURE__ */ a(Me, { className:
|
|
2391
|
+
/* @__PURE__ */ O("div", { className: ne["rp-search-tool-controls"], children: [
|
|
2392
|
+
/* @__PURE__ */ a(B, { onClick: f, children: /* @__PURE__ */ a(Me, { className: ne["rp-search-tool-input-icon"] }) }),
|
|
2395
2393
|
/* @__PURE__ */ a(B, { onClick: u, children: /* @__PURE__ */ a(
|
|
2396
2394
|
Me,
|
|
2397
2395
|
{
|
|
2398
2396
|
style: { transform: "rotate(180deg" },
|
|
2399
|
-
className:
|
|
2397
|
+
className: ne["rp-search-tool-input-icon"]
|
|
2400
2398
|
}
|
|
2401
2399
|
) }),
|
|
2402
|
-
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(Yt, { onClick:
|
|
2400
|
+
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(Yt, { onClick: P, className: ne["rp-search-tool-input-icon"] }) })
|
|
2403
2401
|
] })
|
|
2404
2402
|
] })
|
|
2405
2403
|
}
|
|
@@ -2443,17 +2441,17 @@ const sa = () => {
|
|
|
2443
2441
|
"rp-sidebar-content": "_rp-sidebar-content_p2vax_1",
|
|
2444
2442
|
"rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_p2vax_16",
|
|
2445
2443
|
"rp-thumbnail-dragging": "_rp-thumbnail-dragging_p2vax_21"
|
|
2446
|
-
},
|
|
2444
|
+
}, Re = {
|
|
2447
2445
|
"rp-thumbnail-wrapper": "_rp-thumbnail-wrapper_3fenb_1",
|
|
2448
2446
|
"rp-thumbnail-text": "_rp-thumbnail-text_3fenb_10",
|
|
2449
2447
|
"rp-thumbnail": "_rp-thumbnail_3fenb_1",
|
|
2450
2448
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
2451
2449
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
2452
2450
|
}, ya = (e) => {
|
|
2453
|
-
const { thumbnailSrc: t, pageNumber: n, isFocused: r, viewport: o } = e, { goToPage: i } =
|
|
2451
|
+
const { thumbnailSrc: t, pageNumber: n, isFocused: r, viewport: o } = e, { goToPage: i } = ee(), l = D(() => r ? Re["rp-thumbnail-active"] : "", [r]), s = D(() => ({
|
|
2454
2452
|
width: Math.round(o.width),
|
|
2455
2453
|
height: Math.round(o.height)
|
|
2456
|
-
}), [o]), c =
|
|
2454
|
+
}), [o]), c = M(() => {
|
|
2457
2455
|
n && i(n);
|
|
2458
2456
|
}, [i, n]);
|
|
2459
2457
|
return /* @__PURE__ */ O(
|
|
@@ -2461,9 +2459,9 @@ const sa = () => {
|
|
|
2461
2459
|
{
|
|
2462
2460
|
onClick: c,
|
|
2463
2461
|
id: `page-${n}`,
|
|
2464
|
-
className:
|
|
2462
|
+
className: Re["rp-thumbnail-wrapper"],
|
|
2465
2463
|
children: [
|
|
2466
|
-
/* @__PURE__ */ a("div", { className: j(l,
|
|
2464
|
+
/* @__PURE__ */ a("div", { className: j(l, Re["rp-thumbnail"]), children: t ? /* @__PURE__ */ a(
|
|
2467
2465
|
"img",
|
|
2468
2466
|
{
|
|
2469
2467
|
src: t,
|
|
@@ -2474,7 +2472,7 @@ const sa = () => {
|
|
|
2474
2472
|
) : /* @__PURE__ */ a(
|
|
2475
2473
|
"div",
|
|
2476
2474
|
{
|
|
2477
|
-
className:
|
|
2475
|
+
className: Re["rp-thumbnail-loader"],
|
|
2478
2476
|
style: {
|
|
2479
2477
|
width: `${s.width}px`,
|
|
2480
2478
|
height: `${s.height}px`
|
|
@@ -2482,15 +2480,15 @@ const sa = () => {
|
|
|
2482
2480
|
children: /* @__PURE__ */ a(pt, {})
|
|
2483
2481
|
}
|
|
2484
2482
|
) }),
|
|
2485
|
-
/* @__PURE__ */ a("div", { className:
|
|
2483
|
+
/* @__PURE__ */ a("div", { className: Re["rp-thumbnail-text"], children: n })
|
|
2486
2484
|
]
|
|
2487
2485
|
}
|
|
2488
2486
|
);
|
|
2489
2487
|
}, Ut = {
|
|
2490
2488
|
"rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
|
|
2491
2489
|
"rp-thumbnails": "_rp-thumbnails_16vqr_1"
|
|
2492
|
-
},
|
|
2493
|
-
const [e, t] = F({}), { pages: n } = Y(), { rotate: r } = Ve(), o = D(() => Object.keys(e).length, [e]), i =
|
|
2490
|
+
}, Ra = () => {
|
|
2491
|
+
const [e, t] = F({}), { pages: n } = Y(), { rotate: r } = Ve(), o = D(() => Object.keys(e).length, [e]), i = M(
|
|
2494
2492
|
(s) => {
|
|
2495
2493
|
if (!n.size)
|
|
2496
2494
|
return;
|
|
@@ -2502,9 +2500,9 @@ const sa = () => {
|
|
|
2502
2500
|
loading: !0,
|
|
2503
2501
|
viewport: u
|
|
2504
2502
|
};
|
|
2505
|
-
}),
|
|
2506
|
-
t(
|
|
2507
|
-
const
|
|
2503
|
+
}), p = c.reduce((m, u) => (m[u.page.pageNumber] = u, m), {});
|
|
2504
|
+
t(p);
|
|
2505
|
+
const h = [];
|
|
2508
2506
|
for (const m of c) {
|
|
2509
2507
|
const u = document.createElement("canvas"), f = ot(
|
|
2510
2508
|
m.page,
|
|
@@ -2519,9 +2517,9 @@ const sa = () => {
|
|
|
2519
2517
|
loading: !1
|
|
2520
2518
|
};
|
|
2521
2519
|
});
|
|
2522
|
-
|
|
2520
|
+
h.push(f);
|
|
2523
2521
|
}
|
|
2524
|
-
Promise.all(
|
|
2522
|
+
Promise.all(h).then((m) => {
|
|
2525
2523
|
const u = m.reduce(
|
|
2526
2524
|
(f, v) => (f[v.page.pageNumber] = v, f),
|
|
2527
2525
|
{}
|
|
@@ -2531,18 +2529,18 @@ const sa = () => {
|
|
|
2531
2529
|
},
|
|
2532
2530
|
[n, r]
|
|
2533
2531
|
);
|
|
2534
|
-
|
|
2532
|
+
A(() => {
|
|
2535
2533
|
i(10);
|
|
2536
2534
|
}, [i]);
|
|
2537
|
-
const l =
|
|
2535
|
+
const l = M(
|
|
2538
2536
|
(s) => {
|
|
2539
2537
|
if (!n)
|
|
2540
2538
|
return;
|
|
2541
2539
|
const c = n.get(s);
|
|
2542
2540
|
if (!c)
|
|
2543
2541
|
return;
|
|
2544
|
-
t((
|
|
2545
|
-
...
|
|
2542
|
+
t((h) => ({
|
|
2543
|
+
...h,
|
|
2546
2544
|
[s]: {
|
|
2547
2545
|
loading: !0,
|
|
2548
2546
|
page: c.page,
|
|
@@ -2550,18 +2548,18 @@ const sa = () => {
|
|
|
2550
2548
|
scale: c.thumbnailScale
|
|
2551
2549
|
}
|
|
2552
2550
|
}));
|
|
2553
|
-
const
|
|
2554
|
-
ot(c.page,
|
|
2555
|
-
const
|
|
2551
|
+
const p = document.createElement("canvas");
|
|
2552
|
+
ot(c.page, p, c.thumbnailScale, r).promise.then(() => {
|
|
2553
|
+
const h = p.toDataURL(), { thumbnailViewport: m, scale: u } = It(c.page, r);
|
|
2556
2554
|
return {
|
|
2557
2555
|
scale: u,
|
|
2558
|
-
thumbnailSrc:
|
|
2556
|
+
thumbnailSrc: h,
|
|
2559
2557
|
page: c.page,
|
|
2560
2558
|
loading: !1,
|
|
2561
2559
|
viewport: m
|
|
2562
2560
|
};
|
|
2563
|
-
}).then((
|
|
2564
|
-
t((m) => ({ ...m, [s]:
|
|
2561
|
+
}).then((h) => {
|
|
2562
|
+
t((m) => ({ ...m, [s]: h }));
|
|
2565
2563
|
});
|
|
2566
2564
|
},
|
|
2567
2565
|
[n, r]
|
|
@@ -2577,11 +2575,11 @@ const sa = () => {
|
|
|
2577
2575
|
setActive: (e) => {
|
|
2578
2576
|
},
|
|
2579
2577
|
active: !1
|
|
2580
|
-
}), On = () => He(En),
|
|
2578
|
+
}), On = () => He(En), xa = ({
|
|
2581
2579
|
children: e,
|
|
2582
2580
|
initialThumbnailsVisible: t
|
|
2583
2581
|
}) => {
|
|
2584
|
-
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: i } =
|
|
2582
|
+
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: i } = Ra(), [l, s] = F(t);
|
|
2585
2583
|
return /* @__PURE__ */ a(
|
|
2586
2584
|
En.Provider,
|
|
2587
2585
|
{
|
|
@@ -2593,15 +2591,15 @@ const sa = () => {
|
|
|
2593
2591
|
const n = e == null ? void 0 : e.querySelector(`#page-${t}`);
|
|
2594
2592
|
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) - Ma);
|
|
2595
2593
|
}, Na = $e((e, t) => {
|
|
2596
|
-
const { show: n } = e, { focusedPage: r, totalPages: o } =
|
|
2597
|
-
qt(t, () =>
|
|
2598
|
-
const m = D(() => Object.values(i), [i]), u =
|
|
2594
|
+
const { show: n } = e, { focusedPage: r, totalPages: o } = ee(), { thumbnailPages: i, addPage: l, thumbnailLength: s, addToPage: c } = On(), p = $(null), h = $(1);
|
|
2595
|
+
qt(t, () => p.current);
|
|
2596
|
+
const m = D(() => Object.values(i), [i]), u = M(() => {
|
|
2599
2597
|
const f = s + 1;
|
|
2600
2598
|
f <= o && l(f);
|
|
2601
2599
|
}, [l, o, s]);
|
|
2602
|
-
return
|
|
2603
|
-
r > s ? c(r) : n &&
|
|
2604
|
-
}, [r, s, c, n, m]), or(
|
|
2600
|
+
return A(() => {
|
|
2601
|
+
r > s ? c(r) : n && h.current !== r && (La(p.current, r), h.current = r);
|
|
2602
|
+
}, [r, s, c, n, m]), or(p.current, u), /* @__PURE__ */ a("div", { ref: p, className: Ut["rp-thumbnails-container"], children: /* @__PURE__ */ a("div", { className: Ut["rp-thumbnails"], children: n ? m.map((f, v) => {
|
|
2605
2603
|
var _, g;
|
|
2606
2604
|
return /* @__PURE__ */ a(
|
|
2607
2605
|
ya,
|
|
@@ -2616,10 +2614,10 @@ const sa = () => {
|
|
|
2616
2614
|
);
|
|
2617
2615
|
}) : null }) });
|
|
2618
2616
|
}), Ea = () => {
|
|
2619
|
-
const { thumbnailIcon: e } =
|
|
2617
|
+
const { thumbnailIcon: e } = re();
|
|
2620
2618
|
return e || /* @__PURE__ */ a(Hn, {});
|
|
2621
2619
|
}, Oa = () => {
|
|
2622
|
-
const { active: e, setActive: t } = On(), [n, r] = F(200), o = $(null), { thumbnailTool: i } = se(), l =
|
|
2620
|
+
const { active: e, setActive: t } = On(), [n, r] = F(200), o = $(null), { thumbnailTool: i } = se(), l = M(() => {
|
|
2623
2621
|
t((c) => !c);
|
|
2624
2622
|
}, []), s = D(() => typeof i != "boolean" && i ? /* @__PURE__ */ a(i, { onClick: l, active: e }) : i ? /* @__PURE__ */ a(X, { content: "Thumbnail", children: /* @__PURE__ */ a(B, { onClick: l, active: e, children: /* @__PURE__ */ a(Ea, {}) }) }) : null, [i, e, l]);
|
|
2625
2623
|
return /* @__PURE__ */ O(
|
|
@@ -2648,7 +2646,7 @@ const sa = () => {
|
|
|
2648
2646
|
// initialViewMode = ViewMode.SINGLE_PAGE,
|
|
2649
2647
|
initialScale: s,
|
|
2650
2648
|
initialScrollMode: c = Q.VERTICAL_SCROLLING,
|
|
2651
|
-
mobileWidth:
|
|
2649
|
+
mobileWidth: p
|
|
2652
2650
|
} = e;
|
|
2653
2651
|
return /* @__PURE__ */ a(
|
|
2654
2652
|
vr,
|
|
@@ -2657,7 +2655,7 @@ const sa = () => {
|
|
|
2657
2655
|
initialPage: l,
|
|
2658
2656
|
initialScrollMode: c,
|
|
2659
2657
|
initialRotate: o,
|
|
2660
|
-
children: /* @__PURE__ */ a(hr, { mobileWidth:
|
|
2658
|
+
children: /* @__PURE__ */ a(hr, { mobileWidth: p, children: /* @__PURE__ */ a(dr, { children: /* @__PURE__ */ a(Yn, { children: /* @__PURE__ */ a(Zn, { children: /* @__PURE__ */ a(Wn, { children: /* @__PURE__ */ a(mr, { initialSelectionMode: jt.TEXT, children: /* @__PURE__ */ a(pr, { children: /* @__PURE__ */ a(Oo, { children: /* @__PURE__ */ a(qn, { children: /* @__PURE__ */ a(ur, { textLayer: i, children: /* @__PURE__ */ a(Bn, { children: /* @__PURE__ */ a(
|
|
2661
2659
|
Gn,
|
|
2662
2660
|
{
|
|
2663
2661
|
darkMode: n,
|
|
@@ -2676,26 +2674,26 @@ const sa = () => {
|
|
|
2676
2674
|
initialSearch: l,
|
|
2677
2675
|
showToolbar: s = !0,
|
|
2678
2676
|
style: c,
|
|
2679
|
-
className:
|
|
2680
|
-
onLoaded:
|
|
2677
|
+
className: p,
|
|
2678
|
+
onLoaded: h,
|
|
2681
2679
|
cleanupOnLoaded: m,
|
|
2682
2680
|
...u
|
|
2683
|
-
} = e, [f, v] = F(null), [_, g] = F(null), [
|
|
2684
|
-
return
|
|
2681
|
+
} = e, [f, v] = F(null), [_, g] = F(null), [b, S] = F(null);
|
|
2682
|
+
return A(() => (h && h(), () => {
|
|
2685
2683
|
m && m();
|
|
2686
|
-
}), [
|
|
2684
|
+
}), [h, m]), /* @__PURE__ */ a("div", { ref: t, className: j(he["rp-theme-variables"], he["rp-container"]), children: /* @__PURE__ */ a(lr, { container: _, contentRef: b, children: /* @__PURE__ */ a(Da, { ...u, children: /* @__PURE__ */ a(to, { initialSearch: l, children: /* @__PURE__ */ a(xa, { initialThumbnailsVisible: i, children: /* @__PURE__ */ a(Un, { slots: r, children: /* @__PURE__ */ a(Vn, { children: /* @__PURE__ */ a(ir, { icons: o, children: /* @__PURE__ */ a(wr, { elementRef: b, children: /* @__PURE__ */ a(la, { children: /* @__PURE__ */ a(jn, { children: s ? /* @__PURE__ */ a(
|
|
2687
2685
|
sr,
|
|
2688
2686
|
{
|
|
2689
2687
|
getContainerRef: g,
|
|
2690
2688
|
toolbarRef: f,
|
|
2691
2689
|
style: c,
|
|
2692
|
-
className:
|
|
2690
|
+
className: p,
|
|
2693
2691
|
children: /* @__PURE__ */ O(br, { children: [
|
|
2694
2692
|
/* @__PURE__ */ O("div", { className: he["rp-layout"], children: [
|
|
2695
2693
|
/* @__PURE__ */ a(Ia, { ref: v }),
|
|
2696
2694
|
/* @__PURE__ */ O("div", { className: he["rp-content"], children: [
|
|
2697
2695
|
/* @__PURE__ */ a("div", { className: he["rp-sidebar"], children: /* @__PURE__ */ a(Oa, {}) }),
|
|
2698
|
-
/* @__PURE__ */ a("div", { ref:
|
|
2696
|
+
/* @__PURE__ */ a("div", { ref: S, className: he["rp-pages"], children: n })
|
|
2699
2697
|
] })
|
|
2700
2698
|
] }),
|
|
2701
2699
|
/* @__PURE__ */ a($n, {})
|
|
@@ -2704,8 +2702,8 @@ const sa = () => {
|
|
|
2704
2702
|
) : /* @__PURE__ */ a(
|
|
2705
2703
|
"div",
|
|
2706
2704
|
{
|
|
2707
|
-
ref:
|
|
2708
|
-
className: j(he["rp-pages"],
|
|
2705
|
+
ref: S,
|
|
2706
|
+
className: j(he["rp-pages"], p),
|
|
2709
2707
|
style: c,
|
|
2710
2708
|
children: n
|
|
2711
2709
|
}
|
|
@@ -2713,11 +2711,11 @@ const sa = () => {
|
|
|
2713
2711
|
});
|
|
2714
2712
|
export {
|
|
2715
2713
|
po as A,
|
|
2716
|
-
|
|
2714
|
+
xa as B,
|
|
2717
2715
|
Qr as C,
|
|
2718
2716
|
Do as D,
|
|
2719
2717
|
Na as E,
|
|
2720
|
-
|
|
2718
|
+
Rn as F,
|
|
2721
2719
|
Oa as G,
|
|
2722
2720
|
Da as H,
|
|
2723
2721
|
Ta as L,
|
|
@@ -2743,15 +2741,15 @@ export {
|
|
|
2743
2741
|
Wo as m,
|
|
2744
2742
|
na as n,
|
|
2745
2743
|
sa as o,
|
|
2746
|
-
|
|
2744
|
+
xn as p,
|
|
2747
2745
|
la as q,
|
|
2748
2746
|
Nn as r,
|
|
2749
2747
|
ga as s,
|
|
2750
2748
|
Pa as t,
|
|
2751
|
-
|
|
2749
|
+
ee as u,
|
|
2752
2750
|
Ia as v,
|
|
2753
2751
|
ya as w,
|
|
2754
|
-
|
|
2752
|
+
Ra as x,
|
|
2755
2753
|
En as y,
|
|
2756
2754
|
On as z
|
|
2757
2755
|
};
|