@pdf-viewer/react 1.8.4-rc.0 → 1.8.4-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RPDefaultLayout-a85a421b.js → RPDefaultLayout-9f6b57bc.js} +744 -745
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/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/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +1 -1
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/main.js +1 -1
- package/dist/utils/hooks/useFileDownload.js +1 -1
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePresentPage.js +1 -1
- package/dist/utils/hooks/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a, Fragment as me, jsxs as M } from "react/jsx-runtime";
|
|
2
2
|
import * as j from "react";
|
|
3
3
|
import { useRef as $, useEffect as z, useCallback as E, useState as G, useMemo as W, createContext as $e, useContext as Ge, useImperativeHandle as cn, createElement as Ze, PureComponent as tr, Component as nr, memo as ln } from "react";
|
|
4
4
|
import { ChevronUpIcon as He } from "./components/icons/ChevronUpIcon.js";
|
|
@@ -97,20 +97,20 @@ import { UICheckbox as $t } from "./components/ui/Checkbox.js";
|
|
|
97
97
|
import { ClearIcon as xo } from "./components/icons/ClearIcon.js";
|
|
98
98
|
import { InfoIcon as Gt } from "./components/icons/InfoIcon.js";
|
|
99
99
|
import './assets/RPDefaultLayout.css';const vn = () => {
|
|
100
|
-
const { viewMode: t } = Oe(), { scrollMode: e } = Ne(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = et(), { setFocusedPage:
|
|
100
|
+
const { viewMode: t } = Oe(), { scrollMode: e } = Ne(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = et(), { setFocusedPage: i } = oe(), s = $(), { columnCount: l } = un(), { widths: d, heights: u } = qe(), m = $(e), P = $(t), h = $(l), { targetScrollPage: _ } = pn();
|
|
101
101
|
z(() => {
|
|
102
102
|
n != null && n.scrollToItem && (s.current = n);
|
|
103
103
|
}, [n]), z(() => {
|
|
104
|
-
m.current = e,
|
|
104
|
+
m.current = e, P.current = t;
|
|
105
105
|
}, [e, t]);
|
|
106
106
|
const C = E(
|
|
107
|
-
(
|
|
107
|
+
(w, S) => {
|
|
108
108
|
if (!r)
|
|
109
109
|
return;
|
|
110
|
-
const f = Math.ceil(
|
|
111
|
-
if (
|
|
110
|
+
const f = Math.ceil(w / 2) * 2 - 1;
|
|
111
|
+
if (w === f + 1) {
|
|
112
112
|
const g = {
|
|
113
|
-
left:
|
|
113
|
+
left: d[f],
|
|
114
114
|
top: 0
|
|
115
115
|
};
|
|
116
116
|
return new Promise(
|
|
@@ -126,32 +126,32 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
126
126
|
behavior: S
|
|
127
127
|
});
|
|
128
128
|
},
|
|
129
|
-
[r,
|
|
129
|
+
[r, d, ct]
|
|
130
130
|
);
|
|
131
131
|
return z(() => {
|
|
132
|
-
m.current = e,
|
|
132
|
+
m.current = e, P.current = t;
|
|
133
133
|
}, [e, t]), z(() => {
|
|
134
134
|
h.current = l;
|
|
135
135
|
}, [l]), { scrollToPage: E(
|
|
136
|
-
(
|
|
137
|
-
|
|
138
|
-
const f =
|
|
136
|
+
(w, S = "smooth") => {
|
|
137
|
+
i(w);
|
|
138
|
+
const f = w - 1;
|
|
139
139
|
let p = f, g = 0;
|
|
140
|
-
if (
|
|
141
|
-
C(
|
|
140
|
+
if (P.current === Le.DUAL_PAGE && m.current === ne.PAGE_SCROLLING) {
|
|
141
|
+
C(w, S);
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
if (m.current === ne.PAGE_SCROLLING) {
|
|
145
|
-
|
|
145
|
+
i(w);
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
if (!s.current || !o)
|
|
149
149
|
return;
|
|
150
150
|
const c = o;
|
|
151
|
-
if (
|
|
151
|
+
if (_.current = w, m.current === ne.HORIZONTAL_SCROLLING) {
|
|
152
152
|
g = f;
|
|
153
153
|
const T = {
|
|
154
|
-
left: Ae(
|
|
154
|
+
left: Ae(d, g),
|
|
155
155
|
top: 0
|
|
156
156
|
};
|
|
157
157
|
return c.scrollTo({
|
|
@@ -159,23 +159,23 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
159
159
|
behavior: S
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
-
if (
|
|
162
|
+
if (P.current === Le.DUAL_PAGE) {
|
|
163
163
|
g = f % 2, p = Math.floor(f / 2);
|
|
164
164
|
const T = {
|
|
165
|
-
left: Ae(
|
|
166
|
-
top: Ae(
|
|
165
|
+
left: Ae(d, g),
|
|
166
|
+
top: Ae(u, p)
|
|
167
167
|
};
|
|
168
168
|
return c.scrollTo({
|
|
169
169
|
...T,
|
|
170
170
|
behavior: S
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
const
|
|
173
|
+
const b = {
|
|
174
174
|
left: 0,
|
|
175
|
-
top: Ae(
|
|
175
|
+
top: Ae(u, p)
|
|
176
176
|
};
|
|
177
177
|
return c.scrollTo({
|
|
178
|
-
...
|
|
178
|
+
...b,
|
|
179
179
|
behavior: S
|
|
180
180
|
});
|
|
181
181
|
},
|
|
@@ -183,14 +183,14 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
183
183
|
o,
|
|
184
184
|
l,
|
|
185
185
|
C,
|
|
186
|
-
|
|
186
|
+
i,
|
|
187
187
|
ct,
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
u,
|
|
189
|
+
d
|
|
190
190
|
]
|
|
191
191
|
) };
|
|
192
192
|
}, Io = (t = 1) => {
|
|
193
|
-
const [e, n] = G(t), [o, r] = G(0), { scrollToPage:
|
|
193
|
+
const [e, n] = G(t), [o, r] = G(0), { scrollToPage: i } = vn(), s = $(1), { viewMode: l } = Oe(), { scrollMode: d } = Ne(), { widths: u } = qe(), { pagesRef: m } = ge(), P = Tt(e, 100), h = E(
|
|
194
194
|
(p) => {
|
|
195
195
|
if (!/^[0-9]*$/g.test(p.toString()) || !p)
|
|
196
196
|
return { success: !1, currentPage: s.current };
|
|
@@ -198,34 +198,34 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
198
198
|
return c < 0 || c > o ? { success: !1, currentPage: s.current } : (n(c), s.current = c, { success: !0, currentPage: +p });
|
|
199
199
|
},
|
|
200
200
|
[o]
|
|
201
|
-
),
|
|
201
|
+
), _ = E(h, [h]), C = E(
|
|
202
202
|
(p) => {
|
|
203
203
|
const g = h(p);
|
|
204
|
-
return g.success &&
|
|
204
|
+
return g.success && i(g.currentPage), g;
|
|
205
205
|
},
|
|
206
|
-
[h,
|
|
206
|
+
[h, i]
|
|
207
207
|
), y = E((p) => {
|
|
208
208
|
const g = p % 2 === 1;
|
|
209
209
|
if (!m || g)
|
|
210
210
|
return !1;
|
|
211
|
-
const c = g ?
|
|
212
|
-
return l === Le.DUAL_PAGE && c +
|
|
213
|
-
}, [l,
|
|
211
|
+
const c = g ? u[p] : u[p - 1], b = g ? u[p + 1] : u[p];
|
|
212
|
+
return l === Le.DUAL_PAGE && c + b < m.clientWidth;
|
|
213
|
+
}, [l, u, m, o]), w = E(() => {
|
|
214
214
|
let p = e - 1;
|
|
215
215
|
y(p) && (p = e - 2), C(p);
|
|
216
|
-
}, [C, e, l,
|
|
216
|
+
}, [C, e, l, d, y]), S = W(() => l === Le.DUAL_PAGE && d === ne.PAGE_SCROLLING ? e === o - 1 : e === o, [e, o, l, d]), f = E(() => {
|
|
217
217
|
if (S)
|
|
218
218
|
return;
|
|
219
219
|
let p = e + 1;
|
|
220
220
|
y(p) && (p = e + 2), C(p);
|
|
221
|
-
}, [C, e, y, l,
|
|
221
|
+
}, [C, e, y, l, d, S]);
|
|
222
222
|
return {
|
|
223
|
-
focusedPage:
|
|
223
|
+
focusedPage: P,
|
|
224
224
|
totalPages: o,
|
|
225
|
-
setFocusedPage:
|
|
225
|
+
setFocusedPage: _,
|
|
226
226
|
setTotalPages: r,
|
|
227
227
|
nextPage: f,
|
|
228
|
-
prevPage:
|
|
228
|
+
prevPage: w,
|
|
229
229
|
goToPage: C
|
|
230
230
|
};
|
|
231
231
|
}, wn = $e({
|
|
@@ -244,19 +244,19 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
244
244
|
const t = Ge(wn);
|
|
245
245
|
return typeof (t == null ? void 0 : t.focusedPage) > "u" && Qr.error("Please use this hooks inside children component of RPProvider"), t;
|
|
246
246
|
}, Bs = ({ children: t }) => {
|
|
247
|
-
const { pdf: e } = J(), { focusedPage: n, totalPages: o, setFocusedPage: r, setTotalPages:
|
|
247
|
+
const { pdf: e } = J(), { focusedPage: n, totalPages: o, setFocusedPage: r, setTotalPages: i, goToPage: s, nextPage: l, prevPage: d } = Io();
|
|
248
248
|
return z(() => {
|
|
249
|
-
e != null && e.numPages && (
|
|
250
|
-
}, [e,
|
|
249
|
+
e != null && e.numPages && (i(e.numPages), r(1));
|
|
250
|
+
}, [e, i, r]), /* @__PURE__ */ a(
|
|
251
251
|
wn.Provider,
|
|
252
252
|
{
|
|
253
253
|
value: {
|
|
254
254
|
focusedPage: n,
|
|
255
255
|
totalPages: o,
|
|
256
256
|
setFocusedPage: r,
|
|
257
|
-
setTotalPages:
|
|
257
|
+
setTotalPages: i,
|
|
258
258
|
nextPage: l,
|
|
259
|
-
prevPage:
|
|
259
|
+
prevPage: d,
|
|
260
260
|
goToPage: s
|
|
261
261
|
},
|
|
262
262
|
children: t
|
|
@@ -268,27 +268,27 @@ const Ro = () => {
|
|
|
268
268
|
loadedPages: 0,
|
|
269
269
|
totalPages: 0,
|
|
270
270
|
percentage: 0
|
|
271
|
-
}), [r,
|
|
271
|
+
}), [r, i] = G(!1), [s, l] = G(!1), [d, u] = G(null), m = $(!1);
|
|
272
272
|
z(() => {
|
|
273
273
|
m.current;
|
|
274
274
|
}, [m]);
|
|
275
|
-
const
|
|
275
|
+
const P = E(() => {
|
|
276
276
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
277
277
|
const p = document.querySelector(".rp-print-zone");
|
|
278
278
|
p && p.remove();
|
|
279
279
|
}, []), h = E(() => {
|
|
280
|
-
m.current = !1,
|
|
280
|
+
m.current = !1, i(!1), l(!1), u(null), o({
|
|
281
281
|
loadedPages: 0,
|
|
282
282
|
totalPages: 0,
|
|
283
283
|
percentage: 0
|
|
284
284
|
});
|
|
285
|
-
}, []),
|
|
285
|
+
}, []), _ = () => {
|
|
286
286
|
m.current = !0;
|
|
287
287
|
}, C = async ({
|
|
288
288
|
scratchCanvas: p,
|
|
289
289
|
pdfDocument: g,
|
|
290
290
|
pageNumber: c,
|
|
291
|
-
viewerPdfPage:
|
|
291
|
+
viewerPdfPage: b,
|
|
292
292
|
printResolution: v,
|
|
293
293
|
optionalContentConfigPromise: T,
|
|
294
294
|
printAnnotationStoragePromise: R
|
|
@@ -298,7 +298,7 @@ const Ro = () => {
|
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
300
|
const x = v / Lr.PDF;
|
|
301
|
-
p.width = Math.floor(
|
|
301
|
+
p.width = Math.floor(b.width * x), p.height = Math.floor(b.height * x);
|
|
302
302
|
const I = p.getContext("2d");
|
|
303
303
|
I.save(), I.fillStyle = "rgb(255, 255, 255)", I.fillRect(0, 0, p.width, p.height), I.restore();
|
|
304
304
|
const [O, A] = await Promise.all([
|
|
@@ -312,7 +312,7 @@ const Ro = () => {
|
|
|
312
312
|
const F = {
|
|
313
313
|
canvasContext: I,
|
|
314
314
|
transform: [x, 0, 0, x, 0, 0],
|
|
315
|
-
viewport: O.getViewport({ scale: 1, rotation:
|
|
315
|
+
viewport: O.getViewport({ scale: 1, rotation: b.rotation }),
|
|
316
316
|
intent: "print",
|
|
317
317
|
annotationMode: Er.ENABLE_STORAGE,
|
|
318
318
|
optionalContentConfigPromise: T,
|
|
@@ -340,12 +340,12 @@ const Ro = () => {
|
|
|
340
340
|
});
|
|
341
341
|
v.observe(document.body, { childList: !0, subtree: !0 });
|
|
342
342
|
});
|
|
343
|
-
}, []),
|
|
343
|
+
}, []), w = async (p) => {
|
|
344
344
|
const g = document.createElement("img"), c = document.createElement("div");
|
|
345
|
-
return c.classList.add("rp-print-page"), await new Promise((
|
|
345
|
+
return c.classList.add("rp-print-page"), await new Promise((b, v) => {
|
|
346
346
|
p.toBlob((T) => {
|
|
347
347
|
T ? (g.src = URL.createObjectURL(T), g.onload = () => {
|
|
348
|
-
URL.revokeObjectURL(g.src),
|
|
348
|
+
URL.revokeObjectURL(g.src), b();
|
|
349
349
|
}, g.onerror = v) : v(new Error("Failed to create blob"));
|
|
350
350
|
});
|
|
351
351
|
}).catch(() => {
|
|
@@ -353,12 +353,12 @@ const Ro = () => {
|
|
|
353
353
|
}, S = (p, g) => {
|
|
354
354
|
const c = document.createElement("div");
|
|
355
355
|
c.classList.add("rp-print-zone");
|
|
356
|
-
const
|
|
356
|
+
const b = document.createElement("style"), v = g.get(1);
|
|
357
357
|
if (v) {
|
|
358
358
|
const { width: T, height: R } = v == null ? void 0 : v.page.getViewport({ scale: 1 });
|
|
359
|
-
|
|
359
|
+
b.innerHTML = `@page { size: ${T}px ${R}px }`;
|
|
360
360
|
}
|
|
361
|
-
return c.appendChild(
|
|
361
|
+
return c.appendChild(b), c.append(...p), c;
|
|
362
362
|
}, f = E(async () => {
|
|
363
363
|
if (!t)
|
|
364
364
|
return;
|
|
@@ -366,7 +366,7 @@ const Ro = () => {
|
|
|
366
366
|
const p = document.createElement("canvas"), g = [];
|
|
367
367
|
try {
|
|
368
368
|
t.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
369
|
-
const
|
|
369
|
+
const b = t.getOptionalContentConfig({ intent: "print" }), v = Promise.resolve(
|
|
370
370
|
t.annotationStorage.print ?? void 0
|
|
371
371
|
), T = e.size;
|
|
372
372
|
for (const [x, I] of e) {
|
|
@@ -381,13 +381,13 @@ const Ro = () => {
|
|
|
381
381
|
pageNumber: x,
|
|
382
382
|
viewerPdfPage: O,
|
|
383
383
|
printResolution: 150,
|
|
384
|
-
optionalContentConfigPromise:
|
|
384
|
+
optionalContentConfigPromise: b,
|
|
385
385
|
printAnnotationStoragePromise: v
|
|
386
386
|
}), m.current) {
|
|
387
387
|
h();
|
|
388
388
|
return;
|
|
389
389
|
}
|
|
390
|
-
const A = await
|
|
390
|
+
const A = await w(p);
|
|
391
391
|
g.push(A);
|
|
392
392
|
const F = parseFloat((g.length / T * 100).toFixed(2));
|
|
393
393
|
o({
|
|
@@ -401,27 +401,27 @@ const Ro = () => {
|
|
|
401
401
|
return;
|
|
402
402
|
}
|
|
403
403
|
const R = S(g, e);
|
|
404
|
-
document.body.appendChild(R), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"),
|
|
404
|
+
document.body.appendChild(R), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), i(!0), await y();
|
|
405
405
|
} catch (c) {
|
|
406
|
-
l(!0), c instanceof Error &&
|
|
406
|
+
l(!0), c instanceof Error && u(c);
|
|
407
407
|
} finally {
|
|
408
408
|
p.height = 0, p.width = 0;
|
|
409
409
|
}
|
|
410
410
|
}, [t, e, m]);
|
|
411
411
|
return z(() => {
|
|
412
412
|
const p = () => {
|
|
413
|
-
h(),
|
|
413
|
+
h(), P();
|
|
414
414
|
};
|
|
415
415
|
return window.addEventListener("afterprint", p, !0), () => {
|
|
416
416
|
window.removeEventListener("afterprint", p, !0);
|
|
417
417
|
};
|
|
418
|
-
}, [
|
|
418
|
+
}, [P, h]), {
|
|
419
419
|
print: f,
|
|
420
|
-
cancel:
|
|
420
|
+
cancel: _,
|
|
421
421
|
progress: n,
|
|
422
422
|
isComplete: r,
|
|
423
423
|
isError: s,
|
|
424
|
-
error:
|
|
424
|
+
error: d
|
|
425
425
|
};
|
|
426
426
|
}, _n = $e({
|
|
427
427
|
print: () => {
|
|
@@ -441,36 +441,36 @@ const Ro = () => {
|
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
}), Zs = ({ children: t }) => {
|
|
444
|
-
const [e, n] = G(null), [o, r] = G(null), { print:
|
|
445
|
-
|
|
446
|
-
}, []), h = (
|
|
447
|
-
m &&
|
|
448
|
-
},
|
|
449
|
-
(
|
|
450
|
-
n(() =>
|
|
444
|
+
const [e, n] = G(null), [o, r] = G(null), { print: i, cancel: s, progress: l, isComplete: d, isError: u, error: m } = Ro(), P = E((w) => {
|
|
445
|
+
w && typeof w == "function" && r(() => w);
|
|
446
|
+
}, []), h = (w) => {
|
|
447
|
+
m && w(m);
|
|
448
|
+
}, _ = E(
|
|
449
|
+
(w) => {
|
|
450
|
+
n(() => w);
|
|
451
451
|
},
|
|
452
452
|
[l, e]
|
|
453
453
|
);
|
|
454
454
|
z(() => {
|
|
455
|
-
|
|
456
|
-
}, [
|
|
457
|
-
|
|
458
|
-
console.error(
|
|
455
|
+
d && o && C();
|
|
456
|
+
}, [d, o]), z(() => {
|
|
457
|
+
u && h((w) => {
|
|
458
|
+
console.error(w);
|
|
459
459
|
});
|
|
460
|
-
}, [
|
|
460
|
+
}, [u]), z(() => {
|
|
461
461
|
l && e && e(l);
|
|
462
462
|
}, [l, e]);
|
|
463
463
|
const C = () => {
|
|
464
464
|
o && (o(), r(null));
|
|
465
465
|
}, y = {
|
|
466
|
-
print:
|
|
466
|
+
print: i,
|
|
467
467
|
cancel: s,
|
|
468
|
-
setOnProgress:
|
|
469
|
-
setOnComplete:
|
|
468
|
+
setOnProgress: _,
|
|
469
|
+
setOnComplete: P,
|
|
470
470
|
setOnError: h,
|
|
471
471
|
progress: l
|
|
472
472
|
};
|
|
473
|
-
return /* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ a(_n.Provider, { value: y, children: t });
|
|
474
474
|
}, tt = () => {
|
|
475
475
|
const t = Ge(_n);
|
|
476
476
|
if (!t)
|
|
@@ -481,30 +481,30 @@ const Ro = () => {
|
|
|
481
481
|
(s) => {
|
|
482
482
|
if (!n.size)
|
|
483
483
|
return;
|
|
484
|
-
const l = s > n.size ? n.size : s,
|
|
485
|
-
const { thumbnailViewport:
|
|
484
|
+
const l = s > n.size ? n.size : s, u = Array.from(n.values()).slice(0, l).map((m) => {
|
|
485
|
+
const { thumbnailViewport: P, scale: h } = Xr(m.page, m.defaultRotation);
|
|
486
486
|
return {
|
|
487
487
|
scale: h,
|
|
488
488
|
page: m.page,
|
|
489
489
|
loading: !0,
|
|
490
|
-
viewport:
|
|
490
|
+
viewport: P,
|
|
491
491
|
defaultRotation: m.defaultRotation
|
|
492
492
|
};
|
|
493
|
-
}).reduce((m,
|
|
494
|
-
e(
|
|
493
|
+
}).reduce((m, P) => (m[P.page.pageNumber] = P, m), {});
|
|
494
|
+
e(u);
|
|
495
495
|
},
|
|
496
496
|
[n]
|
|
497
497
|
);
|
|
498
498
|
z(() => {
|
|
499
499
|
r(10);
|
|
500
500
|
}, [r]);
|
|
501
|
-
const
|
|
501
|
+
const i = E(
|
|
502
502
|
(s) => {
|
|
503
503
|
if (!n)
|
|
504
504
|
return;
|
|
505
505
|
const l = n.get(s);
|
|
506
|
-
l && e((
|
|
507
|
-
...
|
|
506
|
+
l && e((d) => ({
|
|
507
|
+
...d,
|
|
508
508
|
[s]: {
|
|
509
509
|
loading: !0,
|
|
510
510
|
page: l.page,
|
|
@@ -516,7 +516,7 @@ const Ro = () => {
|
|
|
516
516
|
},
|
|
517
517
|
[n]
|
|
518
518
|
);
|
|
519
|
-
return { thumbnailPages: t, addPage:
|
|
519
|
+
return { thumbnailPages: t, addPage: i, addToPage: r, thumbnailLength: o };
|
|
520
520
|
}, bn = $e({
|
|
521
521
|
thumbnailPages: {},
|
|
522
522
|
addPage: (t) => {
|
|
@@ -531,21 +531,21 @@ const Ro = () => {
|
|
|
531
531
|
children: t,
|
|
532
532
|
initialThumbnailsVisible: e
|
|
533
533
|
}) => {
|
|
534
|
-
const { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength:
|
|
535
|
-
return /* @__PURE__ */
|
|
534
|
+
const { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: i } = Lo(), [s, l] = G(e);
|
|
535
|
+
return /* @__PURE__ */ a(
|
|
536
536
|
bn.Provider,
|
|
537
537
|
{
|
|
538
|
-
value: { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength:
|
|
538
|
+
value: { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: i, active: s, setActive: l },
|
|
539
539
|
children: t
|
|
540
540
|
}
|
|
541
541
|
);
|
|
542
542
|
}, Eo = (t = {}, e = "") => {
|
|
543
|
-
const [n, o] = G(e), [r,
|
|
543
|
+
const [n, o] = G(e), [r, i] = G(!1), { pdf: s, pages: l } = J(), { widths: d, heights: u } = qe(), m = $(!n), { currentZoom: P } = Je(), [h, _] = G([]), { setFocusedPage: C } = oe(), { columnCount: y } = Oe(), { pageRotate: w } = Ue(), [S, f] = G(0), { pageScrollElementRef: p, virtualScrollableElementRef: g } = et(), { scrollMode: c } = Ne(), { pagesRef: b } = ge(), [v, T] = G(null), R = $({}), x = W(() => S === 0 ? null : h[S - 1], [S, h]), I = W(() => h.length, [h]);
|
|
544
544
|
z(() => {
|
|
545
545
|
if (!x || !l)
|
|
546
546
|
return;
|
|
547
547
|
const L = g || p;
|
|
548
|
-
if (!L || !
|
|
548
|
+
if (!L || !b)
|
|
549
549
|
return;
|
|
550
550
|
const N = l.get(x.page);
|
|
551
551
|
if (c === ne.PAGE_SCROLLING && C(x.page), !N)
|
|
@@ -553,20 +553,20 @@ const Ro = () => {
|
|
|
553
553
|
let D = 0, k = 0;
|
|
554
554
|
if (c === ne.VERTICAL_SCROLLING) {
|
|
555
555
|
const de = x.page - 1, ee = y, Fe = de % ee, we = Math.floor(de / ee);
|
|
556
|
-
D = Ae(
|
|
556
|
+
D = Ae(u, we), k = Ae(d, Fe);
|
|
557
557
|
}
|
|
558
|
-
c === ne.HORIZONTAL_SCROLLING && (k =
|
|
558
|
+
c === ne.HORIZONTAL_SCROLLING && (k = d.slice(0, x.page - 1).reduce((de, ee) => de + ee, 0));
|
|
559
559
|
const q = {
|
|
560
|
-
height:
|
|
561
|
-
width:
|
|
560
|
+
height: u[x.page - 1],
|
|
561
|
+
width: d[x.page - 1]
|
|
562
562
|
}, H = {
|
|
563
563
|
top: q.height / 2,
|
|
564
564
|
left: q.width / 2
|
|
565
|
-
}, U =
|
|
565
|
+
}, U = w[x.page], { leftInPage: V, topInPage: K } = Kr(
|
|
566
566
|
q,
|
|
567
567
|
H,
|
|
568
568
|
x.rect,
|
|
569
|
-
|
|
569
|
+
P,
|
|
570
570
|
U
|
|
571
571
|
), X = k + V, Q = D + K, le = {
|
|
572
572
|
left: Math.max(X, 0),
|
|
@@ -579,13 +579,13 @@ const Ro = () => {
|
|
|
579
579
|
}, [
|
|
580
580
|
l,
|
|
581
581
|
C,
|
|
582
|
-
u,
|
|
583
582
|
d,
|
|
583
|
+
u,
|
|
584
584
|
x,
|
|
585
585
|
c,
|
|
586
586
|
g,
|
|
587
587
|
p,
|
|
588
|
-
|
|
588
|
+
b
|
|
589
589
|
]);
|
|
590
590
|
const O = E(() => {
|
|
591
591
|
f((L) => I ? L + 1 > I ? 1 : L + 1 : 0);
|
|
@@ -605,10 +605,10 @@ const Ro = () => {
|
|
|
605
605
|
}, []);
|
|
606
606
|
return z(() => {
|
|
607
607
|
if (!n) {
|
|
608
|
-
m.current = !0,
|
|
608
|
+
m.current = !0, _([]), f(0);
|
|
609
609
|
return;
|
|
610
610
|
}
|
|
611
|
-
m.current = !1,
|
|
611
|
+
m.current = !1, i(!0), _([]), f(0), F(s).then((L) => {
|
|
612
612
|
R.current = L;
|
|
613
613
|
const D = Object.keys(L).reduce((k, q) => {
|
|
614
614
|
const H = dr(
|
|
@@ -619,10 +619,10 @@ const Ro = () => {
|
|
|
619
619
|
).map((U, V) => ({ ...U, page: Number(q), pageMatchIdx: V }));
|
|
620
620
|
return [...k, ...H];
|
|
621
621
|
}, []);
|
|
622
|
-
|
|
622
|
+
_(D), f(D.length ? 1 : 0);
|
|
623
623
|
}).catch(() => {
|
|
624
|
-
|
|
625
|
-
}).finally(() =>
|
|
624
|
+
_([]), f(0);
|
|
625
|
+
}).finally(() => i(!1));
|
|
626
626
|
}, [n, F, s, t]), {
|
|
627
627
|
search: n,
|
|
628
628
|
setSearch: o,
|
|
@@ -660,42 +660,42 @@ const Ro = () => {
|
|
|
660
660
|
}) => {
|
|
661
661
|
const [n, o] = G({}), {
|
|
662
662
|
loading: r,
|
|
663
|
-
setSearch:
|
|
663
|
+
setSearch: i,
|
|
664
664
|
totalMatches: s,
|
|
665
665
|
currentMatchPosition: l,
|
|
666
|
-
currentMatch:
|
|
667
|
-
search:
|
|
666
|
+
currentMatch: d,
|
|
667
|
+
search: u,
|
|
668
668
|
matches: m,
|
|
669
|
-
nextMatch:
|
|
669
|
+
nextMatch: P,
|
|
670
670
|
prevMatch: h,
|
|
671
|
-
currentMatchElement:
|
|
671
|
+
currentMatchElement: _,
|
|
672
672
|
setCurrentMatchElement: C
|
|
673
673
|
} = Eo(n, e);
|
|
674
|
-
return /* @__PURE__ */
|
|
674
|
+
return /* @__PURE__ */ a(
|
|
675
675
|
Pn.Provider,
|
|
676
676
|
{
|
|
677
677
|
value: {
|
|
678
678
|
searchOptions: n,
|
|
679
679
|
setSearchOptions: o,
|
|
680
680
|
loading: r,
|
|
681
|
-
setSearch:
|
|
681
|
+
setSearch: i,
|
|
682
682
|
totalMatches: s,
|
|
683
683
|
currentMatchPosition: l,
|
|
684
|
-
currentMatch:
|
|
685
|
-
nextMatch:
|
|
684
|
+
currentMatch: d,
|
|
685
|
+
nextMatch: P,
|
|
686
686
|
prevMatch: h,
|
|
687
|
-
search:
|
|
687
|
+
search: u,
|
|
688
688
|
matches: m,
|
|
689
|
-
currentMatchElement:
|
|
689
|
+
currentMatchElement: _,
|
|
690
690
|
setCurrentMatchElement: C
|
|
691
691
|
},
|
|
692
692
|
children: t
|
|
693
693
|
}
|
|
694
694
|
);
|
|
695
695
|
}, Rt = () => Ge(Pn), Tn = $e(null), Xs = ({ children: t }) => {
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
}, []),
|
|
696
|
+
const e = $(!1), [n, o] = G([]), r = E((d) => {
|
|
697
|
+
o((u) => [...u, { id: d.page.pageNumber.toString(), data: d, priority: 0 }]);
|
|
698
|
+
}, []), i = W(() => new gr(r), [r]), { focusedPage: s } = oe(), l = E((d) => (e.current = !0, vr(
|
|
699
699
|
d.data.page,
|
|
700
700
|
d.data.canvasElem,
|
|
701
701
|
d.data.options
|
|
@@ -705,17 +705,18 @@ const Ro = () => {
|
|
|
705
705
|
d.data.onLoaded && d.data.onLoaded();
|
|
706
706
|
})), []);
|
|
707
707
|
return z(() => {
|
|
708
|
-
|
|
709
|
-
}, [
|
|
710
|
-
if (
|
|
711
|
-
return;
|
|
712
|
-
const d = s.dequeue();
|
|
713
|
-
if (!d)
|
|
708
|
+
s && (i.changePagePriority(`^page-${s}`, 0), i.changePagePriority(`^thumbnail-${s}`, 1));
|
|
709
|
+
}, [s]), z(() => {
|
|
710
|
+
if (i.isEmpty() || e.current)
|
|
714
711
|
return;
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
712
|
+
const d = () => {
|
|
713
|
+
const u = i.dequeue();
|
|
714
|
+
u ? l(u).finally(() => {
|
|
715
|
+
d();
|
|
716
|
+
}) : (e.current = !1, o(i.peekAll()));
|
|
717
|
+
};
|
|
718
|
+
d();
|
|
719
|
+
}, [i, l, n]), /* @__PURE__ */ a(Tn.Provider, { value: i, children: t });
|
|
719
720
|
}, yn = () => {
|
|
720
721
|
const t = Ge(Tn);
|
|
721
722
|
if (!t)
|
|
@@ -735,58 +736,58 @@ const Ro = () => {
|
|
|
735
736
|
"rp-page": "_rp-page_14ohm_1",
|
|
736
737
|
"rp-loader-wrapper": "_rp-loader-wrapper_14ohm_15"
|
|
737
738
|
}, No = (t) => {
|
|
738
|
-
const { pageNumber: e, onLoaded: n, onLoading: o } = t, r = $(null), { pages:
|
|
739
|
+
const { pageNumber: e, onLoaded: n, onLoading: o } = t, r = $(null), { pages: i } = J(), { pageRotate: s } = Ue(), l = $(), { currentZoom: d } = Je(), u = yn(), m = $(`page-${e}`);
|
|
739
740
|
return z(() => {
|
|
740
|
-
if (!
|
|
741
|
+
if (!i || d === 0)
|
|
741
742
|
return;
|
|
742
|
-
const
|
|
743
|
-
if (r.current &&
|
|
743
|
+
const P = i.get(e);
|
|
744
|
+
if (r.current && P) {
|
|
744
745
|
const h = r.current;
|
|
745
746
|
h.hidden = !0;
|
|
746
|
-
const
|
|
747
|
-
|
|
747
|
+
const _ = l.current;
|
|
748
|
+
_ && _.cancel(), o && o(), u.enqueue(
|
|
748
749
|
m.current,
|
|
749
750
|
{
|
|
750
|
-
page:
|
|
751
|
+
page: P.page,
|
|
751
752
|
canvasElem: h,
|
|
752
753
|
options: {
|
|
753
|
-
scale:
|
|
754
|
+
scale: d,
|
|
754
755
|
rotate: s[e],
|
|
755
756
|
renderForms: !0
|
|
756
757
|
},
|
|
757
758
|
onLoaded: n
|
|
758
759
|
},
|
|
759
|
-
|
|
760
|
+
3
|
|
760
761
|
);
|
|
761
762
|
}
|
|
762
763
|
return () => {
|
|
763
|
-
|
|
764
|
+
u.removeQueue(m.current);
|
|
764
765
|
};
|
|
765
|
-
}, [
|
|
766
|
+
}, [i, e, s, d, o, n, u]), /* @__PURE__ */ a("canvas", { "data-rp": `page-${e}-canvas`, ref: r });
|
|
766
767
|
}, Oo = "_selecting_usdup_9", he = {
|
|
767
768
|
"rp-text-layer": "_rp-text-layer_usdup_1",
|
|
768
769
|
selecting: Oo,
|
|
769
770
|
"rp-text-layer-text": "_rp-text-layer-text_usdup_39"
|
|
770
771
|
}, Do = (t) => {
|
|
771
|
-
const { pageNumber: e } = t, { pages: n } = J(), o = $(null), { matches: r, currentMatch:
|
|
772
|
+
const { pageNumber: e } = t, { pages: n } = J(), o = $(null), { matches: r, currentMatch: i, setCurrentMatchElement: s } = Rt(), [l, d] = G(
|
|
772
773
|
[]
|
|
773
|
-
),
|
|
774
|
+
), u = $(), m = $(), P = $([]), h = W(() => r.filter((p) => p.pageIndex === e - 1), [r, e]), _ = E(
|
|
774
775
|
(p, g, c = !1) => {
|
|
775
776
|
if (c && ur(p, g), !h.length) {
|
|
776
|
-
|
|
777
|
+
P.current = [], d([]);
|
|
777
778
|
return;
|
|
778
779
|
}
|
|
779
|
-
const
|
|
780
|
-
|
|
780
|
+
const b = pr(h, p, g);
|
|
781
|
+
d(b);
|
|
781
782
|
},
|
|
782
783
|
[h]
|
|
783
|
-
), C = $(), y = $(!1),
|
|
784
|
+
), C = $(), y = $(!1), w = E(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
|
|
784
785
|
z(() => ((() => {
|
|
785
786
|
if (C.current)
|
|
786
787
|
return;
|
|
787
788
|
C.current = new AbortController();
|
|
788
789
|
const { signal: g } = C.current, c = () => {
|
|
789
|
-
|
|
790
|
+
w().forEach((v) => {
|
|
790
791
|
const T = v.querySelector(".endOfContent");
|
|
791
792
|
T && (v.appendChild(T), T.style.width = "", T.style.height = "", v.classList.remove(he.selecting));
|
|
792
793
|
});
|
|
@@ -816,7 +817,7 @@ const Ro = () => {
|
|
|
816
817
|
},
|
|
817
818
|
{ signal: g }
|
|
818
819
|
);
|
|
819
|
-
let
|
|
820
|
+
let b = null;
|
|
820
821
|
document.addEventListener(
|
|
821
822
|
"selectionchange",
|
|
822
823
|
() => {
|
|
@@ -831,11 +832,11 @@ const Ro = () => {
|
|
|
831
832
|
const T = /* @__PURE__ */ new Set();
|
|
832
833
|
for (let N = 0; N < v.rangeCount; N++) {
|
|
833
834
|
const D = v.getRangeAt(N);
|
|
834
|
-
|
|
835
|
+
w().forEach((k) => {
|
|
835
836
|
D.intersectsNode(k) && !T.has(k) && T.add(k);
|
|
836
837
|
});
|
|
837
838
|
}
|
|
838
|
-
|
|
839
|
+
w().forEach((N) => {
|
|
839
840
|
if (T.has(N))
|
|
840
841
|
N.classList.add(he.selecting);
|
|
841
842
|
else {
|
|
@@ -844,72 +845,72 @@ const Ro = () => {
|
|
|
844
845
|
}
|
|
845
846
|
});
|
|
846
847
|
const R = v.getRangeAt(0);
|
|
847
|
-
let I =
|
|
848
|
+
let I = b && (R.compareBoundaryPoints(Range.END_TO_END, b) === 0 || R.compareBoundaryPoints(Range.START_TO_END, b) === 0) ? R.startContainer : R.endContainer;
|
|
848
849
|
I.nodeType === Node.TEXT_NODE && (I = I.parentNode);
|
|
849
850
|
const O = (F = I.parentElement) == null ? void 0 : F.closest(
|
|
850
851
|
he["rp-text-layer"]
|
|
851
852
|
), A = O == null ? void 0 : O.querySelector(".endOfContent");
|
|
852
|
-
A && O && (A.style.width = O.style.width, A.style.height = O.style.height, (L = I.parentElement) == null || L.insertBefore(A, I.nextSibling)),
|
|
853
|
+
A && O && (A.style.width = O.style.width, A.style.height = O.style.height, (L = I.parentElement) == null || L.insertBefore(A, I.nextSibling)), b = R.cloneRange();
|
|
853
854
|
},
|
|
854
855
|
{ signal: g }
|
|
855
856
|
);
|
|
856
857
|
})(), () => {
|
|
857
858
|
var g;
|
|
858
859
|
(g = C.current) == null || g.abort(), C.current = void 0;
|
|
859
|
-
}), [
|
|
860
|
+
}), [w]);
|
|
860
861
|
const S = E(() => {
|
|
861
862
|
o.current && o.current.classList.add(he.selecting);
|
|
862
863
|
}, []), f = E(() => {
|
|
863
864
|
o.current && o.current.classList.remove(he.selecting);
|
|
864
865
|
}, []);
|
|
865
866
|
return z(() => {
|
|
866
|
-
if (
|
|
867
|
+
if (P.current.forEach((c) => {
|
|
867
868
|
c.classList.remove("selected");
|
|
868
|
-
}), !l.length || !
|
|
869
|
+
}), !l.length || !i || i.pageIndex !== e - 1)
|
|
869
870
|
return;
|
|
870
871
|
const p = h.findIndex(
|
|
871
|
-
(c) => JSON.stringify(c) === JSON.stringify(
|
|
872
|
+
(c) => JSON.stringify(c) === JSON.stringify(i)
|
|
872
873
|
);
|
|
873
874
|
if (p === -1)
|
|
874
875
|
return;
|
|
875
876
|
const g = l.filter((c) => c.index === p);
|
|
876
|
-
g.length && (
|
|
877
|
+
g.length && (P.current = g.map((c) => c.element), s(g[0].element), g.forEach((c) => {
|
|
877
878
|
c.element.classList.add("selected");
|
|
878
879
|
}));
|
|
879
|
-
}, [
|
|
880
|
+
}, [i, l, h]), z(() => {
|
|
880
881
|
const p = n.get(e);
|
|
881
882
|
if (!p || !o.current)
|
|
882
883
|
return;
|
|
883
884
|
const g = o.current;
|
|
884
|
-
return
|
|
885
|
-
const
|
|
886
|
-
return
|
|
887
|
-
viewport:
|
|
885
|
+
return u.current && u.current.cancel(), p.page.getTextContent().then((c) => {
|
|
886
|
+
const b = p.page.getViewport({ scale: 1 });
|
|
887
|
+
return u.current = new Rr.TextLayer({
|
|
888
|
+
viewport: b,
|
|
888
889
|
textContentSource: c,
|
|
889
890
|
container: g
|
|
890
|
-
}), m.current = c, g && (g.innerText = ""),
|
|
891
|
+
}), m.current = c, g && (g.innerText = ""), u.current.render();
|
|
891
892
|
}).then(() => {
|
|
892
893
|
var T, R;
|
|
893
894
|
[].slice.call(g.children).forEach((x) => {
|
|
894
895
|
x.classList.add(he["rp-text-layer-text"]), x.setAttribute("data-rp", "rp-text-layer-text");
|
|
895
896
|
});
|
|
896
|
-
const
|
|
897
|
-
|
|
897
|
+
const b = (T = u.current) == null ? void 0 : T.textDivs;
|
|
898
|
+
b && m.current && _(m.current, b);
|
|
898
899
|
const v = document.createElement("div");
|
|
899
900
|
v.className = "endOfContent", (R = o.current) == null || R.appendChild(v);
|
|
900
901
|
}).catch(() => {
|
|
901
902
|
}), () => {
|
|
902
903
|
var c;
|
|
903
|
-
(c =
|
|
904
|
+
(c = u.current) == null || c.cancel();
|
|
904
905
|
};
|
|
905
906
|
}, [n, e]), z(() => {
|
|
906
907
|
var c;
|
|
907
|
-
[].slice.call(o.current.children).forEach((
|
|
908
|
-
|
|
908
|
+
[].slice.call(o.current.children).forEach((b) => {
|
|
909
|
+
b.classList.add(he["rp-text-layer-text"]);
|
|
909
910
|
});
|
|
910
|
-
const g = (c =
|
|
911
|
-
g && m.current &&
|
|
912
|
-
}, [
|
|
911
|
+
const g = (c = u.current) == null ? void 0 : c.textDivs;
|
|
912
|
+
g && m.current && _(m.current, g, !0);
|
|
913
|
+
}, [_]), /* @__PURE__ */ a(
|
|
913
914
|
"div",
|
|
914
915
|
{
|
|
915
916
|
"data-rp": `page-${e}-textLayer`,
|
|
@@ -924,30 +925,30 @@ const Ro = () => {
|
|
|
924
925
|
};
|
|
925
926
|
let Ao = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
926
927
|
const Fo = (t) => {
|
|
927
|
-
const { pageNumber: e } = t, n = $(null), { pages: o, pdf: r } = J(),
|
|
928
|
+
const { pageNumber: e } = t, n = $(null), { pages: o, pdf: r } = J(), i = $(), [s, l] = G(), { setFocusedPage: d, goToPage: u } = oe(), { scrollMode: m } = Ne(), { print: P } = tt(), { download: h } = qn(), _ = W(() => o.get(e), [o, e]), C = W(() => _ == null ? void 0 : _.page.getViewport(), [_]);
|
|
928
929
|
z(() => {
|
|
929
|
-
|
|
930
|
+
i.current && (i.current.div.replaceChildren(), i.current = void 0);
|
|
930
931
|
}, [r]), z(() => {
|
|
931
|
-
|
|
932
|
-
|
|
932
|
+
_ && _.page.getAnnotations().then((w) => {
|
|
933
|
+
i.current = void 0, l(w), n.current && (n.current.innerText = "");
|
|
933
934
|
});
|
|
934
|
-
}, [
|
|
935
|
+
}, [_]);
|
|
935
936
|
const y = E(
|
|
936
|
-
(
|
|
937
|
-
!s || !r || (zr(
|
|
937
|
+
(w) => {
|
|
938
|
+
!s || !r || (zr(w), Ar(w, r, s).then((S) => {
|
|
938
939
|
var f, p;
|
|
939
|
-
((f = S == null ? void 0 : S.data) == null ? void 0 : f.action) === "Print" ?
|
|
940
|
-
}), m === ne.PAGE_SCROLLING ? Ft(
|
|
940
|
+
((f = S == null ? void 0 : S.data) == null ? void 0 : f.action) === "Print" ? P() : ((p = S == null ? void 0 : S.data) == null ? void 0 : p.action) === "SaveAs" && h();
|
|
941
|
+
}), m === ne.PAGE_SCROLLING ? Ft(w, s, r, (S) => d(S.pageIndex + 1)) : Ft(w, s, r, (S) => u(S.pageIndex + 1)));
|
|
941
942
|
},
|
|
942
|
-
[r, s,
|
|
943
|
+
[r, s, u, d, m, P, h]
|
|
943
944
|
);
|
|
944
945
|
return z(() => {
|
|
945
|
-
if (!
|
|
946
|
+
if (!_ || !s)
|
|
946
947
|
return;
|
|
947
|
-
const
|
|
948
|
-
if (
|
|
949
|
-
|
|
950
|
-
viewport:
|
|
948
|
+
const w = _.page.getViewport();
|
|
949
|
+
if (i.current) {
|
|
950
|
+
i.current.update({
|
|
951
|
+
viewport: w.clone({ dontFlip: !0 })
|
|
951
952
|
});
|
|
952
953
|
return;
|
|
953
954
|
}
|
|
@@ -959,33 +960,33 @@ const Fo = (t) => {
|
|
|
959
960
|
kr(g);
|
|
960
961
|
break;
|
|
961
962
|
case At.Widget:
|
|
962
|
-
Fr(g,
|
|
963
|
+
Fr(g, w, S);
|
|
963
964
|
break;
|
|
964
965
|
}
|
|
965
966
|
}
|
|
966
967
|
const f = new AbortController();
|
|
967
968
|
return (async () => {
|
|
968
|
-
var
|
|
969
|
-
|
|
969
|
+
var b;
|
|
970
|
+
i.current && (i.current.div.replaceChildren(), i.current = void 0), n.current && (n.current.innerText = ""), i.current = new Or({
|
|
970
971
|
div: n.current,
|
|
971
972
|
accessibilityManager: void 0,
|
|
972
973
|
annotationCanvasMap: void 0,
|
|
973
974
|
annotationEditorUIManager: void 0,
|
|
974
975
|
structTreeLayer: null,
|
|
975
|
-
page:
|
|
976
|
-
viewport:
|
|
976
|
+
page: _.page,
|
|
977
|
+
viewport: w.clone({ dontFlip: !0 })
|
|
977
978
|
}), n.current && kt(n.current, y);
|
|
978
979
|
const g = await (r == null ? void 0 : r.hasJSActions()), c = await (r == null ? void 0 : r.getFieldObjects());
|
|
979
980
|
if (f.signal.aborted)
|
|
980
981
|
throw "abort";
|
|
981
|
-
return (
|
|
982
|
+
return (b = i.current) == null ? void 0 : b.render({
|
|
982
983
|
annotations: s,
|
|
983
984
|
annotationStorage: r == null ? void 0 : r.annotationStorage,
|
|
984
985
|
hasJSActions: g,
|
|
985
986
|
fieldObjects: c,
|
|
986
987
|
div: n.current,
|
|
987
|
-
viewport:
|
|
988
|
-
page:
|
|
988
|
+
viewport: w.clone({ dontFlip: !0 }),
|
|
989
|
+
page: _.page,
|
|
989
990
|
imageResourcesPath: Ao,
|
|
990
991
|
renderForms: !0,
|
|
991
992
|
linkService: new Dr(),
|
|
@@ -1000,7 +1001,7 @@ const Fo = (t) => {
|
|
|
1000
1001
|
}), () => {
|
|
1001
1002
|
f.abort("clear"), n.current && kt(n.current, y);
|
|
1002
1003
|
};
|
|
1003
|
-
}, [r, s, y]), /* @__PURE__ */
|
|
1004
|
+
}, [r, s, y]), /* @__PURE__ */ a(
|
|
1004
1005
|
"div",
|
|
1005
1006
|
{
|
|
1006
1007
|
"data-rp": `page-${e}-annotationLayer`,
|
|
@@ -1012,9 +1013,9 @@ const Fo = (t) => {
|
|
|
1012
1013
|
}, ko = {
|
|
1013
1014
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1014
1015
|
}, Wo = ({ pageNumber: t, viewport: e }) => {
|
|
1015
|
-
const [n, o] = G(), { pages: r } = J(), { highlightKeywords:
|
|
1016
|
+
const [n, o] = G(), { pages: r } = J(), { highlightKeywords: i } = fr(), s = !0, l = $(null), [d, u] = G(null), [m, P] = G([]);
|
|
1016
1017
|
z(() => {
|
|
1017
|
-
l.current &&
|
|
1018
|
+
l.current && u(l.current.parentElement);
|
|
1018
1019
|
}, [l]), z(() => {
|
|
1019
1020
|
(async () => {
|
|
1020
1021
|
const p = r.get(t);
|
|
@@ -1024,21 +1025,21 @@ const Fo = (t) => {
|
|
|
1024
1025
|
o(g);
|
|
1025
1026
|
})();
|
|
1026
1027
|
}, [r, t]);
|
|
1027
|
-
const h = W(() =>
|
|
1028
|
+
const h = W(() => i ? i.map((f) => {
|
|
1028
1029
|
var p, g;
|
|
1029
1030
|
return {
|
|
1030
1031
|
...Mr(f.keyword, (p = f.options) == null ? void 0 : p.matchCase, (g = f.options) == null ? void 0 : g.wholeWords),
|
|
1031
1032
|
color: f.highlightColor
|
|
1032
1033
|
};
|
|
1033
|
-
}) : [], [
|
|
1034
|
-
function
|
|
1034
|
+
}) : [], [i]);
|
|
1035
|
+
function _(f, p) {
|
|
1035
1036
|
if (!f)
|
|
1036
1037
|
return;
|
|
1037
1038
|
const g = `[data-rp="page-${p}-textLayer"]`;
|
|
1038
1039
|
return new Promise((c) => {
|
|
1039
|
-
const
|
|
1040
|
-
if (
|
|
1041
|
-
c(
|
|
1040
|
+
const b = f.querySelector(g);
|
|
1041
|
+
if (b) {
|
|
1042
|
+
c(b);
|
|
1042
1043
|
return;
|
|
1043
1044
|
}
|
|
1044
1045
|
new MutationObserver((T, R) => {
|
|
@@ -1056,7 +1057,7 @@ const Fo = (t) => {
|
|
|
1056
1057
|
p(Array.from(g));
|
|
1057
1058
|
return;
|
|
1058
1059
|
}
|
|
1059
|
-
new MutationObserver((
|
|
1060
|
+
new MutationObserver((b, v) => {
|
|
1060
1061
|
const T = f.querySelectorAll(
|
|
1061
1062
|
".rp-text-layer-text"
|
|
1062
1063
|
);
|
|
@@ -1066,15 +1067,15 @@ const Fo = (t) => {
|
|
|
1066
1067
|
}
|
|
1067
1068
|
const y = (f, p, g, c) => {
|
|
1068
1069
|
var H;
|
|
1069
|
-
const
|
|
1070
|
+
const b = document.createRange(), v = g.firstChild;
|
|
1070
1071
|
if (!v || v.nodeType !== Node.TEXT_NODE)
|
|
1071
1072
|
return null;
|
|
1072
1073
|
const T = ((H = v.textContent) == null ? void 0 : H.length) ?? 0, R = c[0].charIdxInSpan, x = c.length === 1 ? R : c[c.length - 1].charIdxInSpan;
|
|
1073
1074
|
if (R > T || x + 1 > T)
|
|
1074
1075
|
return null;
|
|
1075
|
-
|
|
1076
|
+
b.setStart(v, R), b.setEnd(v, x + 1);
|
|
1076
1077
|
const I = document.createElement("span");
|
|
1077
|
-
I.style.width = "auto",
|
|
1078
|
+
I.style.width = "auto", b.surroundContents(I);
|
|
1078
1079
|
const O = I.getBoundingClientRect(), A = f.getBoundingClientRect(), F = A.height, L = A.width, N = 100 * (O.left - A.left) / L, D = 100 * (O.top - A.top) / F, k = 100 * O.height / F, q = 100 * O.width / L;
|
|
1079
1080
|
return $r(I), {
|
|
1080
1081
|
keywordStr: p,
|
|
@@ -1086,13 +1087,13 @@ const Fo = (t) => {
|
|
|
1086
1087
|
pageWidth: L
|
|
1087
1088
|
};
|
|
1088
1089
|
};
|
|
1089
|
-
async function
|
|
1090
|
-
const g = await
|
|
1090
|
+
async function w(f, p) {
|
|
1091
|
+
const g = await _(d, f);
|
|
1091
1092
|
if (!g)
|
|
1092
1093
|
return;
|
|
1093
1094
|
const c = await C(g);
|
|
1094
1095
|
if (c.length) {
|
|
1095
|
-
const
|
|
1096
|
+
const b = c.map((T) => T.tagName === "BR" ? " " : T.textContent).reduce(
|
|
1096
1097
|
(T, R, x) => T.concat(
|
|
1097
1098
|
R.split("").map((I, O) => ({
|
|
1098
1099
|
char: I,
|
|
@@ -1107,13 +1108,13 @@ const Fo = (t) => {
|
|
|
1107
1108
|
spanIdx: 0
|
|
1108
1109
|
}
|
|
1109
1110
|
]
|
|
1110
|
-
).slice(1), v = S(g, p, c,
|
|
1111
|
-
|
|
1111
|
+
).slice(1), v = S(g, p, c, b);
|
|
1112
|
+
P(v);
|
|
1112
1113
|
}
|
|
1113
1114
|
}
|
|
1114
1115
|
const S = (f, p, g, c) => {
|
|
1115
|
-
const
|
|
1116
|
-
if (!c.length || !
|
|
1116
|
+
const b = p.length;
|
|
1117
|
+
if (!c.length || !b)
|
|
1117
1118
|
return [];
|
|
1118
1119
|
const v = [], T = c.map((R) => R.char).join("");
|
|
1119
1120
|
return h.forEach((R) => {
|
|
@@ -1159,14 +1160,14 @@ const Fo = (t) => {
|
|
|
1159
1160
|
};
|
|
1160
1161
|
return z(() => {
|
|
1161
1162
|
(async () => {
|
|
1162
|
-
if (!(!
|
|
1163
|
+
if (!(!i || i.length === 0))
|
|
1163
1164
|
try {
|
|
1164
|
-
await
|
|
1165
|
+
await w(t, i);
|
|
1165
1166
|
} catch (p) {
|
|
1166
1167
|
console.error(p);
|
|
1167
1168
|
}
|
|
1168
1169
|
})();
|
|
1169
|
-
}, [s,
|
|
1170
|
+
}, [s, i, t, n, e]), /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a("div", { ref: l, "data-rp": `page-${t}-textHighlightLayer`, children: m.map((f, p) => /* @__PURE__ */ a(
|
|
1170
1171
|
"div",
|
|
1171
1172
|
{
|
|
1172
1173
|
className: ko["rp-text-highlight"],
|
|
@@ -1181,37 +1182,37 @@ const Fo = (t) => {
|
|
|
1181
1182
|
p
|
|
1182
1183
|
)) }) });
|
|
1183
1184
|
}, Lt = Ve((t, e) => {
|
|
1184
|
-
const { pageNumber: n, style: o, ...r } = t, { pages:
|
|
1185
|
+
const { pageNumber: n, style: o, ...r } = t, { pages: i } = J(), { pageRotate: s } = Ue(), { textLayer: l } = ar(), { currentZoom: d } = Je(), u = $(i.get(n)), [m, P] = G(!1), h = $(null), [_, C] = G({
|
|
1185
1186
|
width: 0,
|
|
1186
1187
|
height: 0
|
|
1187
1188
|
});
|
|
1188
1189
|
cn(e, () => h.current);
|
|
1189
|
-
const y = W(() =>
|
|
1190
|
+
const y = W(() => u.current ? s[n] : 0, [n, s]);
|
|
1190
1191
|
z(() => {
|
|
1191
|
-
if (
|
|
1192
|
-
const p =
|
|
1193
|
-
scale:
|
|
1192
|
+
if (i && (u.current = i.get(n), u.current)) {
|
|
1193
|
+
const p = u.current.page.getViewport({
|
|
1194
|
+
scale: d,
|
|
1194
1195
|
rotation: y
|
|
1195
1196
|
});
|
|
1196
1197
|
C(p);
|
|
1197
1198
|
}
|
|
1198
|
-
}, [
|
|
1199
|
-
const
|
|
1199
|
+
}, [i, n, y, d]);
|
|
1200
|
+
const w = W(() => {
|
|
1200
1201
|
switch (y) {
|
|
1201
1202
|
case 90:
|
|
1202
|
-
return `${
|
|
1203
|
+
return `${_.width / 2}px ${_.width / 2}px`;
|
|
1203
1204
|
case -90:
|
|
1204
1205
|
case 270:
|
|
1205
|
-
return `${
|
|
1206
|
+
return `${_.height / 2}px ${_.height / 2}px`;
|
|
1206
1207
|
default:
|
|
1207
1208
|
return "center";
|
|
1208
1209
|
}
|
|
1209
|
-
}, [y,
|
|
1210
|
-
|
|
1210
|
+
}, [y, _]), S = E(() => {
|
|
1211
|
+
P(!0);
|
|
1211
1212
|
}, []), f = E(() => {
|
|
1212
|
-
|
|
1213
|
+
P(!1);
|
|
1213
1214
|
}, []);
|
|
1214
|
-
return /* @__PURE__ */
|
|
1215
|
+
return /* @__PURE__ */ a(
|
|
1215
1216
|
"div",
|
|
1216
1217
|
{
|
|
1217
1218
|
ref: h,
|
|
@@ -1221,25 +1222,25 @@ const Fo = (t) => {
|
|
|
1221
1222
|
style: {
|
|
1222
1223
|
...o,
|
|
1223
1224
|
"--rp-rotate": `${y}deg`,
|
|
1224
|
-
"--rp-page-rotate-translate": `${
|
|
1225
|
-
"--scale-factor":
|
|
1225
|
+
"--rp-page-rotate-translate": `${w}`,
|
|
1226
|
+
"--scale-factor": d
|
|
1226
1227
|
},
|
|
1227
1228
|
className: dt["rp-page-wrapper"],
|
|
1228
1229
|
children: /* @__PURE__ */ M(
|
|
1229
1230
|
"div",
|
|
1230
1231
|
{
|
|
1231
1232
|
style: {
|
|
1232
|
-
width: `${
|
|
1233
|
-
height: `${
|
|
1233
|
+
width: `${_.width}px`,
|
|
1234
|
+
height: `${_.height}px`
|
|
1234
1235
|
},
|
|
1235
1236
|
className: dt["rp-page"],
|
|
1236
1237
|
children: [
|
|
1237
|
-
/* @__PURE__ */
|
|
1238
|
-
m && /* @__PURE__ */
|
|
1239
|
-
/* @__PURE__ */
|
|
1240
|
-
l && /* @__PURE__ */
|
|
1241
|
-
/* @__PURE__ */
|
|
1242
|
-
/* @__PURE__ */
|
|
1238
|
+
/* @__PURE__ */ a(No, { onLoading: S, onLoaded: f, pageNumber: n }),
|
|
1239
|
+
m && /* @__PURE__ */ a("div", { className: dt["rp-loader-wrapper"], children: /* @__PURE__ */ a(Pt, {}) }),
|
|
1240
|
+
/* @__PURE__ */ a(Gr, { pageNumber: n }),
|
|
1241
|
+
l && /* @__PURE__ */ a(Do, { pageNumber: n }),
|
|
1242
|
+
/* @__PURE__ */ a(Wo, { pageNumber: n, viewport: _ }),
|
|
1243
|
+
/* @__PURE__ */ a(Fo, { pageNumber: n })
|
|
1243
1244
|
]
|
|
1244
1245
|
}
|
|
1245
1246
|
)
|
|
@@ -1285,11 +1286,11 @@ function $o(t, e) {
|
|
|
1285
1286
|
}
|
|
1286
1287
|
function ut(t, e) {
|
|
1287
1288
|
e === void 0 && (e = $o);
|
|
1288
|
-
var n, o = [], r,
|
|
1289
|
+
var n, o = [], r, i = !1;
|
|
1289
1290
|
function s() {
|
|
1290
|
-
for (var l = [],
|
|
1291
|
-
l[
|
|
1292
|
-
return
|
|
1291
|
+
for (var l = [], d = 0; d < arguments.length; d++)
|
|
1292
|
+
l[d] = arguments[d];
|
|
1293
|
+
return i && n === this && e(l, o) || (r = t.apply(this, l), i = !0, n = this, o = l), r;
|
|
1293
1294
|
}
|
|
1294
1295
|
return s;
|
|
1295
1296
|
}
|
|
@@ -1349,7 +1350,7 @@ var Vo = 150, Bo = function(e) {
|
|
|
1349
1350
|
}, je = null, Ke = null, Xe = null;
|
|
1350
1351
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (je = /* @__PURE__ */ new WeakSet(), Ke = /* @__PURE__ */ new WeakSet(), Xe = /* @__PURE__ */ new WeakSet());
|
|
1351
1352
|
function Zo(t) {
|
|
1352
|
-
var e, n = t.getColumnOffset, o = t.getColumnStartIndexForOffset, r = t.getColumnStopIndexForStartIndex,
|
|
1353
|
+
var e, n = t.getColumnOffset, o = t.getColumnStartIndexForOffset, r = t.getColumnStopIndexForStartIndex, i = t.getColumnWidth, s = t.getEstimatedTotalHeight, l = t.getEstimatedTotalWidth, d = t.getOffsetForColumnAndAlignment, u = t.getOffsetForRowAndAlignment, m = t.getRowHeight, P = t.getRowOffset, h = t.getRowStartIndexForOffset, _ = t.getRowStopIndexForStartIndex, C = t.initInstanceProps, y = t.shouldResetStyleCacheOnItemSizeChange, w = t.validateProps;
|
|
1353
1354
|
return e = /* @__PURE__ */ function(S) {
|
|
1354
1355
|
Mo(f, S);
|
|
1355
1356
|
function f(g) {
|
|
@@ -1362,9 +1363,9 @@ function Zo(t) {
|
|
|
1362
1363
|
scrollTop: typeof c.props.initialScrollTop == "number" ? c.props.initialScrollTop : 0,
|
|
1363
1364
|
scrollUpdateWasRequested: !1,
|
|
1364
1365
|
verticalScrollDirection: "forward"
|
|
1365
|
-
}, c._callOnItemsRendered = void 0, c._callOnItemsRendered = ut(function(
|
|
1366
|
+
}, c._callOnItemsRendered = void 0, c._callOnItemsRendered = ut(function(b, v, T, R, x, I, O, A) {
|
|
1366
1367
|
return c.props.onItemsRendered({
|
|
1367
|
-
overscanColumnStartIndex:
|
|
1368
|
+
overscanColumnStartIndex: b,
|
|
1368
1369
|
overscanColumnStopIndex: v,
|
|
1369
1370
|
overscanRowStartIndex: T,
|
|
1370
1371
|
overscanRowStopIndex: R,
|
|
@@ -1373,16 +1374,16 @@ function Zo(t) {
|
|
|
1373
1374
|
visibleRowStartIndex: O,
|
|
1374
1375
|
visibleRowStopIndex: A
|
|
1375
1376
|
});
|
|
1376
|
-
}), c._callOnScroll = void 0, c._callOnScroll = ut(function(
|
|
1377
|
+
}), c._callOnScroll = void 0, c._callOnScroll = ut(function(b, v, T, R, x) {
|
|
1377
1378
|
return c.props.onScroll({
|
|
1378
1379
|
horizontalScrollDirection: T,
|
|
1379
|
-
scrollLeft:
|
|
1380
|
+
scrollLeft: b,
|
|
1380
1381
|
scrollTop: v,
|
|
1381
1382
|
verticalScrollDirection: R,
|
|
1382
1383
|
scrollUpdateWasRequested: x
|
|
1383
1384
|
});
|
|
1384
|
-
}), c._getItemStyle = void 0, c._getItemStyle = function(
|
|
1385
|
-
var T = c.props, R = T.columnWidth, x = T.direction, I = T.rowHeight, O = c._getItemStyleCache(y && R, y && x, y && I), A =
|
|
1385
|
+
}), c._getItemStyle = void 0, c._getItemStyle = function(b, v) {
|
|
1386
|
+
var T = c.props, R = T.columnWidth, x = T.direction, I = T.rowHeight, O = c._getItemStyleCache(y && R, y && x, y && I), A = b + ":" + v, F;
|
|
1386
1387
|
if (O.hasOwnProperty(A))
|
|
1387
1388
|
F = O[A];
|
|
1388
1389
|
else {
|
|
@@ -1391,16 +1392,16 @@ function Zo(t) {
|
|
|
1391
1392
|
position: "absolute",
|
|
1392
1393
|
left: N ? void 0 : L,
|
|
1393
1394
|
right: N ? L : void 0,
|
|
1394
|
-
top:
|
|
1395
|
-
height: m(c.props,
|
|
1396
|
-
width:
|
|
1395
|
+
top: P(c.props, b, c._instanceProps),
|
|
1396
|
+
height: m(c.props, b, c._instanceProps),
|
|
1397
|
+
width: i(c.props, v, c._instanceProps)
|
|
1397
1398
|
};
|
|
1398
1399
|
}
|
|
1399
1400
|
return F;
|
|
1400
|
-
}, c._getItemStyleCache = void 0, c._getItemStyleCache = ut(function(
|
|
1401
|
+
}, c._getItemStyleCache = void 0, c._getItemStyleCache = ut(function(b, v, T) {
|
|
1401
1402
|
return {};
|
|
1402
|
-
}), c._onScroll = function(
|
|
1403
|
-
var v =
|
|
1403
|
+
}), c._onScroll = function(b) {
|
|
1404
|
+
var v = b.currentTarget, T = v.clientHeight, R = v.clientWidth, x = v.scrollLeft, I = v.scrollTop, O = v.scrollHeight, A = v.scrollWidth;
|
|
1404
1405
|
c.setState(function(F) {
|
|
1405
1406
|
if (F.scrollLeft === x && F.scrollTop === I)
|
|
1406
1407
|
return null;
|
|
@@ -1425,9 +1426,9 @@ function Zo(t) {
|
|
|
1425
1426
|
scrollUpdateWasRequested: !1
|
|
1426
1427
|
};
|
|
1427
1428
|
}, c._resetIsScrollingDebounced);
|
|
1428
|
-
}, c._outerRefSetter = function(
|
|
1429
|
+
}, c._outerRefSetter = function(b) {
|
|
1429
1430
|
var v = c.props.outerRef;
|
|
1430
|
-
c._outerRef =
|
|
1431
|
+
c._outerRef = b, typeof v == "function" ? v(b) : v != null && typeof v == "object" && v.hasOwnProperty("current") && (v.current = b);
|
|
1431
1432
|
}, c._resetIsScrollingDebounced = function() {
|
|
1432
1433
|
c._resetIsScrollingTimeoutId !== null && Zt(c._resetIsScrollingTimeoutId), c._resetIsScrollingTimeoutId = qo(c._resetIsScrolling, Vo);
|
|
1433
1434
|
}, c._resetIsScrolling = function() {
|
|
@@ -1438,38 +1439,38 @@ function Zo(t) {
|
|
|
1438
1439
|
});
|
|
1439
1440
|
}, c;
|
|
1440
1441
|
}
|
|
1441
|
-
f.getDerivedStateFromProps = function(c,
|
|
1442
|
-
return jo(c,
|
|
1442
|
+
f.getDerivedStateFromProps = function(c, b) {
|
|
1443
|
+
return jo(c, b), w(c), null;
|
|
1443
1444
|
};
|
|
1444
1445
|
var p = f.prototype;
|
|
1445
1446
|
return p.scrollTo = function(c) {
|
|
1446
|
-
var
|
|
1447
|
-
|
|
1448
|
-
return
|
|
1449
|
-
horizontalScrollDirection: T.scrollLeft <
|
|
1450
|
-
scrollLeft:
|
|
1447
|
+
var b = c.scrollLeft, v = c.scrollTop;
|
|
1448
|
+
b !== void 0 && (b = Math.max(0, b)), v !== void 0 && (v = Math.max(0, v)), this.setState(function(T) {
|
|
1449
|
+
return b === void 0 && (b = T.scrollLeft), v === void 0 && (v = T.scrollTop), T.scrollLeft === b && T.scrollTop === v ? null : {
|
|
1450
|
+
horizontalScrollDirection: T.scrollLeft < b ? "forward" : "backward",
|
|
1451
|
+
scrollLeft: b,
|
|
1451
1452
|
scrollTop: v,
|
|
1452
1453
|
scrollUpdateWasRequested: !0,
|
|
1453
1454
|
verticalScrollDirection: T.scrollTop < v ? "forward" : "backward"
|
|
1454
1455
|
};
|
|
1455
1456
|
}, this._resetIsScrollingDebounced);
|
|
1456
1457
|
}, p.scrollToItem = function(c) {
|
|
1457
|
-
var
|
|
1458
|
+
var b = c.align, v = b === void 0 ? "auto" : b, T = c.columnIndex, R = c.rowIndex, x = this.props, I = x.columnCount, O = x.height, A = x.rowCount, F = x.width, L = this.state, N = L.scrollLeft, D = L.scrollTop, k = Uo();
|
|
1458
1459
|
T !== void 0 && (T = Math.max(0, Math.min(T, I - 1))), R !== void 0 && (R = Math.max(0, Math.min(R, A - 1)));
|
|
1459
1460
|
var q = s(this.props, this._instanceProps), H = l(this.props, this._instanceProps), U = H > F ? k : 0, V = q > O ? k : 0;
|
|
1460
1461
|
this.scrollTo({
|
|
1461
|
-
scrollLeft: T !== void 0 ?
|
|
1462
|
-
scrollTop: R !== void 0 ?
|
|
1462
|
+
scrollLeft: T !== void 0 ? d(this.props, T, v, N, this._instanceProps, V) : N,
|
|
1463
|
+
scrollTop: R !== void 0 ? u(this.props, R, v, D, this._instanceProps, U) : D
|
|
1463
1464
|
});
|
|
1464
1465
|
}, p.componentDidMount = function() {
|
|
1465
|
-
var c = this.props,
|
|
1466
|
+
var c = this.props, b = c.initialScrollLeft, v = c.initialScrollTop;
|
|
1466
1467
|
if (this._outerRef != null) {
|
|
1467
1468
|
var T = this._outerRef;
|
|
1468
|
-
typeof
|
|
1469
|
+
typeof b == "number" && (T.scrollLeft = b), typeof v == "number" && (T.scrollTop = v);
|
|
1469
1470
|
}
|
|
1470
1471
|
this._callPropsCallbacks();
|
|
1471
1472
|
}, p.componentDidUpdate = function() {
|
|
1472
|
-
var c = this.props.direction,
|
|
1473
|
+
var c = this.props.direction, b = this.state, v = b.scrollLeft, T = b.scrollTop, R = b.scrollUpdateWasRequested;
|
|
1473
1474
|
if (R && this._outerRef != null) {
|
|
1474
1475
|
var x = this._outerRef;
|
|
1475
1476
|
if (c === "rtl")
|
|
@@ -1493,11 +1494,11 @@ function Zo(t) {
|
|
|
1493
1494
|
}, p.componentWillUnmount = function() {
|
|
1494
1495
|
this._resetIsScrollingTimeoutId !== null && Zt(this._resetIsScrollingTimeoutId);
|
|
1495
1496
|
}, p.render = function() {
|
|
1496
|
-
var c = this.props,
|
|
1497
|
+
var c = this.props, b = c.children, v = c.className, T = c.columnCount, R = c.direction, x = c.height, I = c.innerRef, O = c.innerElementType, A = c.innerTagName, F = c.itemData, L = c.itemKey, N = L === void 0 ? Bo : L, D = c.outerElementType, k = c.outerTagName, q = c.rowCount, H = c.style, U = c.useIsScrolling, V = c.width, K = this.state.isScrolling, X = this._getHorizontalRangeToRender(), Q = X[0], le = X[1], de = this._getVerticalRangeToRender(), ee = de[0], Fe = de[1], we = [];
|
|
1497
1498
|
if (T > 0 && q)
|
|
1498
1499
|
for (var Te = ee; Te <= Fe; Te++)
|
|
1499
1500
|
for (var _e = Q; _e <= le; _e++)
|
|
1500
|
-
we.push(Ze(
|
|
1501
|
+
we.push(Ze(b, {
|
|
1501
1502
|
columnIndex: _e,
|
|
1502
1503
|
data: F,
|
|
1503
1504
|
isScrolling: U ? K : void 0,
|
|
@@ -1533,8 +1534,8 @@ function Zo(t) {
|
|
|
1533
1534
|
}
|
|
1534
1535
|
}));
|
|
1535
1536
|
}, p._callPropsCallbacks = function() {
|
|
1536
|
-
var c = this.props,
|
|
1537
|
-
if (typeof v == "function" &&
|
|
1537
|
+
var c = this.props, b = c.columnCount, v = c.onItemsRendered, T = c.onScroll, R = c.rowCount;
|
|
1538
|
+
if (typeof v == "function" && b > 0 && R > 0) {
|
|
1538
1539
|
var x = this._getHorizontalRangeToRender(), I = x[0], O = x[1], A = x[2], F = x[3], L = this._getVerticalRangeToRender(), N = L[0], D = L[1], k = L[2], q = L[3];
|
|
1539
1540
|
this._callOnItemsRendered(I, O, N, D, A, F, k, q);
|
|
1540
1541
|
}
|
|
@@ -1543,16 +1544,16 @@ function Zo(t) {
|
|
|
1543
1544
|
this._callOnScroll(V, K, U, Q, X);
|
|
1544
1545
|
}
|
|
1545
1546
|
}, p._getHorizontalRangeToRender = function() {
|
|
1546
|
-
var c = this.props,
|
|
1547
|
-
if (
|
|
1547
|
+
var c = this.props, b = c.columnCount, v = c.overscanColumnCount, T = c.overscanColumnsCount, R = c.overscanCount, x = c.rowCount, I = this.state, O = I.horizontalScrollDirection, A = I.isScrolling, F = I.scrollLeft, L = v || T || R || 1;
|
|
1548
|
+
if (b === 0 || x === 0)
|
|
1548
1549
|
return [0, 0, 0, 0];
|
|
1549
1550
|
var N = o(this.props, F, this._instanceProps), D = r(this.props, N, F, this._instanceProps), k = !A || O === "backward" ? Math.max(1, L) : 1, q = !A || O === "forward" ? Math.max(1, L) : 1;
|
|
1550
|
-
return [Math.max(0, N - k), Math.max(0, Math.min(
|
|
1551
|
+
return [Math.max(0, N - k), Math.max(0, Math.min(b - 1, D + q)), N, D];
|
|
1551
1552
|
}, p._getVerticalRangeToRender = function() {
|
|
1552
|
-
var c = this.props,
|
|
1553
|
-
if (
|
|
1553
|
+
var c = this.props, b = c.columnCount, v = c.overscanCount, T = c.overscanRowCount, R = c.overscanRowsCount, x = c.rowCount, I = this.state, O = I.isScrolling, A = I.verticalScrollDirection, F = I.scrollTop, L = T || R || v || 1;
|
|
1554
|
+
if (b === 0 || x === 0)
|
|
1554
1555
|
return [0, 0, 0, 0];
|
|
1555
|
-
var N = h(this.props, F, this._instanceProps), D =
|
|
1556
|
+
var N = h(this.props, F, this._instanceProps), D = _(this.props, N, F, this._instanceProps), k = !O || A === "backward" ? Math.max(1, L) : 1, q = !O || A === "forward" ? Math.max(1, L) : 1;
|
|
1556
1557
|
return [Math.max(0, N - k), Math.max(0, Math.min(x - 1, D + q)), N, D];
|
|
1557
1558
|
}, f;
|
|
1558
1559
|
}(tr), e.defaultProps = {
|
|
@@ -1562,9 +1563,9 @@ function Zo(t) {
|
|
|
1562
1563
|
}, e;
|
|
1563
1564
|
}
|
|
1564
1565
|
var jo = function(e, n) {
|
|
1565
|
-
var o = e.children, r = e.direction,
|
|
1566
|
+
var o = e.children, r = e.direction, i = e.height, s = e.innerTagName, l = e.outerTagName, d = e.overscanColumnsCount, u = e.overscanCount, m = e.overscanRowsCount, P = e.width, h = n.instance;
|
|
1566
1567
|
if (process.env.NODE_ENV !== "production") {
|
|
1567
|
-
if (typeof
|
|
1568
|
+
if (typeof u == "number" && je && !je.has(h) && (je.add(h), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof d == "number" || typeof m == "number") && Ke && !Ke.has(h) && (Ke.add(h), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (s != null || l != null) && Xe && !Xe.has(h) && (Xe.add(h), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), o == null)
|
|
1568
1569
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
1569
1570
|
switch (r) {
|
|
1570
1571
|
case "ltr":
|
|
@@ -1573,74 +1574,74 @@ var jo = function(e, n) {
|
|
|
1573
1574
|
default:
|
|
1574
1575
|
throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + r + '" was specified.'));
|
|
1575
1576
|
}
|
|
1576
|
-
if (typeof
|
|
1577
|
-
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (
|
|
1578
|
-
if (typeof
|
|
1579
|
-
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (
|
|
1577
|
+
if (typeof P != "number")
|
|
1578
|
+
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (P === null ? "null" : typeof P) + '" was specified.'));
|
|
1579
|
+
if (typeof i != "number")
|
|
1580
|
+
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (i === null ? "null" : typeof i) + '" was specified.'));
|
|
1580
1581
|
}
|
|
1581
1582
|
}, Kt = 50, Sn = function(e, n) {
|
|
1582
|
-
var o = e.rowCount, r = n.rowMetadataMap,
|
|
1583
|
+
var o = e.rowCount, r = n.rowMetadataMap, i = n.estimatedRowHeight, s = n.lastMeasuredRowIndex, l = 0;
|
|
1583
1584
|
if (s >= o && (s = o - 1), s >= 0) {
|
|
1584
|
-
var
|
|
1585
|
-
l =
|
|
1585
|
+
var d = r[s];
|
|
1586
|
+
l = d.offset + d.size;
|
|
1586
1587
|
}
|
|
1587
|
-
var
|
|
1588
|
+
var u = o - s - 1, m = u * i;
|
|
1588
1589
|
return l + m;
|
|
1589
1590
|
}, xn = function(e, n) {
|
|
1590
|
-
var o = e.columnCount, r = n.columnMetadataMap,
|
|
1591
|
+
var o = e.columnCount, r = n.columnMetadataMap, i = n.estimatedColumnWidth, s = n.lastMeasuredColumnIndex, l = 0;
|
|
1591
1592
|
if (s >= o && (s = o - 1), s >= 0) {
|
|
1592
|
-
var
|
|
1593
|
-
l =
|
|
1593
|
+
var d = r[s];
|
|
1594
|
+
l = d.offset + d.size;
|
|
1594
1595
|
}
|
|
1595
|
-
var
|
|
1596
|
+
var u = o - s - 1, m = u * i;
|
|
1596
1597
|
return l + m;
|
|
1597
1598
|
}, fe = function(e, n, o, r) {
|
|
1598
|
-
var
|
|
1599
|
-
if (e === "column" ? (
|
|
1600
|
-
var
|
|
1599
|
+
var i, s, l;
|
|
1600
|
+
if (e === "column" ? (i = r.columnMetadataMap, s = n.columnWidth, l = r.lastMeasuredColumnIndex) : (i = r.rowMetadataMap, s = n.rowHeight, l = r.lastMeasuredRowIndex), o > l) {
|
|
1601
|
+
var d = 0;
|
|
1601
1602
|
if (l >= 0) {
|
|
1602
|
-
var
|
|
1603
|
-
|
|
1603
|
+
var u = i[l];
|
|
1604
|
+
d = u.offset + u.size;
|
|
1604
1605
|
}
|
|
1605
1606
|
for (var m = l + 1; m <= o; m++) {
|
|
1606
|
-
var
|
|
1607
|
-
|
|
1608
|
-
offset:
|
|
1609
|
-
size:
|
|
1610
|
-
},
|
|
1607
|
+
var P = s(m);
|
|
1608
|
+
i[m] = {
|
|
1609
|
+
offset: d,
|
|
1610
|
+
size: P
|
|
1611
|
+
}, d += P;
|
|
1611
1612
|
}
|
|
1612
1613
|
e === "column" ? r.lastMeasuredColumnIndex = o : r.lastMeasuredRowIndex = o;
|
|
1613
1614
|
}
|
|
1614
|
-
return
|
|
1615
|
+
return i[o];
|
|
1615
1616
|
}, Xt = function(e, n, o, r) {
|
|
1616
|
-
var
|
|
1617
|
-
e === "column" ? (
|
|
1618
|
-
var l = s > 0 ?
|
|
1617
|
+
var i, s;
|
|
1618
|
+
e === "column" ? (i = o.columnMetadataMap, s = o.lastMeasuredColumnIndex) : (i = o.rowMetadataMap, s = o.lastMeasuredRowIndex);
|
|
1619
|
+
var l = s > 0 ? i[s].offset : 0;
|
|
1619
1620
|
return l >= r ? In(e, n, o, s, 0, r) : Ko(e, n, o, Math.max(0, s), r);
|
|
1620
|
-
}, In = function(e, n, o, r,
|
|
1621
|
-
for (;
|
|
1622
|
-
var l =
|
|
1623
|
-
if (
|
|
1621
|
+
}, In = function(e, n, o, r, i, s) {
|
|
1622
|
+
for (; i <= r; ) {
|
|
1623
|
+
var l = i + Math.floor((r - i) / 2), d = fe(e, n, l, o).offset;
|
|
1624
|
+
if (d === s)
|
|
1624
1625
|
return l;
|
|
1625
|
-
|
|
1626
|
+
d < s ? i = l + 1 : d > s && (r = l - 1);
|
|
1626
1627
|
}
|
|
1627
|
-
return
|
|
1628
|
-
}, Ko = function(e, n, o, r,
|
|
1629
|
-
for (var s = e === "column" ? n.columnCount : n.rowCount, l = 1; r < s && fe(e, n, r, o).offset <
|
|
1628
|
+
return i > 0 ? i - 1 : 0;
|
|
1629
|
+
}, Ko = function(e, n, o, r, i) {
|
|
1630
|
+
for (var s = e === "column" ? n.columnCount : n.rowCount, l = 1; r < s && fe(e, n, r, o).offset < i; )
|
|
1630
1631
|
r += l, l *= 2;
|
|
1631
|
-
return In(e, n, o, Math.min(r, s - 1), Math.floor(r / 2),
|
|
1632
|
-
}, Qt = function(e, n, o, r,
|
|
1633
|
-
var
|
|
1634
|
-
switch (r === "smart" && (
|
|
1632
|
+
return In(e, n, o, Math.min(r, s - 1), Math.floor(r / 2), i);
|
|
1633
|
+
}, Qt = function(e, n, o, r, i, s, l) {
|
|
1634
|
+
var d = e === "column" ? n.width : n.height, u = fe(e, n, o, s), m = e === "column" ? xn(n, s) : Sn(n, s), P = Math.max(0, Math.min(m - d, u.offset)), h = Math.max(0, u.offset - d + l + u.size);
|
|
1635
|
+
switch (r === "smart" && (i >= h - d && i <= P + d ? r = "auto" : r = "center"), r) {
|
|
1635
1636
|
case "start":
|
|
1636
|
-
return
|
|
1637
|
+
return P;
|
|
1637
1638
|
case "end":
|
|
1638
1639
|
return h;
|
|
1639
1640
|
case "center":
|
|
1640
|
-
return Math.round(h + (
|
|
1641
|
+
return Math.round(h + (P - h) / 2);
|
|
1641
1642
|
case "auto":
|
|
1642
1643
|
default:
|
|
1643
|
-
return
|
|
1644
|
+
return i >= h && i <= P ? i : h > P || i < h ? h : P;
|
|
1644
1645
|
}
|
|
1645
1646
|
}, Xo = /* @__PURE__ */ Zo({
|
|
1646
1647
|
getColumnOffset: function(e, n, o) {
|
|
@@ -1650,8 +1651,8 @@ var jo = function(e, n) {
|
|
|
1650
1651
|
return Xt("column", e, o, n);
|
|
1651
1652
|
},
|
|
1652
1653
|
getColumnStopIndexForStartIndex: function(e, n, o, r) {
|
|
1653
|
-
for (var
|
|
1654
|
-
m++,
|
|
1654
|
+
for (var i = e.columnCount, s = e.width, l = fe("column", e, n, r), d = o + s, u = l.offset + l.size, m = n; m < i - 1 && u < d; )
|
|
1655
|
+
m++, u += fe("column", e, m, r).size;
|
|
1655
1656
|
return m;
|
|
1656
1657
|
},
|
|
1657
1658
|
getColumnWidth: function(e, n, o) {
|
|
@@ -1659,11 +1660,11 @@ var jo = function(e, n) {
|
|
|
1659
1660
|
},
|
|
1660
1661
|
getEstimatedTotalHeight: Sn,
|
|
1661
1662
|
getEstimatedTotalWidth: xn,
|
|
1662
|
-
getOffsetForColumnAndAlignment: function(e, n, o, r,
|
|
1663
|
-
return Qt("column", e, n, o, r,
|
|
1663
|
+
getOffsetForColumnAndAlignment: function(e, n, o, r, i, s) {
|
|
1664
|
+
return Qt("column", e, n, o, r, i, s);
|
|
1664
1665
|
},
|
|
1665
|
-
getOffsetForRowAndAlignment: function(e, n, o, r,
|
|
1666
|
-
return Qt("row", e, n, o, r,
|
|
1666
|
+
getOffsetForRowAndAlignment: function(e, n, o, r, i, s) {
|
|
1667
|
+
return Qt("row", e, n, o, r, i, s);
|
|
1667
1668
|
},
|
|
1668
1669
|
getRowOffset: function(e, n, o) {
|
|
1669
1670
|
return fe("row", e, n, o).offset;
|
|
@@ -1675,32 +1676,32 @@ var jo = function(e, n) {
|
|
|
1675
1676
|
return Xt("row", e, o, n);
|
|
1676
1677
|
},
|
|
1677
1678
|
getRowStopIndexForStartIndex: function(e, n, o, r) {
|
|
1678
|
-
for (var
|
|
1679
|
-
m++,
|
|
1679
|
+
for (var i = e.rowCount, s = e.height, l = fe("row", e, n, r), d = o + s, u = l.offset + l.size, m = n; m < i - 1 && u < d; )
|
|
1680
|
+
m++, u += fe("row", e, m, r).size;
|
|
1680
1681
|
return m;
|
|
1681
1682
|
},
|
|
1682
1683
|
initInstanceProps: function(e, n) {
|
|
1683
|
-
var o = e, r = o.estimatedColumnWidth,
|
|
1684
|
+
var o = e, r = o.estimatedColumnWidth, i = o.estimatedRowHeight, s = {
|
|
1684
1685
|
columnMetadataMap: {},
|
|
1685
1686
|
estimatedColumnWidth: r || Kt,
|
|
1686
|
-
estimatedRowHeight:
|
|
1687
|
+
estimatedRowHeight: i || Kt,
|
|
1687
1688
|
lastMeasuredColumnIndex: -1,
|
|
1688
1689
|
lastMeasuredRowIndex: -1,
|
|
1689
1690
|
rowMetadataMap: {}
|
|
1690
1691
|
};
|
|
1691
|
-
return n.resetAfterColumnIndex = function(l,
|
|
1692
|
-
|
|
1692
|
+
return n.resetAfterColumnIndex = function(l, d) {
|
|
1693
|
+
d === void 0 && (d = !0), n.resetAfterIndices({
|
|
1693
1694
|
columnIndex: l,
|
|
1694
|
-
shouldForceUpdate:
|
|
1695
|
+
shouldForceUpdate: d
|
|
1695
1696
|
});
|
|
1696
|
-
}, n.resetAfterRowIndex = function(l,
|
|
1697
|
-
|
|
1697
|
+
}, n.resetAfterRowIndex = function(l, d) {
|
|
1698
|
+
d === void 0 && (d = !0), n.resetAfterIndices({
|
|
1698
1699
|
rowIndex: l,
|
|
1699
|
-
shouldForceUpdate:
|
|
1700
|
+
shouldForceUpdate: d
|
|
1700
1701
|
});
|
|
1701
1702
|
}, n.resetAfterIndices = function(l) {
|
|
1702
|
-
var
|
|
1703
|
-
typeof
|
|
1703
|
+
var d = l.columnIndex, u = l.rowIndex, m = l.shouldForceUpdate, P = m === void 0 ? !0 : m;
|
|
1704
|
+
typeof d == "number" && (s.lastMeasuredColumnIndex = Math.min(s.lastMeasuredColumnIndex, d - 1)), typeof u == "number" && (s.lastMeasuredRowIndex = Math.min(s.lastMeasuredRowIndex, u - 1)), n._getItemStyleCache(-1), P && n.forceUpdate();
|
|
1704
1705
|
}, s;
|
|
1705
1706
|
},
|
|
1706
1707
|
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
@@ -1726,23 +1727,23 @@ function Yt(t, e) {
|
|
|
1726
1727
|
}
|
|
1727
1728
|
var Qo = ["style"], Yo = ["style"];
|
|
1728
1729
|
function Jo(t, e) {
|
|
1729
|
-
var n = t.style, o = Vt(t, Qo), r = e.style,
|
|
1730
|
-
return !Yt(n, r) && !Yt(o,
|
|
1730
|
+
var n = t.style, o = Vt(t, Qo), r = e.style, i = Vt(e, Yo);
|
|
1731
|
+
return !Yt(n, r) && !Yt(o, i);
|
|
1731
1732
|
}
|
|
1732
1733
|
const ei = () => {
|
|
1733
|
-
const { viewMode: t } = Oe(), { scrollMode: e } = Ne(), { setColumnCount: n } = un(), { virtualScrollableElementRef: o } = et(), r = qe(),
|
|
1734
|
-
const S =
|
|
1734
|
+
const { viewMode: t } = Oe(), { scrollMode: e } = Ne(), { setColumnCount: n } = un(), { virtualScrollableElementRef: o } = et(), r = qe(), i = W(() => r.heights.length, [r.heights]), s = W(() => e === ne.HORIZONTAL_SCROLLING ? i : t === Le.DUAL_PAGE ? 2 : 1, [t, e, e, i, o]), l = W(() => r.widths.reduce((C, y, w) => {
|
|
1735
|
+
const S = w % s;
|
|
1735
1736
|
return (!C[S] || y > C[S]) && (C[S] = y), C;
|
|
1736
|
-
}, []), [r.widths, s]),
|
|
1737
|
-
(
|
|
1738
|
-
const C =
|
|
1737
|
+
}, []), [r.widths, s]), d = E(
|
|
1738
|
+
(_) => {
|
|
1739
|
+
const C = _ % l.length;
|
|
1739
1740
|
return l[C] || 0;
|
|
1740
1741
|
},
|
|
1741
1742
|
[l]
|
|
1742
|
-
),
|
|
1743
|
-
(
|
|
1744
|
-
const C = Array.from({ length: s }, (y,
|
|
1745
|
-
const S =
|
|
1743
|
+
), u = E(
|
|
1744
|
+
(_) => {
|
|
1745
|
+
const C = Array.from({ length: s }, (y, w) => {
|
|
1746
|
+
const S = _ * s + w;
|
|
1746
1747
|
return r.heights[S] || 0;
|
|
1747
1748
|
});
|
|
1748
1749
|
return Math.max(...C);
|
|
@@ -1752,14 +1753,14 @@ const ei = () => {
|
|
|
1752
1753
|
z(() => {
|
|
1753
1754
|
n(s);
|
|
1754
1755
|
}, [s, n]);
|
|
1755
|
-
const m = W(() => e === ne.HORIZONTAL_SCROLLING || e === ne.PAGE_SCROLLING ? 1 : Math.round(
|
|
1756
|
+
const m = W(() => e === ne.HORIZONTAL_SCROLLING || e === ne.PAGE_SCROLLING ? 1 : Math.round(i / s), [s, i, e]), P = W(() => r.heights.reduce((_, C) => _ + C, 0) / r.heights.length || 0, [r]), h = W(() => r.widths.reduce((_, C) => _ + C, 0) / r.heights.length || 0, [r]);
|
|
1756
1757
|
return {
|
|
1757
1758
|
rowCount: m,
|
|
1758
|
-
rowHeight:
|
|
1759
|
+
rowHeight: u,
|
|
1759
1760
|
columnCount: s,
|
|
1760
|
-
columnWidth:
|
|
1761
|
+
columnWidth: d,
|
|
1761
1762
|
pageDimension: r,
|
|
1762
|
-
estimatedRowHeight:
|
|
1763
|
+
estimatedRowHeight: P,
|
|
1763
1764
|
estimatedColumnWidth: h
|
|
1764
1765
|
};
|
|
1765
1766
|
};
|
|
@@ -1780,68 +1781,68 @@ ft == null || tn == null ? (bt = ht, Ct = function(e) {
|
|
|
1780
1781
|
return [n, o];
|
|
1781
1782
|
});
|
|
1782
1783
|
function ti(t) {
|
|
1783
|
-
let e, n, o, r,
|
|
1784
|
-
const
|
|
1785
|
-
if (!
|
|
1784
|
+
let e, n, o, r, i, s, l;
|
|
1785
|
+
const d = typeof document < "u" && document.attachEvent;
|
|
1786
|
+
if (!d) {
|
|
1786
1787
|
s = function(S) {
|
|
1787
1788
|
const f = S.__resizeTriggers__, p = f.firstElementChild, g = f.lastElementChild, c = p.firstElementChild;
|
|
1788
1789
|
g.scrollLeft = g.scrollWidth, g.scrollTop = g.scrollHeight, c.style.width = p.offsetWidth + 1 + "px", c.style.height = p.offsetHeight + 1 + "px", p.scrollLeft = p.scrollWidth, p.scrollTop = p.scrollHeight;
|
|
1789
|
-
},
|
|
1790
|
+
}, i = function(S) {
|
|
1790
1791
|
return S.offsetWidth !== S.__resizeLast__.width || S.offsetHeight !== S.__resizeLast__.height;
|
|
1791
1792
|
}, l = function(S) {
|
|
1792
1793
|
if (S.target.className && typeof S.target.className.indexOf == "function" && S.target.className.indexOf("contract-trigger") < 0 && S.target.className.indexOf("expand-trigger") < 0)
|
|
1793
1794
|
return;
|
|
1794
1795
|
const f = this;
|
|
1795
1796
|
s(this), this.__resizeRAF__ && bt(this.__resizeRAF__), this.__resizeRAF__ = Ct(function() {
|
|
1796
|
-
|
|
1797
|
+
i(f) && (f.__resizeLast__.width = f.offsetWidth, f.__resizeLast__.height = f.offsetHeight, f.__resizeListeners__.forEach(function(c) {
|
|
1797
1798
|
c.call(f, S);
|
|
1798
1799
|
}));
|
|
1799
1800
|
});
|
|
1800
1801
|
};
|
|
1801
|
-
let h = !1,
|
|
1802
|
+
let h = !1, _ = "";
|
|
1802
1803
|
o = "animationstart";
|
|
1803
1804
|
const C = "Webkit Moz O ms".split(" ");
|
|
1804
|
-
let y = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),
|
|
1805
|
+
let y = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), w = "";
|
|
1805
1806
|
{
|
|
1806
1807
|
const S = document.createElement("fakeelement");
|
|
1807
1808
|
if (S.style.animationName !== void 0 && (h = !0), h === !1) {
|
|
1808
1809
|
for (let f = 0; f < C.length; f++)
|
|
1809
1810
|
if (S.style[C[f] + "AnimationName"] !== void 0) {
|
|
1810
|
-
|
|
1811
|
+
w = C[f], _ = "-" + w.toLowerCase() + "-", o = y[f], h = !0;
|
|
1811
1812
|
break;
|
|
1812
1813
|
}
|
|
1813
1814
|
}
|
|
1814
1815
|
}
|
|
1815
|
-
n = "resizeanim", e = "@" +
|
|
1816
|
+
n = "resizeanim", e = "@" + _ + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", r = _ + "animation: 1ms " + n + "; ";
|
|
1816
1817
|
}
|
|
1817
|
-
const
|
|
1818
|
+
const u = function(h) {
|
|
1818
1819
|
if (!h.getElementById("detectElementResize")) {
|
|
1819
|
-
const
|
|
1820
|
-
y.id = "detectElementResize", y.type = "text/css", t != null && y.setAttribute("nonce", t), y.styleSheet ? y.styleSheet.cssText =
|
|
1820
|
+
const _ = (e || "") + ".resize-triggers { " + (r || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', C = h.head || h.getElementsByTagName("head")[0], y = h.createElement("style");
|
|
1821
|
+
y.id = "detectElementResize", y.type = "text/css", t != null && y.setAttribute("nonce", t), y.styleSheet ? y.styleSheet.cssText = _ : y.appendChild(h.createTextNode(_)), C.appendChild(y);
|
|
1821
1822
|
}
|
|
1822
1823
|
};
|
|
1823
1824
|
return {
|
|
1824
|
-
addResizeListener: function(h,
|
|
1825
|
-
if (
|
|
1826
|
-
h.attachEvent("onresize",
|
|
1825
|
+
addResizeListener: function(h, _) {
|
|
1826
|
+
if (d)
|
|
1827
|
+
h.attachEvent("onresize", _);
|
|
1827
1828
|
else {
|
|
1828
1829
|
if (!h.__resizeTriggers__) {
|
|
1829
1830
|
const C = h.ownerDocument, y = ae.getComputedStyle(h);
|
|
1830
|
-
y && y.position === "static" && (h.style.position = "relative"),
|
|
1831
|
-
const
|
|
1832
|
-
|
|
1831
|
+
y && y.position === "static" && (h.style.position = "relative"), u(C), h.__resizeLast__ = {}, h.__resizeListeners__ = [], (h.__resizeTriggers__ = C.createElement("div")).className = "resize-triggers";
|
|
1832
|
+
const w = C.createElement("div");
|
|
1833
|
+
w.className = "expand-trigger", w.appendChild(C.createElement("div"));
|
|
1833
1834
|
const S = C.createElement("div");
|
|
1834
|
-
S.className = "contract-trigger", h.__resizeTriggers__.appendChild(
|
|
1835
|
+
S.className = "contract-trigger", h.__resizeTriggers__.appendChild(w), h.__resizeTriggers__.appendChild(S), h.appendChild(h.__resizeTriggers__), s(h), h.addEventListener("scroll", l, !0), o && (h.__resizeTriggers__.__animationListener__ = function(p) {
|
|
1835
1836
|
p.animationName === n && s(h);
|
|
1836
1837
|
}, h.__resizeTriggers__.addEventListener(o, h.__resizeTriggers__.__animationListener__));
|
|
1837
1838
|
}
|
|
1838
|
-
h.__resizeListeners__.push(
|
|
1839
|
+
h.__resizeListeners__.push(_);
|
|
1839
1840
|
}
|
|
1840
1841
|
},
|
|
1841
|
-
removeResizeListener: function(h,
|
|
1842
|
-
if (
|
|
1843
|
-
h.detachEvent("onresize",
|
|
1844
|
-
else if (h.__resizeListeners__.splice(h.__resizeListeners__.indexOf(
|
|
1842
|
+
removeResizeListener: function(h, _) {
|
|
1843
|
+
if (d)
|
|
1844
|
+
h.detachEvent("onresize", _);
|
|
1845
|
+
else if (h.__resizeListeners__.splice(h.__resizeListeners__.indexOf(_), 1), !h.__resizeListeners__.length) {
|
|
1845
1846
|
h.removeEventListener("scroll", l, !0), h.__resizeTriggers__.__animationListener__ && (h.__resizeTriggers__.removeEventListener(o, h.__resizeTriggers__.__animationListener__), h.__resizeTriggers__.__animationListener__ = null);
|
|
1846
1847
|
try {
|
|
1847
1848
|
h.__resizeTriggers__ = !h.removeChild(h.__resizeTriggers__);
|
|
@@ -1864,24 +1865,24 @@ class ni extends nr {
|
|
|
1864
1865
|
onResize: r
|
|
1865
1866
|
} = this.props;
|
|
1866
1867
|
if (this._parentNode) {
|
|
1867
|
-
const
|
|
1868
|
-
if (!n && this.state.height !==
|
|
1868
|
+
const i = window.getComputedStyle(this._parentNode) || {}, s = parseFloat(i.paddingLeft || "0"), l = parseFloat(i.paddingRight || "0"), d = parseFloat(i.paddingTop || "0"), u = parseFloat(i.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(), P = m.height - d - u, h = m.width - s - l;
|
|
1869
|
+
if (!n && this.state.height !== P || !o && this.state.width !== h) {
|
|
1869
1870
|
this.setState({
|
|
1870
|
-
height:
|
|
1871
|
+
height: P,
|
|
1871
1872
|
width: h
|
|
1872
1873
|
});
|
|
1873
|
-
const
|
|
1874
|
+
const _ = () => {
|
|
1874
1875
|
this._didLogDeprecationWarning || (this._didLogDeprecationWarning = !0, console.warn("scaledWidth and scaledHeight parameters have been deprecated; use width and height instead"));
|
|
1875
1876
|
};
|
|
1876
1877
|
typeof r == "function" && r({
|
|
1877
|
-
height:
|
|
1878
|
+
height: P,
|
|
1878
1879
|
width: h,
|
|
1879
1880
|
// TODO Remove these params in the next major release
|
|
1880
1881
|
get scaledHeight() {
|
|
1881
|
-
return
|
|
1882
|
+
return _(), P;
|
|
1882
1883
|
},
|
|
1883
1884
|
get scaledWidth() {
|
|
1884
|
-
return
|
|
1885
|
+
return _(), h;
|
|
1885
1886
|
}
|
|
1886
1887
|
});
|
|
1887
1888
|
}
|
|
@@ -1911,125 +1912,123 @@ class ni extends nr {
|
|
|
1911
1912
|
defaultHeight: n,
|
|
1912
1913
|
defaultWidth: o,
|
|
1913
1914
|
disableHeight: r = !1,
|
|
1914
|
-
disableWidth:
|
|
1915
|
+
disableWidth: i = !1,
|
|
1915
1916
|
doNotBailOutOnEmptyChildren: s = !1,
|
|
1916
1917
|
nonce: l,
|
|
1917
|
-
onResize:
|
|
1918
|
-
style:
|
|
1918
|
+
onResize: d,
|
|
1919
|
+
style: u = {},
|
|
1919
1920
|
tagName: m = "div",
|
|
1920
|
-
...
|
|
1921
|
+
...P
|
|
1921
1922
|
} = this.props, {
|
|
1922
1923
|
height: h,
|
|
1923
|
-
width:
|
|
1924
|
+
width: _
|
|
1924
1925
|
} = this.state, C = {
|
|
1925
1926
|
overflow: "visible"
|
|
1926
1927
|
}, y = {};
|
|
1927
|
-
let
|
|
1928
|
-
return r || (h === 0 && (
|
|
1928
|
+
let w = !1;
|
|
1929
|
+
return r || (h === 0 && (w = !0), C.height = 0, y.height = h, y.scaledHeight = h), i || (_ === 0 && (w = !0), C.width = 0, y.width = _, y.scaledWidth = _), s && (w = !1), Ze(m, {
|
|
1929
1930
|
ref: this._setRef,
|
|
1930
1931
|
style: {
|
|
1931
1932
|
...C,
|
|
1932
|
-
...
|
|
1933
|
+
...u
|
|
1933
1934
|
},
|
|
1934
|
-
...
|
|
1935
|
-
}, !
|
|
1935
|
+
...P
|
|
1936
|
+
}, !w && e(y));
|
|
1936
1937
|
}
|
|
1937
1938
|
}
|
|
1938
1939
|
const ri = ln(({ widths: t, heights: e }) => {
|
|
1939
1940
|
const { focusedPage: n, totalPages: o } = oe(), r = W(() => {
|
|
1940
|
-
const l = [],
|
|
1941
|
-
if (l.push(
|
|
1942
|
-
const
|
|
1943
|
-
l.push(
|
|
1941
|
+
const l = [], d = Math.ceil(n / 2) * 2 - 1;
|
|
1942
|
+
if (l.push(d), d + 1 <= o) {
|
|
1943
|
+
const u = d + 1;
|
|
1944
|
+
l.push(u);
|
|
1944
1945
|
}
|
|
1945
1946
|
return l;
|
|
1946
|
-
}, [n, o]),
|
|
1947
|
-
const l = n % 2 === 1 ? n - 1 : n - 2,
|
|
1947
|
+
}, [n, o]), i = W(() => {
|
|
1948
|
+
const l = n % 2 === 1 ? n - 1 : n - 2, d = Math.floor(l / 2), u = e(d), m = t(l), P = t(l + 1);
|
|
1948
1949
|
return [
|
|
1949
1950
|
{
|
|
1950
1951
|
position: "absolute",
|
|
1951
1952
|
left: 0,
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
height: d
|
|
1953
|
+
width: m,
|
|
1954
|
+
height: u
|
|
1955
1955
|
},
|
|
1956
1956
|
{
|
|
1957
1957
|
position: "absolute",
|
|
1958
|
-
left:
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
height: b
|
|
1958
|
+
left: m,
|
|
1959
|
+
width: P,
|
|
1960
|
+
height: u
|
|
1962
1961
|
}
|
|
1963
1962
|
];
|
|
1964
|
-
}, [t, e, r]), s = W(() =>
|
|
1965
|
-
return /* @__PURE__ */
|
|
1963
|
+
}, [t, e, r]), s = W(() => i.reduce((l, d) => l + Number(d.width || 0), 0), [i]);
|
|
1964
|
+
return /* @__PURE__ */ a("div", { style: { width: s, position: "relative" }, children: r.map((l, d) => /* @__PURE__ */ a(Lt, { style: i[d], pageNumber: l }, l)) });
|
|
1966
1965
|
}), oi = ({ widths: t, heights: e }) => {
|
|
1967
1966
|
const { focusedPage: n } = oe(), o = W(() => ({
|
|
1968
1967
|
position: "absolute",
|
|
1969
1968
|
width: t(n - 1),
|
|
1970
1969
|
height: e(n - 1)
|
|
1971
1970
|
}), [t, e, n]), r = W(() => t(n - 1), [t]);
|
|
1972
|
-
return /* @__PURE__ */
|
|
1971
|
+
return /* @__PURE__ */ a(
|
|
1973
1972
|
"div",
|
|
1974
1973
|
{
|
|
1975
1974
|
style: {
|
|
1976
1975
|
width: r,
|
|
1977
1976
|
position: "relative"
|
|
1978
1977
|
},
|
|
1979
|
-
children: /* @__PURE__ */
|
|
1978
|
+
children: /* @__PURE__ */ a(Lt, { style: o, pageNumber: n }, n)
|
|
1980
1979
|
}
|
|
1981
1980
|
);
|
|
1982
1981
|
}, ii = (t, e, n) => {
|
|
1983
|
-
const o = $(), { contentRef: r } = ge(), { heights:
|
|
1984
|
-
const
|
|
1982
|
+
const o = $(), { contentRef: r } = ge(), { heights: i, widths: s } = qe(), { setFocusedPage: l } = oe(), [d, u] = G([]), { targetScrollPage: m } = pn(), P = Tt(d, 0, 500), h = W(() => i.map((C, y) => {
|
|
1983
|
+
const w = s[y], S = Zr(y + 1, t), f = w * S.columnIndex, p = C * S.rowIndex, g = f + w, c = p + C;
|
|
1985
1984
|
return {
|
|
1986
1985
|
pageNumber: y + 1,
|
|
1987
1986
|
...S,
|
|
1988
|
-
width:
|
|
1987
|
+
width: w,
|
|
1989
1988
|
height: C,
|
|
1990
1989
|
startX: f,
|
|
1991
1990
|
startY: p,
|
|
1992
1991
|
endX: g,
|
|
1993
1992
|
endY: c
|
|
1994
1993
|
};
|
|
1995
|
-
}), [
|
|
1994
|
+
}), [i, s, t, e]);
|
|
1996
1995
|
z(() => {
|
|
1997
1996
|
var y;
|
|
1998
|
-
|
|
1999
|
-
let C = (y =
|
|
2000
|
-
C &&
|
|
1997
|
+
P.length > 0 && !m.current && l(P[0].pageNumber);
|
|
1998
|
+
let C = (y = P[0]) == null ? void 0 : y.ratio;
|
|
1999
|
+
C && P.filter((w) => Math.round(w.ratio) === Math.round(C)).some((w) => w.pageNumber === m.current) && setTimeout(() => {
|
|
2001
2000
|
m.current = void 0;
|
|
2002
2001
|
}, 500);
|
|
2003
|
-
}, [
|
|
2004
|
-
const
|
|
2002
|
+
}, [P, l]);
|
|
2003
|
+
const _ = E(
|
|
2005
2004
|
(C) => {
|
|
2006
2005
|
o.current && cancelAnimationFrame(o.current), o.current = requestAnimationFrame(() => {
|
|
2007
|
-
const y = C.target,
|
|
2006
|
+
const y = C.target, w = {
|
|
2008
2007
|
startTop: y.scrollTop,
|
|
2009
2008
|
startLeft: y.scrollLeft,
|
|
2010
2009
|
endTop: y.scrollTop + y.clientHeight,
|
|
2011
2010
|
endLeft: y.scrollLeft + y.clientWidth
|
|
2012
2011
|
}, S = h.filter((f) => {
|
|
2013
|
-
const p = f.endX >=
|
|
2012
|
+
const p = f.endX >= w.startLeft && f.endY >= w.startTop, g = f.startX <= w.endLeft && f.startY <= w.endTop;
|
|
2014
2013
|
return p && g;
|
|
2015
2014
|
}).map((f) => {
|
|
2016
|
-
const p =
|
|
2015
|
+
const p = w.startLeft > f.startX ? w.startLeft : f.startX, g = w.startTop > f.startY ? w.startTop : f.startY, c = w.endLeft < f.endX ? w.endLeft : f.endX, b = w.endTop < f.endY ? w.endTop : f.endY, v = c - p, T = b - g, x = +(v * T / (f.width * f.height) * 100).toFixed(2);
|
|
2017
2016
|
return {
|
|
2018
2017
|
pageNumber: f.pageNumber,
|
|
2019
2018
|
ratio: x
|
|
2020
2019
|
};
|
|
2021
2020
|
}).sort((f, p) => p.ratio - f.ratio);
|
|
2022
|
-
|
|
2021
|
+
u(S);
|
|
2023
2022
|
});
|
|
2024
2023
|
},
|
|
2025
2024
|
[r, h]
|
|
2026
2025
|
);
|
|
2027
2026
|
z(() => {
|
|
2028
2027
|
if (n)
|
|
2029
|
-
return n == null || n.addEventListener("scroll",
|
|
2030
|
-
n == null || n.removeEventListener("scroll",
|
|
2028
|
+
return n == null || n.addEventListener("scroll", _), () => {
|
|
2029
|
+
n == null || n.removeEventListener("scroll", _);
|
|
2031
2030
|
};
|
|
2032
|
-
}, [n,
|
|
2031
|
+
}, [n, _]);
|
|
2033
2032
|
}, be = {
|
|
2034
2033
|
"rp-layout": "_rp-layout_1g4ff_1",
|
|
2035
2034
|
"rp-content": "_rp-content_1g4ff_5",
|
|
@@ -2039,8 +2038,8 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2039
2038
|
"rp-theme-variables": "_rp-theme-variables_1g4ff_24",
|
|
2040
2039
|
"rp-dark-mode": "_rp-dark-mode_1g4ff_135"
|
|
2041
2040
|
}, Rn = Ve((t, e) => {
|
|
2042
|
-
const { children: n, toolbarRef: o, style: r, className:
|
|
2043
|
-
return /* @__PURE__ */
|
|
2041
|
+
const { children: n, toolbarRef: o, style: r, className: i, ...s } = t, { customVariables: l, customDarkVariables: d } = _r(), { darkMode: u } = ir();
|
|
2042
|
+
return /* @__PURE__ */ a(
|
|
2044
2043
|
"div",
|
|
2045
2044
|
{
|
|
2046
2045
|
ref: e,
|
|
@@ -2048,13 +2047,13 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2048
2047
|
className: re(
|
|
2049
2048
|
be["rp-theme-variables"],
|
|
2050
2049
|
be["rp-container"],
|
|
2051
|
-
|
|
2052
|
-
|
|
2050
|
+
u ? be["rp-dark-mode"] : "",
|
|
2051
|
+
i
|
|
2053
2052
|
),
|
|
2054
2053
|
style: {
|
|
2055
2054
|
"--rp-toolbar-height": `${(o == null ? void 0 : o.clientHeight) || 48}px`,
|
|
2056
2055
|
...l,
|
|
2057
|
-
...
|
|
2056
|
+
...u ? d : {},
|
|
2058
2057
|
...r
|
|
2059
2058
|
},
|
|
2060
2059
|
children: n
|
|
@@ -2062,18 +2061,18 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2062
2061
|
);
|
|
2063
2062
|
}), ai = ln(({ columnIndex: t, rowIndex: e, data: n, style: o }) => {
|
|
2064
2063
|
const r = jr(e, t, n.columnCount);
|
|
2065
|
-
return /* @__PURE__ */
|
|
2064
|
+
return /* @__PURE__ */ a(Lt, { style: o, pageNumber: r }, r);
|
|
2066
2065
|
}, Jo), Qs = () => {
|
|
2067
|
-
const { initialPage: t = 1, initialScrollMode: e, instanceId: n } = cr(), { pagesRef: o, setPagesRef: r } = ge(), { scrollToPage:
|
|
2066
|
+
const { initialPage: t = 1, initialScrollMode: e, instanceId: n } = cr(), { pagesRef: o, setPagesRef: r } = ge(), { scrollToPage: i } = vn(), {
|
|
2068
2067
|
virtualScrollRef: s,
|
|
2069
2068
|
getVirtualScrollRef: l,
|
|
2070
|
-
getPageScrollElementRef:
|
|
2071
|
-
getVirtualScrollableElementRef:
|
|
2069
|
+
getPageScrollElementRef: d,
|
|
2070
|
+
getVirtualScrollableElementRef: u,
|
|
2072
2071
|
setTotalInnerDimensions: m,
|
|
2073
|
-
virtualScrollableElementRef:
|
|
2072
|
+
virtualScrollableElementRef: P,
|
|
2074
2073
|
totalInnerDimensions: h,
|
|
2075
|
-
pageScrollElementRef:
|
|
2076
|
-
} = et(), C = $(!0), { nextPage: y, prevPage:
|
|
2074
|
+
pageScrollElementRef: _
|
|
2075
|
+
} = et(), C = $(!0), { nextPage: y, prevPage: w, setFocusedPage: S, focusedPage: f } = oe(), { scrollMode: p } = Ne(), { viewMode: g } = Oe(), c = $(null), { loading: b } = J(), { passwordRequired: v } = or(), { LoaderImageComponent: T } = hn(), R = $(
|
|
2077
2076
|
h
|
|
2078
2077
|
), x = $({
|
|
2079
2078
|
viewMode: g,
|
|
@@ -2087,7 +2086,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2087
2086
|
estimatedColumnWidth: q,
|
|
2088
2087
|
estimatedRowHeight: H
|
|
2089
2088
|
} = ei(), U = Tt(h, 100), V = $();
|
|
2090
|
-
ii(D, L,
|
|
2089
|
+
ii(D, L, P);
|
|
2091
2090
|
const K = $({
|
|
2092
2091
|
scrollTop: 0,
|
|
2093
2092
|
scrollLeft: 0
|
|
@@ -2100,9 +2099,9 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2100
2099
|
}), [D]), we = E(
|
|
2101
2100
|
(B) => {
|
|
2102
2101
|
const Z = document.activeElement !== o;
|
|
2103
|
-
!A && Z || (["ArrowUp", "ArrowLeft"].includes(B.key) ? (B.preventDefault(),
|
|
2102
|
+
!A && Z || (["ArrowUp", "ArrowLeft"].includes(B.key) ? (B.preventDefault(), w()) : ["ArrowDown", "ArrowRight"].includes(B.key) && (B.preventDefault(), y()));
|
|
2104
2103
|
},
|
|
2105
|
-
[y,
|
|
2104
|
+
[y, w, A, p]
|
|
2106
2105
|
);
|
|
2107
2106
|
z(() => (window.addEventListener("keydown", we), () => {
|
|
2108
2107
|
window.removeEventListener("keydown", we);
|
|
@@ -2118,19 +2117,19 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2118
2117
|
}, [L, D, F, s]);
|
|
2119
2118
|
const Te = E(
|
|
2120
2119
|
(B, Z) => {
|
|
2121
|
-
if (!
|
|
2120
|
+
if (!P)
|
|
2122
2121
|
return { scrollTop: 0, scrollLeft: 0 };
|
|
2123
2122
|
const ye = K.current.scrollTop > Z, Se = K.current.scrollLeft > B;
|
|
2124
2123
|
return ye || Se ? K.current : {
|
|
2125
|
-
scrollTop:
|
|
2126
|
-
scrollLeft:
|
|
2124
|
+
scrollTop: P.scrollTop,
|
|
2125
|
+
scrollLeft: P.scrollLeft
|
|
2127
2126
|
};
|
|
2128
2127
|
},
|
|
2129
|
-
[
|
|
2128
|
+
[P]
|
|
2130
2129
|
), _e = E(
|
|
2131
2130
|
(B, Z) => {
|
|
2132
2131
|
if (x.current.viewMode !== g || x.current.scrollMode !== p) {
|
|
2133
|
-
V.current && clearTimeout(V.current), I.current = !0,
|
|
2132
|
+
V.current && clearTimeout(V.current), I.current = !0, i(f, "auto"), V.current = setTimeout(() => {
|
|
2134
2133
|
requestAnimationFrame(() => {
|
|
2135
2134
|
x.current = { viewMode: g, scrollMode: p };
|
|
2136
2135
|
});
|
|
@@ -2157,7 +2156,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2157
2156
|
width: Z.width
|
|
2158
2157
|
};
|
|
2159
2158
|
},
|
|
2160
|
-
[s, g, p,
|
|
2159
|
+
[s, g, p, i]
|
|
2161
2160
|
);
|
|
2162
2161
|
z(() => {
|
|
2163
2162
|
clearTimeout(O.current);
|
|
@@ -2180,7 +2179,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2180
2179
|
scrollLeft: B.scrollLeft
|
|
2181
2180
|
};
|
|
2182
2181
|
},
|
|
2183
|
-
[
|
|
2182
|
+
[P]
|
|
2184
2183
|
);
|
|
2185
2184
|
z(() => () => {
|
|
2186
2185
|
V.current && clearTimeout(V.current);
|
|
@@ -2198,36 +2197,36 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2198
2197
|
[ee, le, ue]
|
|
2199
2198
|
);
|
|
2200
2199
|
return z(() => {
|
|
2201
|
-
|
|
2202
|
-
}, [
|
|
2200
|
+
b && de();
|
|
2201
|
+
}, [b]), z(() => {
|
|
2203
2202
|
if (!(U.height === 0 || !C.current)) {
|
|
2204
2203
|
if (e === ne.PAGE_SCROLLING) {
|
|
2205
|
-
t !== f &&
|
|
2204
|
+
t !== f && _ && S(t), C.current = !1;
|
|
2206
2205
|
return;
|
|
2207
2206
|
}
|
|
2208
|
-
|
|
2207
|
+
i(t, "auto"), S(t), C.current = !1;
|
|
2209
2208
|
}
|
|
2210
2209
|
}, [
|
|
2211
|
-
|
|
2210
|
+
i,
|
|
2212
2211
|
e,
|
|
2213
|
-
|
|
2212
|
+
_,
|
|
2214
2213
|
S,
|
|
2215
2214
|
U
|
|
2216
2215
|
]), /* @__PURE__ */ M(me, { children: [
|
|
2217
|
-
/* @__PURE__ */
|
|
2216
|
+
/* @__PURE__ */ a(Rn, { id: n, ref: r, tabIndex: -1, className: ot, children: /* @__PURE__ */ a(ni, { style: { minHeight: "50px" }, children: ({ width: B, height: Z }) => /* @__PURE__ */ a("div", { "data-rp": "pages", ref: Xn, style: { width: B, height: Z }, children: p === ne.PAGE_SCROLLING ? /* @__PURE__ */ a(
|
|
2218
2217
|
"div",
|
|
2219
2218
|
{
|
|
2220
|
-
ref:
|
|
2219
|
+
ref: d,
|
|
2221
2220
|
style: { width: B, height: Z },
|
|
2222
2221
|
className: re(ue["rp-pages"], ue["rp-page-scrolling-wrapper"]),
|
|
2223
|
-
children: g === Le.DUAL_PAGE ? /* @__PURE__ */
|
|
2222
|
+
children: g === Le.DUAL_PAGE ? /* @__PURE__ */ a(ri, { widths: k, heights: N }) : /* @__PURE__ */ a(oi, { widths: k, heights: N })
|
|
2224
2223
|
}
|
|
2225
|
-
) : q ? /* @__PURE__ */
|
|
2224
|
+
) : q ? /* @__PURE__ */ a(
|
|
2226
2225
|
Xo,
|
|
2227
2226
|
{
|
|
2228
2227
|
ref: l,
|
|
2229
2228
|
itemData: Fe,
|
|
2230
|
-
outerRef:
|
|
2229
|
+
outerRef: u,
|
|
2231
2230
|
innerRef: c,
|
|
2232
2231
|
onScroll: rt,
|
|
2233
2232
|
columnCount: D,
|
|
@@ -2244,7 +2243,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2244
2243
|
),
|
|
2245
2244
|
children: ai
|
|
2246
2245
|
}
|
|
2247
|
-
) :
|
|
2246
|
+
) : b ? null : /* @__PURE__ */ a(
|
|
2248
2247
|
"div",
|
|
2249
2248
|
{
|
|
2250
2249
|
className: ue["rp-loader"],
|
|
@@ -2255,10 +2254,10 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2255
2254
|
height: "100%",
|
|
2256
2255
|
width: "100%"
|
|
2257
2256
|
},
|
|
2258
|
-
children: T && /* @__PURE__ */
|
|
2257
|
+
children: T && /* @__PURE__ */ a(T, {})
|
|
2259
2258
|
}
|
|
2260
2259
|
) }) }) }),
|
|
2261
|
-
v && /* @__PURE__ */
|
|
2260
|
+
v && /* @__PURE__ */ a(Br, {})
|
|
2262
2261
|
] });
|
|
2263
2262
|
}, ke = {
|
|
2264
2263
|
"rp-toolbar-content": "_rp-toolbar-content_sz31z_1",
|
|
@@ -2272,55 +2271,55 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2272
2271
|
"rp-total-page": "_rp-total-page_1y9vo_11"
|
|
2273
2272
|
}, si = () => {
|
|
2274
2273
|
const { prevIcon: t } = pe();
|
|
2275
|
-
return t || /* @__PURE__ */
|
|
2274
|
+
return t || /* @__PURE__ */ a(He, {});
|
|
2276
2275
|
}, ci = () => {
|
|
2277
2276
|
const { nextIcon: t } = pe();
|
|
2278
|
-
return t || /* @__PURE__ */
|
|
2277
|
+
return t || /* @__PURE__ */ a(He, { style: { transform: "rotate(180deg" } });
|
|
2279
2278
|
}, li = () => {
|
|
2280
|
-
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: o, prevPage: r, goToPage:
|
|
2279
|
+
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: i } = oe(), [s, l] = G(t.toString()), { pageNavigationTool: d = !0 } = ve(), { isSmallScreen: u } = Pe(), { localeMessages: m } = se(), { viewMode: P } = Oe(), { scrollMode: h } = Ne();
|
|
2281
2280
|
z(() => {
|
|
2282
2281
|
l(t.toString());
|
|
2283
2282
|
}, [t]);
|
|
2284
|
-
const
|
|
2283
|
+
const _ = E((f) => {
|
|
2285
2284
|
const p = f.target.value;
|
|
2286
2285
|
l(p);
|
|
2287
2286
|
}, []), C = E(async () => {
|
|
2288
|
-
const f =
|
|
2287
|
+
const f = i(s);
|
|
2289
2288
|
f.success || l(f.currentPage.toString());
|
|
2290
|
-
}, [
|
|
2289
|
+
}, [i, s, e]), y = E(() => {
|
|
2291
2290
|
l(t.toString());
|
|
2292
|
-
}, [t]),
|
|
2291
|
+
}, [t]), w = E(
|
|
2293
2292
|
(f) => {
|
|
2294
2293
|
f.key === "Enter" && C();
|
|
2295
2294
|
},
|
|
2296
2295
|
[C]
|
|
2297
|
-
), S = W(() =>
|
|
2298
|
-
return typeof
|
|
2299
|
-
|
|
2296
|
+
), S = W(() => P === Le.DUAL_PAGE && h === ne.PAGE_SCROLLING && t === e - 1 || t === e, [t, e, P, h]);
|
|
2297
|
+
return typeof d != "boolean" ? /* @__PURE__ */ a(
|
|
2298
|
+
d,
|
|
2300
2299
|
{
|
|
2301
2300
|
total: e,
|
|
2302
2301
|
current: t,
|
|
2303
2302
|
nextPage: o,
|
|
2304
2303
|
prevPage: r,
|
|
2305
|
-
goToPage:
|
|
2304
|
+
goToPage: i,
|
|
2306
2305
|
changePage: n
|
|
2307
2306
|
}
|
|
2308
|
-
) :
|
|
2309
|
-
!
|
|
2307
|
+
) : d ? /* @__PURE__ */ M("div", { className: mt["rp-paginate"], children: [
|
|
2308
|
+
!u && /* @__PURE__ */ a(Y, { content: m == null ? void 0 : m.previousPageTooltip, children: /* @__PURE__ */ a(
|
|
2310
2309
|
ie,
|
|
2311
2310
|
{
|
|
2312
2311
|
onClick: r,
|
|
2313
2312
|
"aria-label": m == null ? void 0 : m.previousPageTooltip,
|
|
2314
2313
|
"aria-disabled": t === 1,
|
|
2315
|
-
children: /* @__PURE__ */
|
|
2314
|
+
children: /* @__PURE__ */ a(si, {})
|
|
2316
2315
|
}
|
|
2317
2316
|
) }),
|
|
2318
|
-
/* @__PURE__ */
|
|
2317
|
+
/* @__PURE__ */ a(Y, { content: m == null ? void 0 : m.currentPageTooltip, children: /* @__PURE__ */ a(
|
|
2319
2318
|
dn,
|
|
2320
2319
|
{
|
|
2321
|
-
onKeyDown:
|
|
2320
|
+
onKeyDown: w,
|
|
2322
2321
|
onBlur: y,
|
|
2323
|
-
onChange:
|
|
2322
|
+
onChange: _,
|
|
2324
2323
|
value: s,
|
|
2325
2324
|
className: mt["rp-page-input"],
|
|
2326
2325
|
id: "page-input",
|
|
@@ -2331,13 +2330,13 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2331
2330
|
"/",
|
|
2332
2331
|
e
|
|
2333
2332
|
] }),
|
|
2334
|
-
!
|
|
2333
|
+
!u && /* @__PURE__ */ a(Y, { content: m == null ? void 0 : m.nextPageTooltip, children: /* @__PURE__ */ a(
|
|
2335
2334
|
ie,
|
|
2336
2335
|
{
|
|
2337
2336
|
onClick: o,
|
|
2338
2337
|
"aria-label": m == null ? void 0 : m.nextPageTooltip,
|
|
2339
2338
|
"aria-disabled": S,
|
|
2340
|
-
children: /* @__PURE__ */
|
|
2339
|
+
children: /* @__PURE__ */ a(ci, {})
|
|
2341
2340
|
}
|
|
2342
2341
|
) })
|
|
2343
2342
|
] }) : null;
|
|
@@ -2348,26 +2347,26 @@ var nt = "Dialog", [Ln, Ys] = eo(nt), [di, ce] = Ln(nt), En = (t) => {
|
|
|
2348
2347
|
children: n,
|
|
2349
2348
|
open: o,
|
|
2350
2349
|
defaultOpen: r,
|
|
2351
|
-
onOpenChange:
|
|
2350
|
+
onOpenChange: i,
|
|
2352
2351
|
modal: s = !0
|
|
2353
|
-
} = t, l = j.useRef(null),
|
|
2352
|
+
} = t, l = j.useRef(null), d = j.useRef(null), [u, m] = no({
|
|
2354
2353
|
prop: o,
|
|
2355
2354
|
defaultProp: r ?? !1,
|
|
2356
|
-
onChange:
|
|
2355
|
+
onChange: i,
|
|
2357
2356
|
caller: nt
|
|
2358
2357
|
});
|
|
2359
|
-
return /* @__PURE__ */
|
|
2358
|
+
return /* @__PURE__ */ a(
|
|
2360
2359
|
di,
|
|
2361
2360
|
{
|
|
2362
2361
|
scope: e,
|
|
2363
2362
|
triggerRef: l,
|
|
2364
|
-
contentRef:
|
|
2363
|
+
contentRef: d,
|
|
2365
2364
|
contentId: lt(),
|
|
2366
2365
|
titleId: lt(),
|
|
2367
2366
|
descriptionId: lt(),
|
|
2368
|
-
open:
|
|
2367
|
+
open: u,
|
|
2369
2368
|
onOpenChange: m,
|
|
2370
|
-
onOpenToggle: j.useCallback(() => m((
|
|
2369
|
+
onOpenToggle: j.useCallback(() => m((P) => !P), [m]),
|
|
2371
2370
|
modal: s,
|
|
2372
2371
|
children: n
|
|
2373
2372
|
}
|
|
@@ -2376,8 +2375,8 @@ var nt = "Dialog", [Ln, Ys] = eo(nt), [di, ce] = Ln(nt), En = (t) => {
|
|
|
2376
2375
|
En.displayName = nt;
|
|
2377
2376
|
var Nn = "DialogTrigger", ui = j.forwardRef(
|
|
2378
2377
|
(t, e) => {
|
|
2379
|
-
const { __scopeDialog: n, ...o } = t, r = ce(Nn, n),
|
|
2380
|
-
return /* @__PURE__ */
|
|
2378
|
+
const { __scopeDialog: n, ...o } = t, r = ce(Nn, n), i = St(e, r.triggerRef);
|
|
2379
|
+
return /* @__PURE__ */ a(
|
|
2381
2380
|
Be.button,
|
|
2382
2381
|
{
|
|
2383
2382
|
type: "button",
|
|
@@ -2386,7 +2385,7 @@ var Nn = "DialogTrigger", ui = j.forwardRef(
|
|
|
2386
2385
|
"aria-controls": r.contentId,
|
|
2387
2386
|
"data-state": Ot(r.open),
|
|
2388
2387
|
...o,
|
|
2389
|
-
ref:
|
|
2388
|
+
ref: i,
|
|
2390
2389
|
onClick: Me(t.onClick, r.onOpenToggle)
|
|
2391
2390
|
}
|
|
2392
2391
|
);
|
|
@@ -2396,14 +2395,14 @@ ui.displayName = Nn;
|
|
|
2396
2395
|
var Et = "DialogPortal", [pi, On] = Ln(Et, {
|
|
2397
2396
|
forceMount: void 0
|
|
2398
2397
|
}), Dn = (t) => {
|
|
2399
|
-
const { __scopeDialog: e, forceMount: n, children: o, container: r } = t,
|
|
2400
|
-
return /* @__PURE__ */
|
|
2398
|
+
const { __scopeDialog: e, forceMount: n, children: o, container: r } = t, i = ce(Et, e);
|
|
2399
|
+
return /* @__PURE__ */ a(pi, { scope: e, forceMount: n, children: j.Children.map(o, (s) => /* @__PURE__ */ a(xt, { present: n || i.open, children: /* @__PURE__ */ a(lo, { asChild: !0, container: r, children: s }) })) });
|
|
2401
2400
|
};
|
|
2402
2401
|
Dn.displayName = Et;
|
|
2403
2402
|
var Ye = "DialogOverlay", zn = j.forwardRef(
|
|
2404
2403
|
(t, e) => {
|
|
2405
|
-
const n = On(Ye, t.__scopeDialog), { forceMount: o = n.forceMount, ...r } = t,
|
|
2406
|
-
return
|
|
2404
|
+
const n = On(Ye, t.__scopeDialog), { forceMount: o = n.forceMount, ...r } = t, i = ce(Ye, t.__scopeDialog);
|
|
2405
|
+
return i.modal ? /* @__PURE__ */ a(xt, { present: o || i.open, children: /* @__PURE__ */ a(fi, { ...r, ref: e }) }) : null;
|
|
2407
2406
|
}
|
|
2408
2407
|
);
|
|
2409
2408
|
zn.displayName = Ye;
|
|
@@ -2413,7 +2412,7 @@ var hi = ro("DialogOverlay.RemoveScroll"), fi = j.forwardRef(
|
|
|
2413
2412
|
return (
|
|
2414
2413
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
2415
2414
|
// ie. when `Overlay` and `Content` are siblings
|
|
2416
|
-
/* @__PURE__ */
|
|
2415
|
+
/* @__PURE__ */ a(io, { as: hi, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ a(
|
|
2417
2416
|
Be.div,
|
|
2418
2417
|
{
|
|
2419
2418
|
"data-state": Ot(r.open),
|
|
@@ -2426,8 +2425,8 @@ var hi = ro("DialogOverlay.RemoveScroll"), fi = j.forwardRef(
|
|
|
2426
2425
|
}
|
|
2427
2426
|
), Ee = "DialogContent", An = j.forwardRef(
|
|
2428
2427
|
(t, e) => {
|
|
2429
|
-
const n = On(Ee, t.__scopeDialog), { forceMount: o = n.forceMount, ...r } = t,
|
|
2430
|
-
return /* @__PURE__ */
|
|
2428
|
+
const n = On(Ee, t.__scopeDialog), { forceMount: o = n.forceMount, ...r } = t, i = ce(Ee, t.__scopeDialog);
|
|
2429
|
+
return /* @__PURE__ */ a(xt, { present: o || i.open, children: i.modal ? /* @__PURE__ */ a(mi, { ...r, ref: e }) : /* @__PURE__ */ a(gi, { ...r, ref: e }) });
|
|
2431
2430
|
}
|
|
2432
2431
|
);
|
|
2433
2432
|
An.displayName = Ee;
|
|
@@ -2435,27 +2434,27 @@ var mi = j.forwardRef(
|
|
|
2435
2434
|
(t, e) => {
|
|
2436
2435
|
const n = ce(Ee, t.__scopeDialog), o = j.useRef(null), r = St(e, n.contentRef, o);
|
|
2437
2436
|
return j.useEffect(() => {
|
|
2438
|
-
const
|
|
2439
|
-
if (
|
|
2440
|
-
return ao(
|
|
2441
|
-
}, []), /* @__PURE__ */
|
|
2437
|
+
const i = o.current;
|
|
2438
|
+
if (i)
|
|
2439
|
+
return ao(i);
|
|
2440
|
+
}, []), /* @__PURE__ */ a(
|
|
2442
2441
|
Fn,
|
|
2443
2442
|
{
|
|
2444
2443
|
...t,
|
|
2445
2444
|
ref: r,
|
|
2446
2445
|
trapFocus: n.open,
|
|
2447
2446
|
disableOutsidePointerEvents: !0,
|
|
2448
|
-
onCloseAutoFocus: Me(t.onCloseAutoFocus, (
|
|
2447
|
+
onCloseAutoFocus: Me(t.onCloseAutoFocus, (i) => {
|
|
2449
2448
|
var s;
|
|
2450
|
-
|
|
2449
|
+
i.preventDefault(), (s = n.triggerRef.current) == null || s.focus();
|
|
2451
2450
|
}),
|
|
2452
|
-
onPointerDownOutside: Me(t.onPointerDownOutside, (
|
|
2453
|
-
const s =
|
|
2454
|
-
(s.button === 2 || l) &&
|
|
2451
|
+
onPointerDownOutside: Me(t.onPointerDownOutside, (i) => {
|
|
2452
|
+
const s = i.detail.originalEvent, l = s.button === 0 && s.ctrlKey === !0;
|
|
2453
|
+
(s.button === 2 || l) && i.preventDefault();
|
|
2455
2454
|
}),
|
|
2456
2455
|
onFocusOutside: Me(
|
|
2457
2456
|
t.onFocusOutside,
|
|
2458
|
-
(
|
|
2457
|
+
(i) => i.preventDefault()
|
|
2459
2458
|
)
|
|
2460
2459
|
}
|
|
2461
2460
|
);
|
|
@@ -2463,39 +2462,39 @@ var mi = j.forwardRef(
|
|
|
2463
2462
|
), gi = j.forwardRef(
|
|
2464
2463
|
(t, e) => {
|
|
2465
2464
|
const n = ce(Ee, t.__scopeDialog), o = j.useRef(!1), r = j.useRef(!1);
|
|
2466
|
-
return /* @__PURE__ */
|
|
2465
|
+
return /* @__PURE__ */ a(
|
|
2467
2466
|
Fn,
|
|
2468
2467
|
{
|
|
2469
2468
|
...t,
|
|
2470
2469
|
ref: e,
|
|
2471
2470
|
trapFocus: !1,
|
|
2472
2471
|
disableOutsidePointerEvents: !1,
|
|
2473
|
-
onCloseAutoFocus: (
|
|
2472
|
+
onCloseAutoFocus: (i) => {
|
|
2474
2473
|
var s, l;
|
|
2475
|
-
(s = t.onCloseAutoFocus) == null || s.call(t,
|
|
2474
|
+
(s = t.onCloseAutoFocus) == null || s.call(t, i), i.defaultPrevented || (o.current || (l = n.triggerRef.current) == null || l.focus(), i.preventDefault()), o.current = !1, r.current = !1;
|
|
2476
2475
|
},
|
|
2477
|
-
onInteractOutside: (
|
|
2478
|
-
var
|
|
2479
|
-
(
|
|
2480
|
-
const s =
|
|
2481
|
-
((
|
|
2476
|
+
onInteractOutside: (i) => {
|
|
2477
|
+
var d, u;
|
|
2478
|
+
(d = t.onInteractOutside) == null || d.call(t, i), i.defaultPrevented || (o.current = !0, i.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
2479
|
+
const s = i.target;
|
|
2480
|
+
((u = n.triggerRef.current) == null ? void 0 : u.contains(s)) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && r.current && i.preventDefault();
|
|
2482
2481
|
}
|
|
2483
2482
|
}
|
|
2484
2483
|
);
|
|
2485
2484
|
}
|
|
2486
2485
|
), Fn = j.forwardRef(
|
|
2487
2486
|
(t, e) => {
|
|
2488
|
-
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus:
|
|
2487
|
+
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: i, ...s } = t, l = ce(Ee, n), d = j.useRef(null), u = St(e, d);
|
|
2489
2488
|
return so(), /* @__PURE__ */ M(me, { children: [
|
|
2490
|
-
/* @__PURE__ */
|
|
2489
|
+
/* @__PURE__ */ a(
|
|
2491
2490
|
co,
|
|
2492
2491
|
{
|
|
2493
2492
|
asChild: !0,
|
|
2494
2493
|
loop: !0,
|
|
2495
2494
|
trapped: o,
|
|
2496
2495
|
onMountAutoFocus: r,
|
|
2497
|
-
onUnmountAutoFocus:
|
|
2498
|
-
children: /* @__PURE__ */
|
|
2496
|
+
onUnmountAutoFocus: i,
|
|
2497
|
+
children: /* @__PURE__ */ a(
|
|
2499
2498
|
oo,
|
|
2500
2499
|
{
|
|
2501
2500
|
role: "dialog",
|
|
@@ -2504,36 +2503,36 @@ var mi = j.forwardRef(
|
|
|
2504
2503
|
"aria-labelledby": l.titleId,
|
|
2505
2504
|
"data-state": Ot(l.open),
|
|
2506
2505
|
...s,
|
|
2507
|
-
ref:
|
|
2506
|
+
ref: u,
|
|
2508
2507
|
onDismiss: () => l.onOpenChange(!1)
|
|
2509
2508
|
}
|
|
2510
2509
|
)
|
|
2511
2510
|
}
|
|
2512
2511
|
),
|
|
2513
2512
|
/* @__PURE__ */ M(me, { children: [
|
|
2514
|
-
/* @__PURE__ */
|
|
2515
|
-
/* @__PURE__ */
|
|
2513
|
+
/* @__PURE__ */ a(wi, { titleId: l.titleId }),
|
|
2514
|
+
/* @__PURE__ */ a(bi, { contentRef: d, descriptionId: l.descriptionId })
|
|
2516
2515
|
] })
|
|
2517
2516
|
] });
|
|
2518
2517
|
}
|
|
2519
2518
|
), Nt = "DialogTitle", kn = j.forwardRef(
|
|
2520
2519
|
(t, e) => {
|
|
2521
2520
|
const { __scopeDialog: n, ...o } = t, r = ce(Nt, n);
|
|
2522
|
-
return /* @__PURE__ */
|
|
2521
|
+
return /* @__PURE__ */ a(Be.h2, { id: r.titleId, ...o, ref: e });
|
|
2523
2522
|
}
|
|
2524
2523
|
);
|
|
2525
2524
|
kn.displayName = Nt;
|
|
2526
2525
|
var Wn = "DialogDescription", vi = j.forwardRef(
|
|
2527
2526
|
(t, e) => {
|
|
2528
2527
|
const { __scopeDialog: n, ...o } = t, r = ce(Wn, n);
|
|
2529
|
-
return /* @__PURE__ */
|
|
2528
|
+
return /* @__PURE__ */ a(Be.p, { id: r.descriptionId, ...o, ref: e });
|
|
2530
2529
|
}
|
|
2531
2530
|
);
|
|
2532
2531
|
vi.displayName = Wn;
|
|
2533
2532
|
var Mn = "DialogClose", Hn = j.forwardRef(
|
|
2534
2533
|
(t, e) => {
|
|
2535
2534
|
const { __scopeDialog: n, ...o } = t, r = ce(Mn, n);
|
|
2536
|
-
return /* @__PURE__ */
|
|
2535
|
+
return /* @__PURE__ */ a(
|
|
2537
2536
|
Be.button,
|
|
2538
2537
|
{
|
|
2539
2538
|
type: "button",
|
|
@@ -2564,8 +2563,8 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
|
|
|
2564
2563
|
}, _i = "DialogDescriptionWarning", bi = ({ contentRef: t, descriptionId: e }) => {
|
|
2565
2564
|
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gn(_i).contentName}}.`;
|
|
2566
2565
|
return j.useEffect(() => {
|
|
2567
|
-
var
|
|
2568
|
-
const r = (
|
|
2566
|
+
var i;
|
|
2567
|
+
const r = (i = t.current) == null ? void 0 : i.getAttribute("aria-describedby");
|
|
2569
2568
|
e && r && (document.getElementById(e) || console.warn(o));
|
|
2570
2569
|
}, [o, t, e]), null;
|
|
2571
2570
|
}, Ci = En, Pi = Dn, Ti = zn, yi = An, Si = kn, xi = Hn;
|
|
@@ -2578,35 +2577,35 @@ const Ie = {
|
|
|
2578
2577
|
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2579
2578
|
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2580
2579
|
}, Ii = () => {
|
|
2581
|
-
const { pdfProperties: t } = J(), { container: e } = ge(), { activeDocumentProperties: n, setActiveDocumentProperties: o } = ho(), { localeMessages: r } = se(),
|
|
2580
|
+
const { pdfProperties: t } = J(), { container: e } = ge(), { activeDocumentProperties: n, setActiveDocumentProperties: o } = ho(), { localeMessages: r } = se(), i = W(() => {
|
|
2582
2581
|
if (!t)
|
|
2583
2582
|
return [];
|
|
2584
2583
|
const {
|
|
2585
2584
|
fileSize: s,
|
|
2586
2585
|
filename: l,
|
|
2587
|
-
title:
|
|
2588
|
-
author:
|
|
2586
|
+
title: d,
|
|
2587
|
+
author: u,
|
|
2589
2588
|
subject: m,
|
|
2590
|
-
createdOn:
|
|
2589
|
+
createdOn: P,
|
|
2591
2590
|
creator: h,
|
|
2592
|
-
keywords:
|
|
2591
|
+
keywords: _,
|
|
2593
2592
|
modifiedOn: C,
|
|
2594
2593
|
pdfProducer: y,
|
|
2595
|
-
pdfVersion:
|
|
2594
|
+
pdfVersion: w,
|
|
2596
2595
|
pageCount: S
|
|
2597
2596
|
} = t;
|
|
2598
2597
|
return [
|
|
2599
2598
|
{ label: r == null ? void 0 : r.propertiesFilenameLabel, value: l },
|
|
2600
2599
|
{ label: r == null ? void 0 : r.propertiesFileSizeLabel, value: s },
|
|
2601
2600
|
{ separate: !0 },
|
|
2602
|
-
{ label: r == null ? void 0 : r.propertiesTitleLabel, value:
|
|
2603
|
-
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value:
|
|
2601
|
+
{ label: r == null ? void 0 : r.propertiesTitleLabel, value: d },
|
|
2602
|
+
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value: u },
|
|
2604
2603
|
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value: m },
|
|
2605
|
-
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value:
|
|
2604
|
+
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value: _ },
|
|
2606
2605
|
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value: h },
|
|
2607
2606
|
{
|
|
2608
2607
|
label: r == null ? void 0 : r.propertiesCreateOnLabel,
|
|
2609
|
-
value:
|
|
2608
|
+
value: P ? Wt(P) : ""
|
|
2610
2609
|
},
|
|
2611
2610
|
{
|
|
2612
2611
|
label: r == null ? void 0 : r.propertiesModifiedOnLabel,
|
|
@@ -2614,16 +2613,16 @@ const Ie = {
|
|
|
2614
2613
|
},
|
|
2615
2614
|
{ separate: !0 },
|
|
2616
2615
|
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value: y },
|
|
2617
|
-
{ label: r == null ? void 0 : r.propertiesPDFVersionLabel, value:
|
|
2616
|
+
{ label: r == null ? void 0 : r.propertiesPDFVersionLabel, value: w },
|
|
2618
2617
|
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value: S }
|
|
2619
2618
|
];
|
|
2620
2619
|
}, [t, r]);
|
|
2621
|
-
return /* @__PURE__ */
|
|
2622
|
-
/* @__PURE__ */
|
|
2620
|
+
return /* @__PURE__ */ a(Ci, { open: n, onOpenChange: o, children: /* @__PURE__ */ a(Pi, { container: e, children: /* @__PURE__ */ M("div", { className: Ie["rp-dialog-wrapper"], children: [
|
|
2621
|
+
/* @__PURE__ */ a(Ti, { className: Ie["rp-dialog-overlay"] }),
|
|
2623
2622
|
/* @__PURE__ */ M(yi, { className: Ie["rp-document-dialog"], children: [
|
|
2624
|
-
/* @__PURE__ */
|
|
2625
|
-
/* @__PURE__ */
|
|
2626
|
-
/* @__PURE__ */
|
|
2623
|
+
/* @__PURE__ */ a(Si, { className: Ie["rp-dialog-title"], children: r == null ? void 0 : r.documentPropertiesLabel }),
|
|
2624
|
+
/* @__PURE__ */ a("div", { className: Ie["rp-document-properties"], children: i.map((s, l) => /* @__PURE__ */ a("div", { children: s.separate ? /* @__PURE__ */ a("div", { className: Ie["rp-properties-divider"] }) : /* @__PURE__ */ a(po, { label: s.label, value: s.value }) }, l)) }),
|
|
2625
|
+
/* @__PURE__ */ a(xi, { asChild: !0, className: Ie["rp-dialog-close"], children: /* @__PURE__ */ a(uo, {}) })
|
|
2627
2626
|
] })
|
|
2628
2627
|
] }) }) });
|
|
2629
2628
|
}, Ri = {
|
|
@@ -2632,34 +2631,34 @@ const Ie = {
|
|
|
2632
2631
|
const n = await (await fetch(t)).blob();
|
|
2633
2632
|
return Li(n);
|
|
2634
2633
|
}, qn = () => {
|
|
2635
|
-
const { filename: t, pdfSrc: e } = J(), { downloadFilename: n } = mr(), o = (
|
|
2636
|
-
const s = n ||
|
|
2634
|
+
const { filename: t, pdfSrc: e } = J(), { downloadFilename: n } = mr(), o = (i) => {
|
|
2635
|
+
const s = n || i;
|
|
2637
2636
|
return s.endsWith(nn) ? s : `${s}${nn}`;
|
|
2638
2637
|
};
|
|
2639
2638
|
return { download: E(async () => {
|
|
2640
2639
|
if (!t || !e)
|
|
2641
2640
|
throw new Error("There is no PDF source to download");
|
|
2642
|
-
const
|
|
2643
|
-
|
|
2641
|
+
const i = document.createElement("a");
|
|
2642
|
+
i.href = await Ei(e), i.download = o(t), document.body.appendChild(i), i.click(), document.body.removeChild(i);
|
|
2644
2643
|
}, [t, e]) };
|
|
2645
2644
|
}, Un = () => {
|
|
2646
2645
|
const { downloadIcon: t } = pe();
|
|
2647
|
-
return t || /* @__PURE__ */
|
|
2648
|
-
}, Vn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */
|
|
2649
|
-
/* @__PURE__ */
|
|
2646
|
+
return t || /* @__PURE__ */ a(_o, {});
|
|
2647
|
+
}, Vn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Y, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }), Ni = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Vn, { localeMessages: e, children: /* @__PURE__ */ a(ie, { onClick: t, "aria-label": e == null ? void 0 : e.downloadFileTooltip, children: /* @__PURE__ */ a(Un, {}) }) }), Oi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Ce, { onClick: t, children: /* @__PURE__ */ M(Vn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2648
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Un, {}) }),
|
|
2650
2649
|
e == null ? void 0 : e.downloadFileLabel
|
|
2651
2650
|
] }) }), Bn = () => {
|
|
2652
2651
|
const { download: t } = qn(), { downloadTool: e = !0 } = ve(), { isSmallScreen: n } = Pe(), { localeMessages: o } = se();
|
|
2653
|
-
return e ? n ? /* @__PURE__ */
|
|
2652
|
+
return e ? n ? /* @__PURE__ */ a(Oi, { download: t, localeMessages: o }) : typeof e == "function" ? /* @__PURE__ */ a(e, { download: t }) : e ? /* @__PURE__ */ a(Ni, { download: t, localeMessages: o }) : null : null;
|
|
2654
2653
|
}, Zn = () => {
|
|
2655
2654
|
const { printIcon: t } = pe();
|
|
2656
|
-
return t || /* @__PURE__ */
|
|
2657
|
-
}, jn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */
|
|
2658
|
-
/* @__PURE__ */
|
|
2655
|
+
return t || /* @__PURE__ */ a(bo, {});
|
|
2656
|
+
}, jn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Y, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }), Di = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(jn, { localeMessages: e, children: /* @__PURE__ */ a(ie, { onClick: t, "aria-label": e == null ? void 0 : e.printTooltip, children: /* @__PURE__ */ a(Zn, {}) }) }), zi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Ce, { onClick: t, children: /* @__PURE__ */ M(jn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2657
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Zn, {}) }),
|
|
2659
2658
|
e == null ? void 0 : e.printLabel
|
|
2660
2659
|
] }) }), Kn = () => {
|
|
2661
|
-
const { print: t, cancel: e, setOnProgress: n, setOnComplete: o, setOnError: r, progress:
|
|
2662
|
-
return s ? l ? /* @__PURE__ */
|
|
2660
|
+
const { print: t, cancel: e, setOnProgress: n, setOnComplete: o, setOnError: r, progress: i } = tt(), { printTool: s = !0 } = ve(), { isSmallScreen: l } = Pe(), { localeMessages: d } = se();
|
|
2661
|
+
return s ? l ? /* @__PURE__ */ a(zi, { print: t, localeMessages: d }) : typeof s == "function" ? /* @__PURE__ */ a(
|
|
2663
2662
|
s,
|
|
2664
2663
|
{
|
|
2665
2664
|
print: t,
|
|
@@ -2667,72 +2666,72 @@ const Ie = {
|
|
|
2667
2666
|
setOnProgress: n,
|
|
2668
2667
|
setOnError: r,
|
|
2669
2668
|
setOnComplete: o,
|
|
2670
|
-
progress:
|
|
2669
|
+
progress: i
|
|
2671
2670
|
}
|
|
2672
|
-
) : s ? /* @__PURE__ */
|
|
2671
|
+
) : s ? /* @__PURE__ */ a(Di, { print: t, localeMessages: d }) : null : null;
|
|
2673
2672
|
}, Ai = {
|
|
2674
2673
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2675
2674
|
}, Fi = () => {
|
|
2676
2675
|
const { goToFirstPageIcon: t } = pe();
|
|
2677
|
-
return t || /* @__PURE__ */
|
|
2676
|
+
return t || /* @__PURE__ */ a(gn, { className: Ai["rp-go-to-Top"] });
|
|
2678
2677
|
}, ki = () => {
|
|
2679
2678
|
const { goToLastPageIcon: t } = pe();
|
|
2680
|
-
return t || /* @__PURE__ */
|
|
2679
|
+
return t || /* @__PURE__ */ a(gn, {});
|
|
2681
2680
|
}, rn = { width: "100%" }, Wi = () => {
|
|
2682
|
-
const { goToPage: t, totalPages: e, focusedPage: n } = oe(), { jumpNavigationTool: o = !0 } = ve(), { localeMessages: r } = se(),
|
|
2681
|
+
const { goToPage: t, totalPages: e, focusedPage: n } = oe(), { jumpNavigationTool: o = !0 } = ve(), { localeMessages: r } = se(), i = W(() => n === 1, [n]), s = W(() => n === e, [n, e]), l = E(() => {
|
|
2683
2682
|
t(1);
|
|
2684
|
-
}, [t]),
|
|
2683
|
+
}, [t]), d = E(() => {
|
|
2685
2684
|
t(e);
|
|
2686
2685
|
}, [t, e]);
|
|
2687
2686
|
return o ? /* @__PURE__ */ M(Qe, { children: [
|
|
2688
|
-
/* @__PURE__ */
|
|
2689
|
-
/* @__PURE__ */
|
|
2690
|
-
/* @__PURE__ */
|
|
2687
|
+
/* @__PURE__ */ a(Ce, { onClick: l, children: /* @__PURE__ */ a(Y, { content: r == null ? void 0 : r.firstPageTooltip, style: rn, children: /* @__PURE__ */ M("div", { className: "rp-menu-item", "aria-disabled": i, children: [
|
|
2688
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Fi, {}) }),
|
|
2689
|
+
/* @__PURE__ */ a("span", { children: r == null ? void 0 : r.firstPageLabel })
|
|
2691
2690
|
] }) }) }),
|
|
2692
|
-
/* @__PURE__ */
|
|
2693
|
-
/* @__PURE__ */
|
|
2694
|
-
/* @__PURE__ */
|
|
2691
|
+
/* @__PURE__ */ a(Ce, { onClick: d, children: /* @__PURE__ */ a(Y, { content: r == null ? void 0 : r.lastPageTooltip, style: rn, children: /* @__PURE__ */ M("div", { className: "rp-menu-item", "aria-disabled": s, children: [
|
|
2692
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(ki, {}) }),
|
|
2693
|
+
/* @__PURE__ */ a("span", { children: r == null ? void 0 : r.lastPageLabel })
|
|
2695
2694
|
] }) }) }),
|
|
2696
|
-
/* @__PURE__ */
|
|
2695
|
+
/* @__PURE__ */ a(It, {})
|
|
2697
2696
|
] }) : null;
|
|
2698
2697
|
}, Mi = () => {
|
|
2699
2698
|
const [t, e] = G(!1), { container: n, pagesRef: o } = ge(), { isSmallScreen: r } = Pe(), {
|
|
2700
|
-
openFileTool:
|
|
2699
|
+
openFileTool: i,
|
|
2701
2700
|
downloadTool: s,
|
|
2702
2701
|
documentProperties: l,
|
|
2703
|
-
scrollModeTool:
|
|
2704
|
-
rotateTool:
|
|
2702
|
+
scrollModeTool: d,
|
|
2703
|
+
rotateTool: u,
|
|
2705
2704
|
selectionModeTool: m,
|
|
2706
|
-
jumpNavigationTool:
|
|
2705
|
+
jumpNavigationTool: P,
|
|
2707
2706
|
printTool: h,
|
|
2708
|
-
fullscreenTool:
|
|
2709
|
-
} = ve(), { localeMessages: C } = se(), [y,
|
|
2707
|
+
fullscreenTool: _
|
|
2708
|
+
} = ve(), { localeMessages: C } = se(), [y, w] = G(0), S = $(
|
|
2710
2709
|
new ResizeObserver((p) => {
|
|
2711
|
-
|
|
2710
|
+
w(p[0].contentRect.height);
|
|
2712
2711
|
})
|
|
2713
2712
|
), f = W(() => {
|
|
2714
|
-
const p =
|
|
2713
|
+
const p = P || u || m || d || l;
|
|
2715
2714
|
let g = !1;
|
|
2716
|
-
return r && (g = !(!
|
|
2715
|
+
return r && (g = !(!i && !s && !h && !_)), p || g;
|
|
2717
2716
|
}, [
|
|
2718
|
-
|
|
2717
|
+
i,
|
|
2719
2718
|
s,
|
|
2720
2719
|
l,
|
|
2721
|
-
u,
|
|
2722
2720
|
d,
|
|
2721
|
+
u,
|
|
2723
2722
|
m,
|
|
2724
|
-
|
|
2723
|
+
P,
|
|
2725
2724
|
r
|
|
2726
2725
|
]);
|
|
2727
2726
|
return z(() => (o && S.current.observe(o), () => {
|
|
2728
2727
|
S.current.disconnect();
|
|
2729
2728
|
}), [o]), f ? /* @__PURE__ */ M(fo, { children: [
|
|
2730
|
-
/* @__PURE__ */
|
|
2729
|
+
/* @__PURE__ */ a(
|
|
2731
2730
|
yt,
|
|
2732
2731
|
{
|
|
2733
2732
|
container: n,
|
|
2734
2733
|
onOpenChange: e,
|
|
2735
|
-
triggerComponent: /* @__PURE__ */
|
|
2734
|
+
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Y, { content: C == null ? void 0 : C.moreOptionTooltip, children: /* @__PURE__ */ a(ie, { active: t, "aria-label": C == null ? void 0 : C.moreOptionTooltip, children: /* @__PURE__ */ a(Jr, {}) }) }) }),
|
|
2736
2735
|
side: "bottom",
|
|
2737
2736
|
avoidCollisions: !1,
|
|
2738
2737
|
children: /* @__PURE__ */ M(
|
|
@@ -2743,36 +2742,36 @@ const Ie = {
|
|
|
2743
2742
|
"data-rp": "moreOptionsDropdown",
|
|
2744
2743
|
children: [
|
|
2745
2744
|
r && /* @__PURE__ */ M(Qe, { children: [
|
|
2746
|
-
/* @__PURE__ */
|
|
2747
|
-
/* @__PURE__ */
|
|
2748
|
-
/* @__PURE__ */
|
|
2749
|
-
/* @__PURE__ */
|
|
2750
|
-
/* @__PURE__ */
|
|
2745
|
+
/* @__PURE__ */ a(fn, {}),
|
|
2746
|
+
/* @__PURE__ */ a(Bn, {}),
|
|
2747
|
+
/* @__PURE__ */ a(Kn, {}),
|
|
2748
|
+
/* @__PURE__ */ a(mn, {}),
|
|
2749
|
+
/* @__PURE__ */ a(It, {})
|
|
2751
2750
|
] }),
|
|
2752
|
-
/* @__PURE__ */
|
|
2753
|
-
/* @__PURE__ */
|
|
2754
|
-
/* @__PURE__ */
|
|
2755
|
-
/* @__PURE__ */
|
|
2756
|
-
/* @__PURE__ */
|
|
2757
|
-
/* @__PURE__ */
|
|
2751
|
+
/* @__PURE__ */ a(Wi, {}),
|
|
2752
|
+
/* @__PURE__ */ a(go, {}),
|
|
2753
|
+
/* @__PURE__ */ a(Co, {}),
|
|
2754
|
+
/* @__PURE__ */ a(vo, {}),
|
|
2755
|
+
/* @__PURE__ */ a(wo, {}),
|
|
2756
|
+
/* @__PURE__ */ a(mo, {})
|
|
2758
2757
|
]
|
|
2759
2758
|
}
|
|
2760
2759
|
)
|
|
2761
2760
|
}
|
|
2762
2761
|
),
|
|
2763
|
-
/* @__PURE__ */
|
|
2762
|
+
/* @__PURE__ */ a(Ii, {})
|
|
2764
2763
|
] }) : null;
|
|
2765
2764
|
}, Hi = () => {
|
|
2766
2765
|
const { isSmallScreen: t } = Pe();
|
|
2767
2766
|
return /* @__PURE__ */ M(me, { children: [
|
|
2768
|
-
/* @__PURE__ */
|
|
2767
|
+
/* @__PURE__ */ a(Yr, {}),
|
|
2769
2768
|
!t && /* @__PURE__ */ M(me, { children: [
|
|
2770
|
-
/* @__PURE__ */
|
|
2771
|
-
/* @__PURE__ */
|
|
2772
|
-
/* @__PURE__ */
|
|
2773
|
-
/* @__PURE__ */
|
|
2769
|
+
/* @__PURE__ */ a(fn, {}),
|
|
2770
|
+
/* @__PURE__ */ a(Bn, {}),
|
|
2771
|
+
/* @__PURE__ */ a(Kn, {}),
|
|
2772
|
+
/* @__PURE__ */ a(mn, {})
|
|
2774
2773
|
] }),
|
|
2775
|
-
/* @__PURE__ */
|
|
2774
|
+
/* @__PURE__ */ a(Mi, {})
|
|
2776
2775
|
] });
|
|
2777
2776
|
}, $i = "_active_1fv1b_11", Re = {
|
|
2778
2777
|
"rp-zoom-wrapper": "_rp-zoom-wrapper_1fv1b_1",
|
|
@@ -2783,16 +2782,16 @@ const Ie = {
|
|
|
2783
2782
|
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_1fv1b_24"
|
|
2784
2783
|
}, Gi = 25, gt = 1e3, qi = [50, 75, 100, 125, 150, 200, 300, 400], Ui = () => {
|
|
2785
2784
|
const { zoomInIcon: t } = pe();
|
|
2786
|
-
return t || /* @__PURE__ */
|
|
2785
|
+
return t || /* @__PURE__ */ a(Po, {});
|
|
2787
2786
|
}, Vi = () => {
|
|
2788
2787
|
const { zoomOutIcon: t } = pe();
|
|
2789
|
-
return t || /* @__PURE__ */
|
|
2788
|
+
return t || /* @__PURE__ */ a(To, {});
|
|
2790
2789
|
}, Bi = () => {
|
|
2791
|
-
const { zoomLevel: t, setZoomLevel: e } = Je(), { container: n, pagesRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage:
|
|
2790
|
+
const { zoomLevel: t, setZoomLevel: e } = Je(), { container: n, pagesRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: i } = oe(), { pageRotate: s } = Ue(), { pages: l } = J(), { isSmallScreen: d } = Pe(), { localeMessages: u } = se(), { viewMode: m } = Oe(), [P, h] = G(0), [_, C] = G(!1), y = $(
|
|
2792
2791
|
new ResizeObserver((v) => {
|
|
2793
2792
|
h(v[0].contentRect.height);
|
|
2794
2793
|
})
|
|
2795
|
-
),
|
|
2794
|
+
), w = E(() => {
|
|
2796
2795
|
e((v) => {
|
|
2797
2796
|
const T = Math.floor(v / 25) * 25;
|
|
2798
2797
|
return Math.min(T + 25, gt);
|
|
@@ -2803,9 +2802,9 @@ const Ie = {
|
|
|
2803
2802
|
return Math.min(T - 25, gt);
|
|
2804
2803
|
});
|
|
2805
2804
|
}, [e]), f = W(() => t === Gi, [t]), p = W(() => t === gt, [t]), g = W(() => {
|
|
2806
|
-
const v = l.get(
|
|
2807
|
-
return v ? v.page.getViewport({ scale: 1, rotation: s[
|
|
2808
|
-
}, [l,
|
|
2805
|
+
const v = l.get(i);
|
|
2806
|
+
return v ? v.page.getViewport({ scale: 1, rotation: s[i] }) : null;
|
|
2807
|
+
}, [l, i, s]), c = E(
|
|
2809
2808
|
(v) => {
|
|
2810
2809
|
const T = ((g == null ? void 0 : g.width) || 0) + 2 * Mt, R = ((g == null ? void 0 : g.height) || 0) + 2 * Mt, x = (o == null ? void 0 : o.clientWidth) || 0, I = (o == null ? void 0 : o.clientHeight) || 0, O = yo(
|
|
2811
2810
|
v,
|
|
@@ -2818,7 +2817,7 @@ const Ie = {
|
|
|
2818
2817
|
e(O);
|
|
2819
2818
|
},
|
|
2820
2819
|
[e, g, o]
|
|
2821
|
-
),
|
|
2820
|
+
), b = E(
|
|
2822
2821
|
(v) => {
|
|
2823
2822
|
typeof v == "number" ? e(v) : c(v);
|
|
2824
2823
|
},
|
|
@@ -2826,34 +2825,34 @@ const Ie = {
|
|
|
2826
2825
|
);
|
|
2827
2826
|
return z(() => (o && y.current.observe(o), () => {
|
|
2828
2827
|
y.current.disconnect();
|
|
2829
|
-
}), [o]), typeof r != "boolean" ? /* @__PURE__ */
|
|
2830
|
-
/* @__PURE__ */
|
|
2828
|
+
}), [o]), typeof r != "boolean" ? /* @__PURE__ */ a(r, { zoomLevel: t, setZoomLevel: e }) : r ? /* @__PURE__ */ M("div", { className: Re["rp-zoom-wrapper"], children: [
|
|
2829
|
+
/* @__PURE__ */ a(Y, { content: u == null ? void 0 : u.zoomOutTooltip, children: /* @__PURE__ */ a(
|
|
2831
2830
|
ie,
|
|
2832
2831
|
{
|
|
2833
2832
|
disabled: f,
|
|
2834
2833
|
onClick: S,
|
|
2835
|
-
"aria-label":
|
|
2836
|
-
children: /* @__PURE__ */
|
|
2834
|
+
"aria-label": u == null ? void 0 : u.zoomOutTooltip,
|
|
2835
|
+
children: /* @__PURE__ */ a(Vi, {})
|
|
2837
2836
|
}
|
|
2838
2837
|
) }),
|
|
2839
|
-
!
|
|
2838
|
+
!d && /* @__PURE__ */ a(
|
|
2840
2839
|
yt,
|
|
2841
2840
|
{
|
|
2842
2841
|
container: n,
|
|
2843
|
-
open:
|
|
2842
|
+
open: _,
|
|
2844
2843
|
onOpenChange: C,
|
|
2845
|
-
triggerComponent: /* @__PURE__ */
|
|
2844
|
+
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Y, { content: u == null ? void 0 : u.zoomSelectTooltip, children: /* @__PURE__ */ M(
|
|
2846
2845
|
ie,
|
|
2847
2846
|
{
|
|
2848
2847
|
className: re(
|
|
2849
2848
|
Re["rp-current-zoom-wrapper"],
|
|
2850
|
-
|
|
2849
|
+
_ && Re.active
|
|
2851
2850
|
),
|
|
2852
|
-
"aria-label":
|
|
2851
|
+
"aria-label": u == null ? void 0 : u.zoomSelectTooltip,
|
|
2853
2852
|
children: [
|
|
2854
|
-
/* @__PURE__ */
|
|
2855
|
-
/* @__PURE__ */
|
|
2856
|
-
/* @__PURE__ */
|
|
2853
|
+
/* @__PURE__ */ a("span", { className: Re["rp-current-zoom-text"], children: t }),
|
|
2854
|
+
/* @__PURE__ */ a("span", { className: Re["rp-current-zoom-text"], children: "%" }),
|
|
2855
|
+
/* @__PURE__ */ a(He, { className: Re["rp-current-zoom-icon"] })
|
|
2857
2856
|
]
|
|
2858
2857
|
}
|
|
2859
2858
|
) }) }),
|
|
@@ -2864,16 +2863,16 @@ const Ie = {
|
|
|
2864
2863
|
children: /* @__PURE__ */ M(
|
|
2865
2864
|
"div",
|
|
2866
2865
|
{
|
|
2867
|
-
style: { maxHeight: `${
|
|
2866
|
+
style: { maxHeight: `${P}px`, overflow: "auto" },
|
|
2868
2867
|
className: Re["rp-zoom-dropdown-content"],
|
|
2869
2868
|
children: [
|
|
2870
2869
|
/* @__PURE__ */ M(Qe, { children: [
|
|
2871
|
-
/* @__PURE__ */
|
|
2872
|
-
/* @__PURE__ */
|
|
2873
|
-
/* @__PURE__ */
|
|
2870
|
+
/* @__PURE__ */ a(Ce, { onClick: () => b(st.ACTUAL), children: u == null ? void 0 : u.zoomActualSize }),
|
|
2871
|
+
/* @__PURE__ */ a(Ce, { onClick: () => b(st.PAGE_FIT), children: u == null ? void 0 : u.zoomPageFit }),
|
|
2872
|
+
/* @__PURE__ */ a(Ce, { onClick: () => b(st.PAGE_WIDTH), children: u == null ? void 0 : u.zoomPageWidth })
|
|
2874
2873
|
] }),
|
|
2875
|
-
/* @__PURE__ */
|
|
2876
|
-
/* @__PURE__ */
|
|
2874
|
+
/* @__PURE__ */ a(It, {}),
|
|
2875
|
+
/* @__PURE__ */ a(Qe, { children: qi.map((v) => /* @__PURE__ */ M(Ce, { onClick: () => b(v), children: [
|
|
2877
2876
|
v,
|
|
2878
2877
|
" %"
|
|
2879
2878
|
] }, v)) })
|
|
@@ -2882,25 +2881,25 @@ const Ie = {
|
|
|
2882
2881
|
)
|
|
2883
2882
|
}
|
|
2884
2883
|
),
|
|
2885
|
-
/* @__PURE__ */
|
|
2884
|
+
/* @__PURE__ */ a(Y, { content: u == null ? void 0 : u.zoomInTooltip, children: /* @__PURE__ */ a(
|
|
2886
2885
|
ie,
|
|
2887
2886
|
{
|
|
2888
2887
|
disabled: p,
|
|
2889
|
-
onClick:
|
|
2890
|
-
"aria-label":
|
|
2891
|
-
children: /* @__PURE__ */
|
|
2888
|
+
onClick: w,
|
|
2889
|
+
"aria-label": u == null ? void 0 : u.zoomInTooltip,
|
|
2890
|
+
children: /* @__PURE__ */ a(Ui, {})
|
|
2892
2891
|
}
|
|
2893
2892
|
) })
|
|
2894
2893
|
] }) : null;
|
|
2895
2894
|
}, on = () => {
|
|
2896
2895
|
const { totalMatches: t, nextMatch: e, prevMatch: n } = Rt(), { localeMessages: o } = se();
|
|
2897
2896
|
return /* @__PURE__ */ M(me, { children: [
|
|
2898
|
-
/* @__PURE__ */
|
|
2897
|
+
/* @__PURE__ */ a(
|
|
2899
2898
|
Y,
|
|
2900
2899
|
{
|
|
2901
2900
|
content: o == null ? void 0 : o.searchPrevTooltip,
|
|
2902
2901
|
className: te["rp-search-tool-result-navigator"],
|
|
2903
|
-
children: /* @__PURE__ */
|
|
2902
|
+
children: /* @__PURE__ */ a(ie, { tabIndex: 0, onClick: n, "aria-label": o == null ? void 0 : o.searchPrevTooltip, children: /* @__PURE__ */ a(
|
|
2904
2903
|
He,
|
|
2905
2904
|
{
|
|
2906
2905
|
className: te["rp-search-tool-input-icon"],
|
|
@@ -2909,12 +2908,12 @@ const Ie = {
|
|
|
2909
2908
|
) })
|
|
2910
2909
|
}
|
|
2911
2910
|
),
|
|
2912
|
-
/* @__PURE__ */
|
|
2911
|
+
/* @__PURE__ */ a(
|
|
2913
2912
|
Y,
|
|
2914
2913
|
{
|
|
2915
2914
|
content: o == null ? void 0 : o.searchNextTooltip,
|
|
2916
2915
|
className: te["rp-search-tool-result-navigator"],
|
|
2917
|
-
children: /* @__PURE__ */
|
|
2916
|
+
children: /* @__PURE__ */ a(ie, { tabIndex: 0, onClick: e, "aria-label": o == null ? void 0 : o.searchNextTooltip, children: /* @__PURE__ */ a(
|
|
2918
2917
|
He,
|
|
2919
2918
|
{
|
|
2920
2919
|
style: { transform: "rotate(180deg" },
|
|
@@ -2927,23 +2926,23 @@ const Ie = {
|
|
|
2927
2926
|
] });
|
|
2928
2927
|
}, an = () => {
|
|
2929
2928
|
const { searchIcon: t } = pe();
|
|
2930
|
-
return t || /* @__PURE__ */
|
|
2929
|
+
return t || /* @__PURE__ */ a(So, {});
|
|
2931
2930
|
}, Zi = () => {
|
|
2932
|
-
const { container: t } = ge(), [e, n] = G(!1), { pdf: o } = J(), [r,
|
|
2931
|
+
const { container: t } = ge(), [e, n] = G(!1), { pdf: o } = J(), [r, i] = G(null), {
|
|
2933
2932
|
searchOptions: s,
|
|
2934
2933
|
setSearchOptions: l,
|
|
2935
|
-
loading:
|
|
2936
|
-
setSearch:
|
|
2934
|
+
loading: d,
|
|
2935
|
+
setSearch: u,
|
|
2937
2936
|
totalMatches: m,
|
|
2938
|
-
currentMatchPosition:
|
|
2937
|
+
currentMatchPosition: P,
|
|
2939
2938
|
nextMatch: h,
|
|
2940
|
-
prevMatch:
|
|
2939
|
+
prevMatch: _,
|
|
2941
2940
|
search: C
|
|
2942
|
-
} = Rt(), { searchTool: y = !0 } = ve(), [
|
|
2941
|
+
} = Rt(), { searchTool: y = !0 } = ve(), [w, S] = G(C), { localeMessages: f } = se(), { isSmallScreen: p } = Pe(), [g, c] = G(null), b = E(() => {
|
|
2943
2942
|
n(!0);
|
|
2944
2943
|
}, []), v = E(() => {
|
|
2945
|
-
|
|
2946
|
-
}, [
|
|
2944
|
+
u(""), S(""), n(!1);
|
|
2945
|
+
}, [u]), T = (H) => {
|
|
2947
2946
|
const U = H.key === "Enter", V = H.key === " ";
|
|
2948
2947
|
(U || V) && v();
|
|
2949
2948
|
}, R = E(
|
|
@@ -2953,9 +2952,9 @@ const Ie = {
|
|
|
2953
2952
|
[e]
|
|
2954
2953
|
), x = E(
|
|
2955
2954
|
(H) => {
|
|
2956
|
-
H.shiftKey && H.key === "Enter" ?
|
|
2955
|
+
H.shiftKey && H.key === "Enter" ? _() : H.key === "Enter" && C !== w ? u(w) : H.key === "Enter" && h();
|
|
2957
2956
|
},
|
|
2958
|
-
[
|
|
2957
|
+
[w, _, h, u, C]
|
|
2959
2958
|
);
|
|
2960
2959
|
z(() => (window.addEventListener("keydown", R), () => {
|
|
2961
2960
|
window.removeEventListener("keydown", R);
|
|
@@ -2967,8 +2966,8 @@ const Ie = {
|
|
|
2967
2966
|
const I = E((H) => {
|
|
2968
2967
|
S(H.target.value);
|
|
2969
2968
|
}, []), O = E(() => {
|
|
2970
|
-
S(""),
|
|
2971
|
-
}, [
|
|
2969
|
+
S(""), u("");
|
|
2970
|
+
}, [u]), A = W(() => `${P} / ${m}`, [P, m]), { wholeWords: F, matchCase: L } = W(() => s, [s]), N = E(
|
|
2972
2971
|
(H) => {
|
|
2973
2972
|
l((U) => ({ ...U, matchCase: H }));
|
|
2974
2973
|
},
|
|
@@ -3006,7 +3005,7 @@ const Ie = {
|
|
|
3006
3005
|
},
|
|
3007
3006
|
[k]
|
|
3008
3007
|
);
|
|
3009
|
-
return y ? /* @__PURE__ */
|
|
3008
|
+
return y ? /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a(
|
|
3010
3009
|
yt,
|
|
3011
3010
|
{
|
|
3012
3011
|
open: e,
|
|
@@ -3015,13 +3014,13 @@ const Ie = {
|
|
|
3015
3014
|
align: "start",
|
|
3016
3015
|
tabIndex: 0,
|
|
3017
3016
|
avoidCollisions: !1,
|
|
3018
|
-
triggerComponent: /* @__PURE__ */
|
|
3017
|
+
triggerComponent: /* @__PURE__ */ a(Y, { content: f == null ? void 0 : f.searchButtonTooltip, children: /* @__PURE__ */ a(
|
|
3019
3018
|
ie,
|
|
3020
3019
|
{
|
|
3021
|
-
onClick:
|
|
3020
|
+
onClick: b,
|
|
3022
3021
|
active: e,
|
|
3023
3022
|
"aria-label": f == null ? void 0 : f.searchButtonTooltip,
|
|
3024
|
-
children: /* @__PURE__ */
|
|
3023
|
+
children: /* @__PURE__ */ a(an, {})
|
|
3025
3024
|
}
|
|
3026
3025
|
) }),
|
|
3027
3026
|
children: /* @__PURE__ */ M(
|
|
@@ -3034,28 +3033,28 @@ const Ie = {
|
|
|
3034
3033
|
children: [
|
|
3035
3034
|
/* @__PURE__ */ M("div", { className: te["rp-search-tool-input-wrapper"], children: [
|
|
3036
3035
|
/* @__PURE__ */ M("div", { className: te["rp-search-tool-input"], children: [
|
|
3037
|
-
/* @__PURE__ */
|
|
3036
|
+
/* @__PURE__ */ a(Y, { content: f == null ? void 0 : f.searchInputTooltip, children: /* @__PURE__ */ a(
|
|
3038
3037
|
dn,
|
|
3039
3038
|
{
|
|
3040
|
-
value:
|
|
3039
|
+
value: w,
|
|
3041
3040
|
onKeyDown: x,
|
|
3042
3041
|
onChange: I,
|
|
3043
|
-
icon: /* @__PURE__ */
|
|
3042
|
+
icon: /* @__PURE__ */ a(an, {}),
|
|
3044
3043
|
placeholder: f == null ? void 0 : f.searchInputPlaceholder,
|
|
3045
3044
|
className: te["rp-search-input"],
|
|
3046
|
-
ref:
|
|
3045
|
+
ref: i,
|
|
3047
3046
|
id: "search-input",
|
|
3048
3047
|
name: "search-input",
|
|
3049
3048
|
tabIndex: 0,
|
|
3050
|
-
children: !!
|
|
3049
|
+
children: !!w && /* @__PURE__ */ a("span", { className: te["rp-search-tool-input-clear"], onClick: O, children: /* @__PURE__ */ a(xo, {}) })
|
|
3051
3050
|
}
|
|
3052
3051
|
) }),
|
|
3053
|
-
|
|
3054
|
-
p && /* @__PURE__ */
|
|
3052
|
+
d ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(Pt, { className: te["rp-search-loader-icon"] }) }) : /* @__PURE__ */ a("span", { children: A }),
|
|
3053
|
+
p && /* @__PURE__ */ a("div", { className: te["rp-search-tool-controls"], children: /* @__PURE__ */ a(Ht, { onKeyPress: T, handleClose: v }) })
|
|
3055
3054
|
] }),
|
|
3056
3055
|
/* @__PURE__ */ M("div", { className: te["rp-search-tool-input-checkboxes"], children: [
|
|
3057
|
-
p && /* @__PURE__ */
|
|
3058
|
-
/* @__PURE__ */
|
|
3056
|
+
p && /* @__PURE__ */ a(on, {}),
|
|
3057
|
+
/* @__PURE__ */ a(
|
|
3059
3058
|
$t,
|
|
3060
3059
|
{
|
|
3061
3060
|
tabIndex: 0,
|
|
@@ -3065,8 +3064,8 @@ const Ie = {
|
|
|
3065
3064
|
children: f == null ? void 0 : f.searchMatchCaseLabel
|
|
3066
3065
|
}
|
|
3067
3066
|
),
|
|
3068
|
-
!p && /* @__PURE__ */
|
|
3069
|
-
/* @__PURE__ */
|
|
3067
|
+
!p && /* @__PURE__ */ a(Y, { content: f == null ? void 0 : f.searchMatchCaseTooltip, children: /* @__PURE__ */ a("div", { className: te["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ a(Gt, {}) }) }),
|
|
3068
|
+
/* @__PURE__ */ a(
|
|
3070
3069
|
$t,
|
|
3071
3070
|
{
|
|
3072
3071
|
tabIndex: 0,
|
|
@@ -3076,12 +3075,12 @@ const Ie = {
|
|
|
3076
3075
|
children: f == null ? void 0 : f.searchWholeWordsLabel
|
|
3077
3076
|
}
|
|
3078
3077
|
),
|
|
3079
|
-
!p && /* @__PURE__ */
|
|
3078
|
+
!p && /* @__PURE__ */ a(Y, { content: f == null ? void 0 : f.searchWholeWordsTooltip, children: /* @__PURE__ */ a("div", { tabIndex: 0, className: te["rp-search-icon-info"], children: /* @__PURE__ */ a(Gt, {}) }) })
|
|
3080
3079
|
] })
|
|
3081
3080
|
] }),
|
|
3082
3081
|
!p && /* @__PURE__ */ M("div", { className: te["rp-search-tool-controls"], children: [
|
|
3083
|
-
/* @__PURE__ */
|
|
3084
|
-
/* @__PURE__ */
|
|
3082
|
+
/* @__PURE__ */ a(on, {}),
|
|
3083
|
+
/* @__PURE__ */ a(Ht, { onKeyPress: T, handleClose: v })
|
|
3085
3084
|
] })
|
|
3086
3085
|
]
|
|
3087
3086
|
}
|
|
@@ -3098,32 +3097,32 @@ const Ie = {
|
|
|
3098
3097
|
loading: ji
|
|
3099
3098
|
}, Ki = ({ percentage: t }) => {
|
|
3100
3099
|
const { cancel: e } = tt(), { localeMessages: n } = se();
|
|
3101
|
-
return t < 1 ? null : /* @__PURE__ */
|
|
3100
|
+
return t < 1 ? null : /* @__PURE__ */ a("div", { className: re(ze["rp-loading-overlay"]), children: /* @__PURE__ */ M("div", { className: re(ze["rp-loading-modal"]), children: [
|
|
3102
3101
|
/* @__PURE__ */ M("div", { className: re(ze["rp-loading-title"]), children: [
|
|
3103
3102
|
n == null ? void 0 : n.printLoadingMessage,
|
|
3104
3103
|
"..."
|
|
3105
3104
|
] }),
|
|
3106
|
-
/* @__PURE__ */
|
|
3105
|
+
/* @__PURE__ */ a("div", { className: re(ze["rp-loading-progress-bar"]), children: /* @__PURE__ */ a(
|
|
3107
3106
|
"div",
|
|
3108
3107
|
{
|
|
3109
3108
|
className: re(ze["rp-loading-progress"]),
|
|
3110
3109
|
style: { width: `${t}%` }
|
|
3111
3110
|
}
|
|
3112
3111
|
) }),
|
|
3113
|
-
/* @__PURE__ */
|
|
3112
|
+
/* @__PURE__ */ a("button", { className: re(ze["rp-loading-cancel-button"]), onClick: e, children: n == null ? void 0 : n.printCancelLabel })
|
|
3114
3113
|
] }) });
|
|
3115
3114
|
}, Xi = Ve((t, e) => {
|
|
3116
|
-
const { showPrintProgress: n } = ve(), { progress: o } = tt(), { isSmallScreen: r } = Pe(), { percentage:
|
|
3115
|
+
const { showPrintProgress: n } = ve(), { progress: o } = tt(), { isSmallScreen: r } = Pe(), { percentage: i } = o || {}, s = () => r ? { gridTemplateColumns: "25% 60% 15%" } : void 0;
|
|
3117
3116
|
return /* @__PURE__ */ M("div", { children: [
|
|
3118
|
-
/* @__PURE__ */
|
|
3117
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBar", ref: e, className: ke["rp-toolbar-content"], children: /* @__PURE__ */ M("div", { className: ke["rp-toolbar-wrapper"], style: s(), children: [
|
|
3119
3118
|
/* @__PURE__ */ M("div", { "data-rp": "topBarLeft", className: ke["rp-toolbar-start"], children: [
|
|
3120
|
-
/* @__PURE__ */
|
|
3121
|
-
/* @__PURE__ */
|
|
3119
|
+
/* @__PURE__ */ a(Zi, {}),
|
|
3120
|
+
/* @__PURE__ */ a(li, {})
|
|
3122
3121
|
] }),
|
|
3123
|
-
/* @__PURE__ */
|
|
3124
|
-
/* @__PURE__ */
|
|
3122
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarCenter", className: ke["rp-toolbar-middle"], children: /* @__PURE__ */ a(Bi, {}) }),
|
|
3123
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarRight", className: ke["rp-toolbar-end"], children: /* @__PURE__ */ a(Hi, {}) })
|
|
3125
3124
|
] }) }),
|
|
3126
|
-
n &&
|
|
3125
|
+
n && i ? /* @__PURE__ */ a(Ki, { percentage: i }) : null
|
|
3127
3126
|
] });
|
|
3128
3127
|
}), vt = {
|
|
3129
3128
|
"rp-sidebar-content-wrapper": "_rp-sidebar-content-wrapper_1sdl6_1",
|
|
@@ -3137,25 +3136,25 @@ const Ie = {
|
|
|
3137
3136
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
3138
3137
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
3139
3138
|
}, Qi = (t) => {
|
|
3140
|
-
const { pageNumber: e, isFocused: n, viewport: o } = t, { goToPage: r } = oe(), { pageRotate:
|
|
3139
|
+
const { pageNumber: e, isFocused: n, viewport: o } = t, { goToPage: r } = oe(), { pageRotate: i } = Ue(), s = $(null), l = yn(), { pages: d } = J(), [u, m] = G(null), P = $(!1), h = W(() => n ? We["rp-thumbnail-active"] : "", [n]), _ = W(() => ({
|
|
3141
3140
|
width: Math.round(o.width),
|
|
3142
3141
|
height: Math.round(o.height)
|
|
3143
3142
|
}), [o]), C = E(() => {
|
|
3144
3143
|
e && r(e);
|
|
3145
3144
|
}, [r, e]);
|
|
3146
3145
|
return z(() => {
|
|
3147
|
-
const y =
|
|
3148
|
-
if (!s.current || !e || !y ||
|
|
3146
|
+
const y = d.get(e);
|
|
3147
|
+
if (!s.current || !e || !y || u)
|
|
3149
3148
|
return;
|
|
3150
|
-
const
|
|
3149
|
+
const w = new IntersectionObserver((S) => {
|
|
3151
3150
|
S.forEach((f) => {
|
|
3152
|
-
if (
|
|
3153
|
-
|
|
3151
|
+
if (P.current) {
|
|
3152
|
+
P.current = !1, l.removeQueue(`thumbnail-${e}`);
|
|
3154
3153
|
return;
|
|
3155
3154
|
}
|
|
3156
3155
|
if (f.isIntersecting) {
|
|
3157
3156
|
const p = document.createElement("canvas");
|
|
3158
|
-
|
|
3157
|
+
P.current = !0, l.enqueue(
|
|
3159
3158
|
`thumbnail-${e}`,
|
|
3160
3159
|
{
|
|
3161
3160
|
page: y.page,
|
|
@@ -3177,10 +3176,10 @@ const Ie = {
|
|
|
3177
3176
|
}
|
|
3178
3177
|
});
|
|
3179
3178
|
});
|
|
3180
|
-
return s.current &&
|
|
3181
|
-
|
|
3179
|
+
return s.current && w.observe(s.current), () => {
|
|
3180
|
+
w.disconnect(), l.removeQueue(`thumbnail-${e}`);
|
|
3182
3181
|
};
|
|
3183
|
-
}, [l, e,
|
|
3182
|
+
}, [l, e, d, u]), /* @__PURE__ */ M(
|
|
3184
3183
|
"div",
|
|
3185
3184
|
{
|
|
3186
3185
|
onClick: C,
|
|
@@ -3188,35 +3187,35 @@ const Ie = {
|
|
|
3188
3187
|
className: We["rp-thumbnail-wrapper"],
|
|
3189
3188
|
ref: s,
|
|
3190
3189
|
children: [
|
|
3191
|
-
/* @__PURE__ */
|
|
3190
|
+
/* @__PURE__ */ a(
|
|
3192
3191
|
"div",
|
|
3193
3192
|
{
|
|
3194
3193
|
style: {
|
|
3195
|
-
transform: `rotate(${
|
|
3194
|
+
transform: `rotate(${i[e || 0]}deg)`
|
|
3196
3195
|
},
|
|
3197
3196
|
className: re(h, We["rp-thumbnail"]),
|
|
3198
|
-
children:
|
|
3197
|
+
children: u ? /* @__PURE__ */ a(
|
|
3199
3198
|
"img",
|
|
3200
3199
|
{
|
|
3201
|
-
src:
|
|
3202
|
-
width:
|
|
3203
|
-
height:
|
|
3200
|
+
src: u,
|
|
3201
|
+
width: _.width,
|
|
3202
|
+
height: _.height,
|
|
3204
3203
|
alt: "thumbnail"
|
|
3205
3204
|
}
|
|
3206
|
-
) : /* @__PURE__ */
|
|
3205
|
+
) : /* @__PURE__ */ a(
|
|
3207
3206
|
"div",
|
|
3208
3207
|
{
|
|
3209
3208
|
className: We["rp-thumbnail-loader"],
|
|
3210
3209
|
style: {
|
|
3211
|
-
width: `${
|
|
3212
|
-
height: `${
|
|
3210
|
+
width: `${_.width}px`,
|
|
3211
|
+
height: `${_.height}px`
|
|
3213
3212
|
},
|
|
3214
|
-
children: /* @__PURE__ */
|
|
3213
|
+
children: /* @__PURE__ */ a(Pt, {})
|
|
3215
3214
|
}
|
|
3216
3215
|
)
|
|
3217
3216
|
}
|
|
3218
3217
|
),
|
|
3219
|
-
/* @__PURE__ */
|
|
3218
|
+
/* @__PURE__ */ a("div", { className: We["rp-thumbnail-text"], children: e })
|
|
3220
3219
|
]
|
|
3221
3220
|
}
|
|
3222
3221
|
);
|
|
@@ -3227,51 +3226,51 @@ const Ie = {
|
|
|
3227
3226
|
const n = t == null ? void 0 : t.querySelector(`#page-${e}`);
|
|
3228
3227
|
t && (n != null && n.offsetTop) && (t.scrollTop = (n == null ? void 0 : n.offsetTop) - Yi);
|
|
3229
3228
|
}, ea = Ve((t, e) => {
|
|
3230
|
-
const { show: n } = t, { focusedPage: o, totalPages: r } = oe(), { thumbnailPages:
|
|
3231
|
-
cn(e, () =>
|
|
3232
|
-
const
|
|
3233
|
-
const
|
|
3234
|
-
|
|
3229
|
+
const { show: n } = t, { focusedPage: o, totalPages: r } = oe(), { thumbnailPages: i, addPage: s, thumbnailLength: l, addToPage: d } = Cn(), u = $(null), m = $(1);
|
|
3230
|
+
cn(e, () => u.current);
|
|
3231
|
+
const P = W(() => Object.values(i), [i]), h = E(() => {
|
|
3232
|
+
const _ = l + 1;
|
|
3233
|
+
_ <= r && s(_);
|
|
3235
3234
|
}, [s, r, l]);
|
|
3236
3235
|
return z(() => {
|
|
3237
|
-
o > l ?
|
|
3238
|
-
}, [o, l,
|
|
3239
|
-
var y,
|
|
3240
|
-
return /* @__PURE__ */
|
|
3236
|
+
o > l ? d(o) : n && m.current !== o && (Ji(u.current, o), m.current = o);
|
|
3237
|
+
}, [o, l, d, n, P]), Pr(u.current, h), /* @__PURE__ */ a("div", { ref: u, className: sn["rp-thumbnails-container"], children: /* @__PURE__ */ a("div", { className: sn["rp-thumbnails"], children: n ? P.map((_, C) => {
|
|
3238
|
+
var y, w;
|
|
3239
|
+
return /* @__PURE__ */ a(
|
|
3241
3240
|
Qi,
|
|
3242
3241
|
{
|
|
3243
|
-
isFocused: o === ((y =
|
|
3244
|
-
pageNumber: (
|
|
3245
|
-
loading:
|
|
3246
|
-
viewport:
|
|
3247
|
-
defaultRotation:
|
|
3242
|
+
isFocused: o === ((y = _.page) == null ? void 0 : y.pageNumber),
|
|
3243
|
+
pageNumber: (w = _.page) == null ? void 0 : w.pageNumber,
|
|
3244
|
+
loading: _.loading,
|
|
3245
|
+
viewport: _.viewport,
|
|
3246
|
+
defaultRotation: _.defaultRotation
|
|
3248
3247
|
},
|
|
3249
3248
|
C
|
|
3250
3249
|
);
|
|
3251
3250
|
}) : null }) });
|
|
3252
3251
|
}), ta = () => {
|
|
3253
3252
|
const { thumbnailIcon: t } = pe();
|
|
3254
|
-
return t || /* @__PURE__ */
|
|
3253
|
+
return t || /* @__PURE__ */ a(wr, {});
|
|
3255
3254
|
}, na = () => {
|
|
3256
|
-
const { active: t, setActive: e } = Cn(), [n, o] = G(200), r = $(null), { thumbnailTool:
|
|
3255
|
+
const { active: t, setActive: e } = Cn(), [n, o] = G(200), r = $(null), { thumbnailTool: i, sidebarEnable: s } = ve(), { localeMessages: l } = se(), d = E(() => {
|
|
3257
3256
|
e((m) => !m);
|
|
3258
|
-
}, []),
|
|
3257
|
+
}, []), u = W(() => typeof i != "boolean" && i ? /* @__PURE__ */ a(i, { onClick: d, active: t }) : i ? /* @__PURE__ */ a(Y, { content: l == null ? void 0 : l.thumbnailTooltip, children: /* @__PURE__ */ a(
|
|
3259
3258
|
ie,
|
|
3260
3259
|
{
|
|
3261
|
-
onClick:
|
|
3260
|
+
onClick: d,
|
|
3262
3261
|
active: t,
|
|
3263
3262
|
"aria-label": l == null ? void 0 : l.thumbnailTooltip,
|
|
3264
|
-
children: /* @__PURE__ */
|
|
3263
|
+
children: /* @__PURE__ */ a(ta, {})
|
|
3265
3264
|
}
|
|
3266
|
-
) }) : null, [
|
|
3267
|
-
return /* @__PURE__ */
|
|
3265
|
+
) }) : null, [i, t, d, l]);
|
|
3266
|
+
return /* @__PURE__ */ a(me, { children: s && /* @__PURE__ */ M(
|
|
3268
3267
|
"div",
|
|
3269
3268
|
{
|
|
3270
3269
|
style: { "--rp-thumbnail-width": `${n}px` },
|
|
3271
3270
|
className: vt["rp-sidebar-content-wrapper"],
|
|
3272
3271
|
"data-rp": "sidebar",
|
|
3273
3272
|
children: [
|
|
3274
|
-
/* @__PURE__ */
|
|
3273
|
+
/* @__PURE__ */ a("div", { className: vt["rp-sidebar-content"], children: u }),
|
|
3275
3274
|
/* @__PURE__ */ M(
|
|
3276
3275
|
"div",
|
|
3277
3276
|
{
|
|
@@ -3279,8 +3278,8 @@ const Ie = {
|
|
|
3279
3278
|
hidden: !t,
|
|
3280
3279
|
className: vt["rp-thumbnails-wrapper"],
|
|
3281
3280
|
children: [
|
|
3282
|
-
/* @__PURE__ */
|
|
3283
|
-
/* @__PURE__ */
|
|
3281
|
+
/* @__PURE__ */ a(ea, { show: t, ref: r }),
|
|
3282
|
+
/* @__PURE__ */ a(Tr, { onWidthChange: o, thumbnailRef: r })
|
|
3284
3283
|
]
|
|
3285
3284
|
}
|
|
3286
3285
|
)
|
|
@@ -3292,27 +3291,27 @@ const Ie = {
|
|
|
3292
3291
|
children: n,
|
|
3293
3292
|
slots: o,
|
|
3294
3293
|
icons: r,
|
|
3295
|
-
style:
|
|
3294
|
+
style: i,
|
|
3296
3295
|
className: s,
|
|
3297
3296
|
mobileWidth: l,
|
|
3298
|
-
onLoaded:
|
|
3299
|
-
cleanupOnLoaded:
|
|
3297
|
+
onLoaded: d,
|
|
3298
|
+
cleanupOnLoaded: u,
|
|
3300
3299
|
onLayoutWidthChange: m
|
|
3301
|
-
} = t, [
|
|
3302
|
-
return z(() => (
|
|
3303
|
-
|
|
3304
|
-
}), [
|
|
3300
|
+
} = t, [P, h] = G(null), { setContainer: _, setContentRef: C } = ge(), { loading: y } = J(), { LoaderImageComponent: w } = hn();
|
|
3301
|
+
return z(() => (d && d(), () => {
|
|
3302
|
+
u && u();
|
|
3303
|
+
}), [d, u]), /* @__PURE__ */ a(Rn, { toolbarRef: P, ref: e, children: /* @__PURE__ */ a(Ir, { mobileWidth: l, onLayoutWidthChange: m, children: /* @__PURE__ */ a(Cr, { slots: o, children: /* @__PURE__ */ a(yr, { icons: r, children: /* @__PURE__ */ M(Sr, { getContainerRef: _, style: i, className: s, children: [
|
|
3305
3304
|
/* @__PURE__ */ M(xr, { children: [
|
|
3306
3305
|
/* @__PURE__ */ M("div", { className: be["rp-layout"], children: [
|
|
3307
|
-
/* @__PURE__ */
|
|
3306
|
+
/* @__PURE__ */ a(Xi, { ref: h }),
|
|
3308
3307
|
/* @__PURE__ */ M("div", { className: be["rp-content"], children: [
|
|
3309
|
-
/* @__PURE__ */
|
|
3310
|
-
/* @__PURE__ */
|
|
3308
|
+
/* @__PURE__ */ a("div", { className: be["rp-sidebar"], children: /* @__PURE__ */ a(na, {}) }),
|
|
3309
|
+
/* @__PURE__ */ a("div", { ref: C, className: be["rp-pages"], children: n })
|
|
3311
3310
|
] })
|
|
3312
3311
|
] }),
|
|
3313
|
-
/* @__PURE__ */
|
|
3312
|
+
/* @__PURE__ */ a(br, {})
|
|
3314
3313
|
] }),
|
|
3315
|
-
y ? /* @__PURE__ */
|
|
3314
|
+
y ? /* @__PURE__ */ a(
|
|
3316
3315
|
"div",
|
|
3317
3316
|
{
|
|
3318
3317
|
className: be["rp-loader"],
|
|
@@ -3325,7 +3324,7 @@ const Ie = {
|
|
|
3325
3324
|
width: "100%",
|
|
3326
3325
|
height: "100%"
|
|
3327
3326
|
},
|
|
3328
|
-
children: /* @__PURE__ */
|
|
3327
|
+
children: /* @__PURE__ */ a(
|
|
3329
3328
|
"div",
|
|
3330
3329
|
{
|
|
3331
3330
|
style: {
|
|
@@ -3335,7 +3334,7 @@ const Ie = {
|
|
|
3335
3334
|
height: "100%",
|
|
3336
3335
|
width: "100%"
|
|
3337
3336
|
},
|
|
3338
|
-
children:
|
|
3337
|
+
children: w && /* @__PURE__ */ a(w, {})
|
|
3339
3338
|
}
|
|
3340
3339
|
)
|
|
3341
3340
|
}
|