@pdf-viewer/react 1.7.0-beta.0 → 1.7.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RPDefaultLayout-8c323c9f.js → RPDefaultLayout-d6cd2d0c.js} +693 -687
- package/dist/assets/PasswordModal.css +1 -1
- package/dist/assets/RPDefaultLayout.css +1 -1
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +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/components/ui/PasswordModal.js +14 -14
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/main.js +1 -1
- package/dist/types/utils/types.d.ts +1 -0
- package/dist/utils/hooks/useFileDownload.js +1 -1
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLoadPdf.js +21 -25
- 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/dist/utils/types.js +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { useRef as H, useEffect as k, useCallback as N, useState as $, useMemo a
|
|
|
4
4
|
import { ChevronUpIcon as Me } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as re } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as ln } from "./components/ui/Input.js";
|
|
7
|
-
import { ViewMode as He, ScrollMode as ee, AnnotationSubType as
|
|
7
|
+
import { ViewMode as He, ScrollMode as ee, AnnotationSubType as At, SelectionMode as tr, ZoomLevel as at } from "./utils/types.js";
|
|
8
8
|
import { useScrollModeContext as De } from "./contexts/ScrollModeContext.js";
|
|
9
9
|
import { useDocumentContext as J } from "./contexts/RPDocumentContext.js";
|
|
10
10
|
import { useDocumentPasswordContext as nr } from "./contexts/DocumentPasswordContext.js";
|
|
@@ -12,7 +12,7 @@ import { useDarkModeContext as rr } from "./contexts/DarkModeContext.js";
|
|
|
12
12
|
import { useRotationContext as Ge } from "./contexts/RotationContext.js";
|
|
13
13
|
import { useLayerContext as or } from "./contexts/LayerContext.js";
|
|
14
14
|
import { useZoomContext as Qe } from "./contexts/ZoomContext.js";
|
|
15
|
-
import { useViewModeContext as
|
|
15
|
+
import { useViewModeContext as Ae } from "./contexts/ViewModeContext.js";
|
|
16
16
|
import { useVirtualScrollContext as et } from "./contexts/VirtualScrollContext.js";
|
|
17
17
|
import { useVirtualGridContext as dn } from "./contexts/VirtualGridContext.js";
|
|
18
18
|
import { useSelectionModeContext as ir } from "./contexts/SelectionModeContext.js";
|
|
@@ -47,8 +47,8 @@ import { useThemeContext as Pr } from "./contexts/ThemeContext.js";
|
|
|
47
47
|
import * as Sr from "pdfjs-dist";
|
|
48
48
|
import { PixelsPerInch as yr, AnnotationMode as xr, RenderingCancelledException as Ir, AnnotationLayer as Rr } from "pdfjs-dist";
|
|
49
49
|
import { SimpleLinkService as Lr } from "./utils/link_service.js";
|
|
50
|
-
import { annotationsEvents as Er, annotationEventsHandler as Nr, handleClick as
|
|
51
|
-
import { normalizeSingleKeyword as
|
|
50
|
+
import { annotationsEvents as Er, annotationEventsHandler as Nr, handleClick as zt, handleAnnotationWidget as Or, handleAnnotationLink as Dr, bindLayerEvents as Ar, unbindLayerEvents as Ft } from "./utils/annotations.js";
|
|
51
|
+
import { normalizeSingleKeyword as zr, sortHighlightPosition as Fr, unwrap as kr } from "./components/page/searchHighlight.js";
|
|
52
52
|
import { _ as Wr, U as Mr } from "./Popover-b7402893.js";
|
|
53
53
|
import { useMousePressed as Hr } from "./utils/hooks/useMousePressed.js";
|
|
54
54
|
import { useGrabScroll as $r } from "./utils/hooks/useGrabScroll.js";
|
|
@@ -94,14 +94,14 @@ import { UICheckbox as $t } from "./components/ui/Checkbox.js";
|
|
|
94
94
|
import { ClearIcon as To } from "./components/icons/ClearIcon.js";
|
|
95
95
|
import { InfoIcon as Gt } from "./components/icons/InfoIcon.js";
|
|
96
96
|
import './assets/RPDefaultLayout.css';const vn = () => {
|
|
97
|
-
const { viewMode: e } =
|
|
97
|
+
const { viewMode: e } = Ae(), { scrollMode: t } = De(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = et(), { setFocusedPage: a } = ie(), s = H(), { columnCount: l } = dn(), { widths: u, heights: h } = qe(), m = H(t), v = H(e), p = H(l), { targetScrollPage: w } = un();
|
|
98
98
|
k(() => {
|
|
99
|
-
n != null && n.scrollToItem && (
|
|
99
|
+
n != null && n.scrollToItem && (s.current = n);
|
|
100
100
|
}, [n]), k(() => {
|
|
101
101
|
m.current = t, v.current = e;
|
|
102
102
|
}, [t, e]);
|
|
103
103
|
const T = N(
|
|
104
|
-
(C,
|
|
104
|
+
(C, S) => {
|
|
105
105
|
if (!r)
|
|
106
106
|
return;
|
|
107
107
|
const d = Math.ceil(C / 2) * 2 - 1;
|
|
@@ -120,7 +120,7 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
120
120
|
};
|
|
121
121
|
return r == null ? void 0 : r.scrollTo({
|
|
122
122
|
...f,
|
|
123
|
-
behavior:
|
|
123
|
+
behavior: S
|
|
124
124
|
});
|
|
125
125
|
},
|
|
126
126
|
[r, u, st]
|
|
@@ -128,24 +128,24 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
128
128
|
return k(() => {
|
|
129
129
|
m.current = t, v.current = e;
|
|
130
130
|
}, [t, e]), k(() => {
|
|
131
|
-
|
|
132
|
-
}, [
|
|
133
|
-
(C,
|
|
131
|
+
p.current = l;
|
|
132
|
+
}, [l]), { scrollToPage: N(
|
|
133
|
+
(C, S = "smooth") => {
|
|
134
134
|
a(C);
|
|
135
135
|
const d = C - 1;
|
|
136
136
|
let f = d, g = 0;
|
|
137
137
|
if (v.current === He.DUAL_PAGE && m.current === ee.PAGE_SCROLLING) {
|
|
138
|
-
T(C,
|
|
138
|
+
T(C, S);
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
141
|
if (m.current === ee.PAGE_SCROLLING) {
|
|
142
142
|
a(C);
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
|
-
if (!
|
|
145
|
+
if (!s.current || !o)
|
|
146
146
|
return;
|
|
147
147
|
const c = o;
|
|
148
|
-
if (
|
|
148
|
+
if (w.current = C, m.current === ee.HORIZONTAL_SCROLLING) {
|
|
149
149
|
g = d;
|
|
150
150
|
const P = {
|
|
151
151
|
left: Oe(u, g),
|
|
@@ -153,73 +153,73 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
153
153
|
};
|
|
154
154
|
return c.scrollTo({
|
|
155
155
|
...P,
|
|
156
|
-
behavior:
|
|
156
|
+
behavior: S
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
if (v.current === He.DUAL_PAGE) {
|
|
160
160
|
g = d % 2, f = Math.floor(d / 2);
|
|
161
161
|
const P = {
|
|
162
162
|
left: Oe(u, g),
|
|
163
|
-
top: Oe(
|
|
163
|
+
top: Oe(h, f)
|
|
164
164
|
};
|
|
165
165
|
return c.scrollTo({
|
|
166
166
|
...P,
|
|
167
|
-
behavior:
|
|
167
|
+
behavior: S
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
const b = {
|
|
171
171
|
left: 0,
|
|
172
|
-
top: Oe(
|
|
172
|
+
top: Oe(h, f)
|
|
173
173
|
};
|
|
174
174
|
return c.scrollTo({
|
|
175
175
|
...b,
|
|
176
|
-
behavior:
|
|
176
|
+
behavior: S
|
|
177
177
|
});
|
|
178
178
|
},
|
|
179
179
|
[
|
|
180
180
|
o,
|
|
181
|
-
|
|
181
|
+
l,
|
|
182
182
|
T,
|
|
183
183
|
a,
|
|
184
184
|
st,
|
|
185
|
-
|
|
185
|
+
h,
|
|
186
186
|
u
|
|
187
187
|
]
|
|
188
188
|
) };
|
|
189
189
|
}, Po = (e = 1) => {
|
|
190
|
-
const [t, n] = $(e), [o, r] = $(0), { scrollToPage: a } = vn(),
|
|
190
|
+
const [t, n] = $(e), [o, r] = $(0), { scrollToPage: a } = vn(), s = H(1), { viewMode: l } = Ae(), { scrollMode: u } = De(), { widths: h } = qe(), { pagesRef: m } = ge(), v = Tt(t, 100), p = N(
|
|
191
191
|
(d) => {
|
|
192
192
|
if (!/^[0-9]*$/g.test(d.toString()) || !d)
|
|
193
|
-
return { success: !1, currentPage:
|
|
193
|
+
return { success: !1, currentPage: s.current };
|
|
194
194
|
const g = +d;
|
|
195
|
-
return g < 0 || g > o ? { success: !1, currentPage:
|
|
195
|
+
return g < 0 || g > o ? { success: !1, currentPage: s.current } : (n(g), s.current = g, { success: !0, currentPage: +d });
|
|
196
196
|
},
|
|
197
197
|
[o]
|
|
198
|
-
),
|
|
198
|
+
), w = N(p, [p]), T = N(
|
|
199
199
|
(d) => {
|
|
200
|
-
const f =
|
|
200
|
+
const f = p(d);
|
|
201
201
|
return f.success && a(f.currentPage), f;
|
|
202
202
|
},
|
|
203
|
-
[
|
|
204
|
-
),
|
|
203
|
+
[p, a]
|
|
204
|
+
), y = N(() => {
|
|
205
205
|
let d = t - 1;
|
|
206
206
|
T(d);
|
|
207
|
-
}, [T, t,
|
|
207
|
+
}, [T, t, l, u]), C = W(() => {
|
|
208
208
|
if (!m)
|
|
209
209
|
return !1;
|
|
210
210
|
const d = t + 1;
|
|
211
|
-
return t % 2 === 1 &&
|
|
212
|
-
}, [t,
|
|
211
|
+
return t % 2 === 1 && l === He.DUAL_PAGE && d <= o ? h[t] + h[d] < m.clientWidth : !1;
|
|
212
|
+
}, [t, h, m, o]), S = N(() => {
|
|
213
213
|
let d = t + 1;
|
|
214
214
|
C && (d = t + 2), T(d);
|
|
215
|
-
}, [T, t, C,
|
|
215
|
+
}, [T, t, C, l, u]);
|
|
216
216
|
return {
|
|
217
217
|
focusedPage: v,
|
|
218
218
|
totalPages: o,
|
|
219
|
-
setFocusedPage:
|
|
219
|
+
setFocusedPage: w,
|
|
220
220
|
setTotalPages: r,
|
|
221
|
-
nextPage:
|
|
222
|
-
prevPage:
|
|
221
|
+
nextPage: S,
|
|
222
|
+
prevPage: y,
|
|
223
223
|
goToPage: T
|
|
224
224
|
};
|
|
225
225
|
}, wn = Ye({
|
|
@@ -238,7 +238,7 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
238
238
|
const e = Je(wn);
|
|
239
239
|
return typeof (e == null ? void 0 : e.focusedPage) > "u" && Zr.error("Please use this hooks inside children component of RPProvider"), e;
|
|
240
240
|
}, Ms = ({ children: e }) => {
|
|
241
|
-
const { pdf: t } = J(), { focusedPage: n, totalPages: o, setFocusedPage: r, setTotalPages: a, goToPage:
|
|
241
|
+
const { pdf: t } = J(), { focusedPage: n, totalPages: o, setFocusedPage: r, setTotalPages: a, goToPage: s, nextPage: l, prevPage: u } = Po();
|
|
242
242
|
return k(() => {
|
|
243
243
|
t != null && t.numPages && (a(t.numPages), r(1));
|
|
244
244
|
}, [t, a, r]), /* @__PURE__ */ i(
|
|
@@ -249,9 +249,9 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
249
249
|
totalPages: o,
|
|
250
250
|
setFocusedPage: r,
|
|
251
251
|
setTotalPages: a,
|
|
252
|
-
nextPage:
|
|
252
|
+
nextPage: l,
|
|
253
253
|
prevPage: u,
|
|
254
|
-
goToPage:
|
|
254
|
+
goToPage: s
|
|
255
255
|
},
|
|
256
256
|
children: e
|
|
257
257
|
}
|
|
@@ -262,7 +262,7 @@ const So = () => {
|
|
|
262
262
|
loadedPages: 0,
|
|
263
263
|
totalPages: 0,
|
|
264
264
|
percentage: 0
|
|
265
|
-
}), [r, a] = $(!1), [
|
|
265
|
+
}), [r, a] = $(!1), [s, l] = $(!1), [u, h] = $(null), m = H(!1);
|
|
266
266
|
k(() => {
|
|
267
267
|
m.current;
|
|
268
268
|
}, [m]);
|
|
@@ -270,54 +270,54 @@ const So = () => {
|
|
|
270
270
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
271
271
|
const f = document.querySelector(".rp-print-zone");
|
|
272
272
|
f && f.remove();
|
|
273
|
-
}, []),
|
|
274
|
-
m.current = !1, a(!1),
|
|
273
|
+
}, []), p = N(() => {
|
|
274
|
+
m.current = !1, a(!1), l(!1), h(null), o({
|
|
275
275
|
loadedPages: 0,
|
|
276
276
|
totalPages: 0,
|
|
277
277
|
percentage: 0
|
|
278
278
|
});
|
|
279
|
-
}, []),
|
|
279
|
+
}, []), w = () => {
|
|
280
280
|
m.current = !0;
|
|
281
281
|
}, T = async ({
|
|
282
282
|
scratchCanvas: f,
|
|
283
283
|
pdfDocument: g,
|
|
284
284
|
pageNumber: c,
|
|
285
285
|
viewerPdfPage: b,
|
|
286
|
-
printResolution:
|
|
286
|
+
printResolution: _,
|
|
287
287
|
optionalContentConfigPromise: P,
|
|
288
288
|
printAnnotationStoragePromise: E
|
|
289
289
|
}) => {
|
|
290
290
|
if (m.current) {
|
|
291
|
-
|
|
291
|
+
p();
|
|
292
292
|
return;
|
|
293
293
|
}
|
|
294
|
-
const x =
|
|
294
|
+
const x = _ / yr.PDF;
|
|
295
295
|
f.width = Math.floor(b.width * x), f.height = Math.floor(b.height * x);
|
|
296
296
|
const R = f.getContext("2d");
|
|
297
297
|
R.save(), R.fillStyle = "rgb(255, 255, 255)", R.fillRect(0, 0, f.width, f.height), R.restore();
|
|
298
|
-
const [D,
|
|
298
|
+
const [D, A] = await Promise.all([
|
|
299
299
|
g.getPage(c),
|
|
300
300
|
E
|
|
301
301
|
]);
|
|
302
302
|
if (m.current) {
|
|
303
|
-
|
|
303
|
+
p();
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
306
|
-
const
|
|
306
|
+
const z = {
|
|
307
307
|
canvasContext: R,
|
|
308
308
|
transform: [x, 0, 0, x, 0, 0],
|
|
309
309
|
viewport: D.getViewport({ scale: 1, rotation: b.rotation }),
|
|
310
310
|
intent: "print",
|
|
311
311
|
annotationMode: xr.ENABLE_STORAGE,
|
|
312
312
|
optionalContentConfigPromise: P,
|
|
313
|
-
printAnnotationStorage:
|
|
313
|
+
printAnnotationStorage: A
|
|
314
314
|
};
|
|
315
315
|
try {
|
|
316
|
-
return D.render(
|
|
316
|
+
return D.render(z).promise;
|
|
317
317
|
} catch (L) {
|
|
318
318
|
throw L instanceof Ir || console.error(L), L;
|
|
319
319
|
}
|
|
320
|
-
},
|
|
320
|
+
}, y = N(() => {
|
|
321
321
|
const f = window.print;
|
|
322
322
|
return new Promise((g) => {
|
|
323
323
|
const c = (P) => {
|
|
@@ -329,43 +329,43 @@ const So = () => {
|
|
|
329
329
|
c(g);
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
332
|
-
const
|
|
333
|
-
document.querySelector(".rp-print-zone") && (c(g),
|
|
332
|
+
const _ = new MutationObserver(() => {
|
|
333
|
+
document.querySelector(".rp-print-zone") && (c(g), _.disconnect());
|
|
334
334
|
});
|
|
335
|
-
|
|
335
|
+
_.observe(document.body, { childList: !0, subtree: !0 });
|
|
336
336
|
});
|
|
337
337
|
}, []), C = async (f) => {
|
|
338
338
|
const g = document.createElement("img"), c = document.createElement("div");
|
|
339
|
-
return c.classList.add("rp-print-page"), await new Promise((b,
|
|
339
|
+
return c.classList.add("rp-print-page"), await new Promise((b, _) => {
|
|
340
340
|
f.toBlob((P) => {
|
|
341
341
|
P ? (g.src = URL.createObjectURL(P), g.onload = () => {
|
|
342
342
|
URL.revokeObjectURL(g.src), b();
|
|
343
|
-
}, g.onerror =
|
|
343
|
+
}, g.onerror = _) : _(new Error("Failed to create blob"));
|
|
344
344
|
});
|
|
345
345
|
}).catch(() => {
|
|
346
346
|
}), c.appendChild(g), c;
|
|
347
|
-
},
|
|
347
|
+
}, S = (f, g) => {
|
|
348
348
|
const c = document.createElement("div");
|
|
349
349
|
c.classList.add("rp-print-zone");
|
|
350
|
-
const b = document.createElement("style"),
|
|
351
|
-
if (
|
|
352
|
-
const { width: P, height: E } =
|
|
350
|
+
const b = document.createElement("style"), _ = g.get(1);
|
|
351
|
+
if (_) {
|
|
352
|
+
const { width: P, height: E } = _ == null ? void 0 : _.page.getViewport({ scale: 1 });
|
|
353
353
|
b.innerHTML = `@page { size: ${P}px ${E}px }`;
|
|
354
354
|
}
|
|
355
355
|
return c.appendChild(b), c.append(...f), c;
|
|
356
356
|
}, d = N(async () => {
|
|
357
357
|
if (!e)
|
|
358
358
|
return;
|
|
359
|
-
|
|
359
|
+
p();
|
|
360
360
|
const f = document.createElement("canvas"), g = [];
|
|
361
361
|
try {
|
|
362
362
|
e.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
363
|
-
const b = e.getOptionalContentConfig({ intent: "print" }),
|
|
363
|
+
const b = e.getOptionalContentConfig({ intent: "print" }), _ = Promise.resolve(
|
|
364
364
|
e.annotationStorage.print ?? void 0
|
|
365
365
|
), P = t.size;
|
|
366
366
|
for (const [x, R] of t) {
|
|
367
367
|
if (m.current) {
|
|
368
|
-
|
|
368
|
+
p();
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
371
371
|
const D = R.page.getViewport({ scale: 1 });
|
|
@@ -376,45 +376,45 @@ const So = () => {
|
|
|
376
376
|
viewerPdfPage: D,
|
|
377
377
|
printResolution: 150,
|
|
378
378
|
optionalContentConfigPromise: b,
|
|
379
|
-
printAnnotationStoragePromise:
|
|
379
|
+
printAnnotationStoragePromise: _
|
|
380
380
|
}), m.current) {
|
|
381
|
-
|
|
381
|
+
p();
|
|
382
382
|
return;
|
|
383
383
|
}
|
|
384
|
-
const
|
|
385
|
-
g.push(
|
|
386
|
-
const
|
|
384
|
+
const A = await C(f);
|
|
385
|
+
g.push(A);
|
|
386
|
+
const z = parseFloat((g.length / P * 100).toFixed(2));
|
|
387
387
|
o({
|
|
388
388
|
loadedPages: x,
|
|
389
389
|
totalPages: P,
|
|
390
|
-
percentage:
|
|
390
|
+
percentage: z
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
393
|
if (m.current) {
|
|
394
|
-
|
|
394
|
+
p();
|
|
395
395
|
return;
|
|
396
396
|
}
|
|
397
|
-
const E =
|
|
398
|
-
document.body.appendChild(E), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), a(!0), await
|
|
397
|
+
const E = S(g, t);
|
|
398
|
+
document.body.appendChild(E), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), a(!0), await y();
|
|
399
399
|
} catch (c) {
|
|
400
|
-
|
|
400
|
+
l(!0), c instanceof Error && h(c);
|
|
401
401
|
} finally {
|
|
402
402
|
f.height = 0, f.width = 0;
|
|
403
403
|
}
|
|
404
404
|
}, [e, t, m]);
|
|
405
405
|
return k(() => {
|
|
406
406
|
const f = () => {
|
|
407
|
-
|
|
407
|
+
p(), v();
|
|
408
408
|
};
|
|
409
409
|
return window.addEventListener("afterprint", f, !0), () => {
|
|
410
410
|
window.removeEventListener("afterprint", f, !0);
|
|
411
411
|
};
|
|
412
|
-
}, [v,
|
|
412
|
+
}, [v, p]), {
|
|
413
413
|
print: d,
|
|
414
|
-
cancel:
|
|
414
|
+
cancel: w,
|
|
415
415
|
progress: n,
|
|
416
416
|
isComplete: r,
|
|
417
|
-
isError:
|
|
417
|
+
isError: s,
|
|
418
418
|
error: u
|
|
419
419
|
};
|
|
420
420
|
}, _n = Ye({
|
|
@@ -435,36 +435,36 @@ const So = () => {
|
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
437
|
}), Hs = ({ children: e }) => {
|
|
438
|
-
const [t, n] = $(null), [o, r] = $(null), { print: a, cancel:
|
|
438
|
+
const [t, n] = $(null), [o, r] = $(null), { print: a, cancel: s, progress: l, isComplete: u, isError: h, error: m } = So(), v = N((C) => {
|
|
439
439
|
C && typeof C == "function" && r(() => C);
|
|
440
|
-
}, []),
|
|
440
|
+
}, []), p = (C) => {
|
|
441
441
|
m && C(m);
|
|
442
|
-
},
|
|
442
|
+
}, w = N(
|
|
443
443
|
(C) => {
|
|
444
444
|
n(() => C);
|
|
445
445
|
},
|
|
446
|
-
[
|
|
446
|
+
[l, t]
|
|
447
447
|
);
|
|
448
448
|
k(() => {
|
|
449
449
|
u && o && T();
|
|
450
450
|
}, [u, o]), k(() => {
|
|
451
|
-
|
|
451
|
+
h && p((C) => {
|
|
452
452
|
console.error(C);
|
|
453
453
|
});
|
|
454
|
-
}, [
|
|
455
|
-
|
|
456
|
-
}, [
|
|
454
|
+
}, [h]), k(() => {
|
|
455
|
+
l && t && t(l);
|
|
456
|
+
}, [l, t]);
|
|
457
457
|
const T = () => {
|
|
458
458
|
o && (o(), r(null));
|
|
459
|
-
},
|
|
459
|
+
}, y = {
|
|
460
460
|
print: a,
|
|
461
|
-
cancel:
|
|
462
|
-
setOnProgress:
|
|
461
|
+
cancel: s,
|
|
462
|
+
setOnProgress: w,
|
|
463
463
|
setOnComplete: v,
|
|
464
|
-
setOnError:
|
|
465
|
-
progress:
|
|
464
|
+
setOnError: p,
|
|
465
|
+
progress: l
|
|
466
466
|
};
|
|
467
|
-
return /* @__PURE__ */ i(_n.Provider, { value:
|
|
467
|
+
return /* @__PURE__ */ i(_n.Provider, { value: y, children: e });
|
|
468
468
|
}, tt = () => {
|
|
469
469
|
const e = Je(_n);
|
|
470
470
|
if (!e)
|
|
@@ -472,40 +472,40 @@ const So = () => {
|
|
|
472
472
|
return e;
|
|
473
473
|
}, yo = () => {
|
|
474
474
|
const [e, t] = $({}), { pages: n } = J(), { rotate: o } = Ge(), r = W(() => Object.keys(e).length, [e]), a = N(
|
|
475
|
-
(
|
|
476
|
-
if (!n.size ||
|
|
475
|
+
(l) => {
|
|
476
|
+
if (!n.size || l > n.size)
|
|
477
477
|
return;
|
|
478
|
-
const u = Array.from(n.values()).slice(0,
|
|
479
|
-
const { thumbnailViewport:
|
|
478
|
+
const u = Array.from(n.values()).slice(0, l).map((v) => {
|
|
479
|
+
const { thumbnailViewport: p, scale: w } = kt(v.page, o);
|
|
480
480
|
return {
|
|
481
|
-
scale:
|
|
481
|
+
scale: w,
|
|
482
482
|
page: v.page,
|
|
483
483
|
loading: !0,
|
|
484
|
-
viewport:
|
|
484
|
+
viewport: p
|
|
485
485
|
};
|
|
486
|
-
}),
|
|
487
|
-
t(
|
|
486
|
+
}), h = u.reduce((v, p) => (v[p.page.pageNumber] = p, v), {});
|
|
487
|
+
t(h);
|
|
488
488
|
const m = [];
|
|
489
489
|
for (const v of u) {
|
|
490
|
-
const
|
|
490
|
+
const p = document.createElement("canvas"), w = vt(v.page, p, {
|
|
491
491
|
scale: v.scale,
|
|
492
492
|
rotate: o
|
|
493
493
|
}).promise.then(() => {
|
|
494
|
-
const T =
|
|
494
|
+
const T = p.toDataURL();
|
|
495
495
|
return {
|
|
496
496
|
...v,
|
|
497
497
|
thumbnailSrc: T,
|
|
498
498
|
loading: !1
|
|
499
499
|
};
|
|
500
500
|
});
|
|
501
|
-
m.push(
|
|
501
|
+
m.push(w);
|
|
502
502
|
}
|
|
503
503
|
Promise.all(m).then((v) => {
|
|
504
|
-
const
|
|
505
|
-
(
|
|
504
|
+
const p = v.reduce(
|
|
505
|
+
(w, T) => (w[T.page.pageNumber] = T, w),
|
|
506
506
|
{}
|
|
507
507
|
);
|
|
508
|
-
t((
|
|
508
|
+
t((w) => ({ ...w, ...p }));
|
|
509
509
|
}).catch(() => {
|
|
510
510
|
});
|
|
511
511
|
},
|
|
@@ -514,39 +514,39 @@ const So = () => {
|
|
|
514
514
|
k(() => {
|
|
515
515
|
a(10);
|
|
516
516
|
}, [a]);
|
|
517
|
-
const
|
|
518
|
-
(
|
|
517
|
+
const s = N(
|
|
518
|
+
(l) => {
|
|
519
519
|
if (!n)
|
|
520
520
|
return;
|
|
521
|
-
const u = n.get(
|
|
521
|
+
const u = n.get(l);
|
|
522
522
|
if (!u)
|
|
523
523
|
return;
|
|
524
524
|
t((m) => ({
|
|
525
525
|
...m,
|
|
526
|
-
[
|
|
526
|
+
[l]: {
|
|
527
527
|
loading: !0,
|
|
528
528
|
page: u.page,
|
|
529
529
|
viewport: u.thumbnailViewport,
|
|
530
530
|
scale: u.thumbnailScale
|
|
531
531
|
}
|
|
532
532
|
}));
|
|
533
|
-
const
|
|
534
|
-
vt(u.page,
|
|
535
|
-
const m =
|
|
533
|
+
const h = document.createElement("canvas");
|
|
534
|
+
vt(u.page, h, { scale: u.thumbnailScale, rotate: o }).promise.then(() => {
|
|
535
|
+
const m = h.toDataURL(), { thumbnailViewport: v, scale: p } = kt(u.page, o);
|
|
536
536
|
return {
|
|
537
|
-
scale:
|
|
537
|
+
scale: p,
|
|
538
538
|
thumbnailSrc: m,
|
|
539
539
|
page: u.page,
|
|
540
540
|
loading: !1,
|
|
541
541
|
viewport: v
|
|
542
542
|
};
|
|
543
543
|
}).then((m) => {
|
|
544
|
-
t((v) => ({ ...v, [
|
|
544
|
+
t((v) => ({ ...v, [l]: m }));
|
|
545
545
|
});
|
|
546
546
|
},
|
|
547
547
|
[n, o]
|
|
548
548
|
);
|
|
549
|
-
return { thumbnailPages: e, addPage:
|
|
549
|
+
return { thumbnailPages: e, addPage: s, addToPage: a, thumbnailLength: r };
|
|
550
550
|
}, bn = Ye({
|
|
551
551
|
thumbnailPages: {},
|
|
552
552
|
addPage: (e) => {
|
|
@@ -561,36 +561,36 @@ const So = () => {
|
|
|
561
561
|
children: e,
|
|
562
562
|
initialThumbnailsVisible: t
|
|
563
563
|
}) => {
|
|
564
|
-
const { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: a } = yo(), [
|
|
564
|
+
const { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: a } = yo(), [s, l] = $(t);
|
|
565
565
|
return /* @__PURE__ */ i(
|
|
566
566
|
bn.Provider,
|
|
567
567
|
{
|
|
568
|
-
value: { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: a, active:
|
|
568
|
+
value: { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: a, active: s, setActive: l },
|
|
569
569
|
children: e
|
|
570
570
|
}
|
|
571
571
|
);
|
|
572
572
|
}, xo = (e = {}, t = "") => {
|
|
573
|
-
const [n, o] = $(t), [r, a] = $(!1), { pdf:
|
|
573
|
+
const [n, o] = $(t), [r, a] = $(!1), { pdf: s, pages: l } = J(), { widths: u, heights: h } = qe(), m = H(!n), { currentZoom: v } = Qe(), [p, w] = $([]), { setFocusedPage: T } = ie(), { columnCount: y } = Ae(), { rotate: C } = Ge(), [S, d] = $(0), { pageScrollElementRef: f, virtualScrollableElementRef: g } = et(), { scrollMode: c } = De(), { pagesRef: b } = ge(), [_, P] = $(null), E = H({}), x = W(() => S === 0 ? null : p[S - 1], [S, p]), R = W(() => p.length, [p]);
|
|
574
574
|
k(() => {
|
|
575
|
-
if (!x || !
|
|
575
|
+
if (!x || !l)
|
|
576
576
|
return;
|
|
577
577
|
const L = g || f;
|
|
578
578
|
if (!L || !b)
|
|
579
579
|
return;
|
|
580
|
-
const I =
|
|
580
|
+
const I = l.get(x.page);
|
|
581
581
|
if (c === ee.PAGE_SCROLLING && T(x.page), !I)
|
|
582
582
|
return;
|
|
583
583
|
let O = 0, M = 0;
|
|
584
584
|
if (c === ee.VERTICAL_SCROLLING) {
|
|
585
|
-
const ae = x.page - 1, de =
|
|
586
|
-
O = Oe(
|
|
585
|
+
const ae = x.page - 1, de = y, te = ae % de, ze = Math.floor(ae / de);
|
|
586
|
+
O = Oe(h, ze), M = Oe(u, te);
|
|
587
587
|
}
|
|
588
588
|
c === ee.HORIZONTAL_SCROLLING && (M = u.slice(0, x.page - 1).reduce((ae, de) => ae + de, 0));
|
|
589
589
|
const G = {
|
|
590
590
|
top: b.clientHeight / 2,
|
|
591
591
|
left: b.clientWidth / 2
|
|
592
592
|
}, Z = {
|
|
593
|
-
height:
|
|
593
|
+
height: h[x.page - 1],
|
|
594
594
|
width: u[x.page - 1]
|
|
595
595
|
}, { leftInPage: j, topInPage: U } = Br(
|
|
596
596
|
Z,
|
|
@@ -606,10 +606,10 @@ const So = () => {
|
|
|
606
606
|
...le
|
|
607
607
|
});
|
|
608
608
|
}, [
|
|
609
|
-
|
|
609
|
+
l,
|
|
610
610
|
T,
|
|
611
611
|
u,
|
|
612
|
-
|
|
612
|
+
h,
|
|
613
613
|
x,
|
|
614
614
|
c,
|
|
615
615
|
g,
|
|
@@ -618,9 +618,9 @@ const So = () => {
|
|
|
618
618
|
]);
|
|
619
619
|
const D = N(() => {
|
|
620
620
|
d((L) => R ? L + 1 > R ? 1 : L + 1 : 0);
|
|
621
|
-
}, [R]),
|
|
621
|
+
}, [R]), A = N(() => {
|
|
622
622
|
d((L) => R ? L - 1 <= 0 ? R : L - 1 : 0);
|
|
623
|
-
}, [R]),
|
|
623
|
+
}, [R]), z = N(async (L) => {
|
|
624
624
|
if (!L)
|
|
625
625
|
return {};
|
|
626
626
|
const I = L.numPages, O = {};
|
|
@@ -634,10 +634,10 @@ const So = () => {
|
|
|
634
634
|
}, []);
|
|
635
635
|
return k(() => {
|
|
636
636
|
if (!n) {
|
|
637
|
-
m.current = !0,
|
|
637
|
+
m.current = !0, w([]), d(0);
|
|
638
638
|
return;
|
|
639
639
|
}
|
|
640
|
-
m.current = !1, a(!0),
|
|
640
|
+
m.current = !1, a(!0), w([]), d(0), z(s).then((L) => {
|
|
641
641
|
E.current = L;
|
|
642
642
|
const O = Object.keys(L).reduce((M, G) => {
|
|
643
643
|
const Z = cr(
|
|
@@ -648,21 +648,21 @@ const So = () => {
|
|
|
648
648
|
).map((j, U) => ({ ...j, page: Number(G), pageMatchIdx: U }));
|
|
649
649
|
return [...M, ...Z];
|
|
650
650
|
}, []);
|
|
651
|
-
|
|
651
|
+
w(O), d(O.length ? 1 : 0);
|
|
652
652
|
}).catch(() => {
|
|
653
|
-
|
|
653
|
+
w([]), d(0);
|
|
654
654
|
}).finally(() => a(!1));
|
|
655
|
-
}, [n,
|
|
655
|
+
}, [n, z, s, e]), {
|
|
656
656
|
search: n,
|
|
657
657
|
setSearch: o,
|
|
658
658
|
loading: r,
|
|
659
|
-
matches:
|
|
659
|
+
matches: p,
|
|
660
660
|
totalMatches: R,
|
|
661
|
-
currentMatchPosition:
|
|
661
|
+
currentMatchPosition: S,
|
|
662
662
|
currentMatch: x,
|
|
663
663
|
nextMatch: D,
|
|
664
|
-
prevMatch:
|
|
665
|
-
currentMatchElement:
|
|
664
|
+
prevMatch: A,
|
|
665
|
+
currentMatchElement: _,
|
|
666
666
|
setCurrentMatchElement: P
|
|
667
667
|
};
|
|
668
668
|
}, Tn = Ye({
|
|
@@ -690,14 +690,14 @@ const So = () => {
|
|
|
690
690
|
const [n, o] = $({}), {
|
|
691
691
|
loading: r,
|
|
692
692
|
setSearch: a,
|
|
693
|
-
totalMatches:
|
|
694
|
-
currentMatchPosition:
|
|
693
|
+
totalMatches: s,
|
|
694
|
+
currentMatchPosition: l,
|
|
695
695
|
currentMatch: u,
|
|
696
|
-
search:
|
|
696
|
+
search: h,
|
|
697
697
|
matches: m,
|
|
698
698
|
nextMatch: v,
|
|
699
|
-
prevMatch:
|
|
700
|
-
currentMatchElement:
|
|
699
|
+
prevMatch: p,
|
|
700
|
+
currentMatchElement: w,
|
|
701
701
|
setCurrentMatchElement: T
|
|
702
702
|
} = xo(n, t);
|
|
703
703
|
return /* @__PURE__ */ i(
|
|
@@ -708,14 +708,14 @@ const So = () => {
|
|
|
708
708
|
setSearchOptions: o,
|
|
709
709
|
loading: r,
|
|
710
710
|
setSearch: a,
|
|
711
|
-
totalMatches:
|
|
712
|
-
currentMatchPosition:
|
|
711
|
+
totalMatches: s,
|
|
712
|
+
currentMatchPosition: l,
|
|
713
713
|
currentMatch: u,
|
|
714
714
|
nextMatch: v,
|
|
715
|
-
prevMatch:
|
|
716
|
-
search:
|
|
715
|
+
prevMatch: p,
|
|
716
|
+
search: h,
|
|
717
717
|
matches: m,
|
|
718
|
-
currentMatchElement:
|
|
718
|
+
currentMatchElement: w,
|
|
719
719
|
setCurrentMatchElement: T
|
|
720
720
|
},
|
|
721
721
|
children: e
|
|
@@ -735,20 +735,20 @@ const So = () => {
|
|
|
735
735
|
"rp-page": "_rp-page_h7a2q_1",
|
|
736
736
|
"rp-loader-wrapper": "_rp-loader-wrapper_h7a2q_14"
|
|
737
737
|
}, Io = (e) => {
|
|
738
|
-
const { pageNumber: t, onLoaded: n, onLoading: o } = e, r = H(null), { pages: a } = J(), { rotate:
|
|
738
|
+
const { pageNumber: t, onLoaded: n, onLoading: o } = e, r = H(null), { pages: a } = J(), { rotate: s } = Ge(), l = H(), { currentZoom: u } = Qe();
|
|
739
739
|
return k(() => {
|
|
740
740
|
if (!a || u === 0)
|
|
741
741
|
return;
|
|
742
|
-
const
|
|
743
|
-
if (r.current &&
|
|
742
|
+
const h = a.get(t);
|
|
743
|
+
if (r.current && h) {
|
|
744
744
|
const m = r.current;
|
|
745
745
|
m.hidden = !0;
|
|
746
|
-
const v =
|
|
747
|
-
v && v.cancel(), o && o(),
|
|
746
|
+
const v = l.current;
|
|
747
|
+
v && v.cancel(), o && o(), l.current = vt(h.page, m, {
|
|
748
748
|
scale: u,
|
|
749
|
-
rotate:
|
|
749
|
+
rotate: s,
|
|
750
750
|
renderForms: !0
|
|
751
|
-
}),
|
|
751
|
+
}), l.current.promise.then(() => {
|
|
752
752
|
m.hidden = !1;
|
|
753
753
|
}).catch(() => {
|
|
754
754
|
}).finally(() => {
|
|
@@ -757,60 +757,60 @@ const So = () => {
|
|
|
757
757
|
}
|
|
758
758
|
return () => {
|
|
759
759
|
var m;
|
|
760
|
-
(m =
|
|
760
|
+
(m = l.current) == null || m.cancel();
|
|
761
761
|
};
|
|
762
|
-
}, [a, t,
|
|
762
|
+
}, [a, t, s, u, o, n]), /* @__PURE__ */ i("canvas", { "data-rp": `page-${t}-canvas`, ref: r });
|
|
763
763
|
}, Ro = "_selecting_1x8te_9", Lo = "_endOfContent_1x8te_24", he = {
|
|
764
764
|
"rp-text-layer": "_rp-text-layer_1x8te_1",
|
|
765
765
|
selecting: Ro,
|
|
766
766
|
endOfContent: Lo,
|
|
767
767
|
"rp-text-layer-text": "_rp-text-layer-text_1x8te_38"
|
|
768
768
|
}, Eo = (e) => {
|
|
769
|
-
const { pageNumber: t } = e, { pages: n } = J(), o = H(null), { matches: r, currentMatch: a, setCurrentMatchElement:
|
|
769
|
+
const { pageNumber: t } = e, { pages: n } = J(), o = H(null), { matches: r, currentMatch: a, setCurrentMatchElement: s } = xt(), [l, u] = $(
|
|
770
770
|
[]
|
|
771
|
-
),
|
|
771
|
+
), h = H(), m = H(), v = H(), p = W(() => r.filter((f) => f.pageIndex === t - 1), [r, t]), w = N(
|
|
772
772
|
(f, g, c = !1) => {
|
|
773
|
-
if (c && lr(f, g), !
|
|
773
|
+
if (c && lr(f, g), !p.length) {
|
|
774
774
|
v.current = void 0, u([]);
|
|
775
775
|
return;
|
|
776
776
|
}
|
|
777
|
-
const b = dr(
|
|
777
|
+
const b = dr(p, f, g);
|
|
778
778
|
u(b);
|
|
779
779
|
},
|
|
780
|
-
[
|
|
781
|
-
), T = H(),
|
|
780
|
+
[p]
|
|
781
|
+
), T = H(), y = H(!1), C = N(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
|
|
782
782
|
k(() => ((() => {
|
|
783
783
|
if (T.current)
|
|
784
784
|
return;
|
|
785
785
|
T.current = new AbortController();
|
|
786
786
|
const { signal: g } = T.current, c = () => {
|
|
787
|
-
C().forEach((
|
|
788
|
-
const P =
|
|
789
|
-
P && (
|
|
787
|
+
C().forEach((_) => {
|
|
788
|
+
const P = _.querySelector(".endOfContent");
|
|
789
|
+
P && (_.appendChild(P), P.style.width = "", P.style.height = "", _.classList.remove(he.selecting));
|
|
790
790
|
});
|
|
791
791
|
};
|
|
792
792
|
document.addEventListener(
|
|
793
793
|
"pointerdown",
|
|
794
794
|
() => {
|
|
795
|
-
|
|
795
|
+
y.current = !0;
|
|
796
796
|
},
|
|
797
797
|
{ signal: g }
|
|
798
798
|
), document.addEventListener(
|
|
799
799
|
"pointerup",
|
|
800
800
|
() => {
|
|
801
|
-
|
|
801
|
+
y.current = !1, c();
|
|
802
802
|
},
|
|
803
803
|
{ signal: g }
|
|
804
804
|
), window.addEventListener(
|
|
805
805
|
"blur",
|
|
806
806
|
() => {
|
|
807
|
-
|
|
807
|
+
y.current = !1, c();
|
|
808
808
|
},
|
|
809
809
|
{ signal: g }
|
|
810
810
|
), document.addEventListener(
|
|
811
811
|
"keyup",
|
|
812
812
|
() => {
|
|
813
|
-
|
|
813
|
+
y.current || c();
|
|
814
814
|
},
|
|
815
815
|
{ signal: g }
|
|
816
816
|
);
|
|
@@ -818,17 +818,17 @@ const So = () => {
|
|
|
818
818
|
document.addEventListener(
|
|
819
819
|
"selectionchange",
|
|
820
820
|
() => {
|
|
821
|
-
var
|
|
822
|
-
const
|
|
823
|
-
if (!
|
|
821
|
+
var z, L;
|
|
822
|
+
const _ = document.getSelection();
|
|
823
|
+
if (!_)
|
|
824
824
|
return;
|
|
825
|
-
if (
|
|
825
|
+
if (_.rangeCount === 0) {
|
|
826
826
|
c();
|
|
827
827
|
return;
|
|
828
828
|
}
|
|
829
829
|
const P = /* @__PURE__ */ new Set();
|
|
830
|
-
for (let I = 0; I <
|
|
831
|
-
const O =
|
|
830
|
+
for (let I = 0; I < _.rangeCount; I++) {
|
|
831
|
+
const O = _.getRangeAt(I);
|
|
832
832
|
C().forEach((M) => {
|
|
833
833
|
O.intersectsNode(M) && !P.has(M) && P.add(M);
|
|
834
834
|
});
|
|
@@ -841,13 +841,13 @@ const So = () => {
|
|
|
841
841
|
O && (I.appendChild(O), O.style.width = "", O.style.height = "", I.classList.remove(he.selecting));
|
|
842
842
|
}
|
|
843
843
|
});
|
|
844
|
-
const E =
|
|
844
|
+
const E = _.getRangeAt(0);
|
|
845
845
|
let R = b && (E.compareBoundaryPoints(Range.END_TO_END, b) === 0 || E.compareBoundaryPoints(Range.START_TO_END, b) === 0) ? E.startContainer : E.endContainer;
|
|
846
846
|
R.nodeType === Node.TEXT_NODE && (R = R.parentNode);
|
|
847
|
-
const D = (
|
|
847
|
+
const D = (z = R.parentElement) == null ? void 0 : z.closest(
|
|
848
848
|
he["rp-text-layer"]
|
|
849
|
-
),
|
|
850
|
-
|
|
849
|
+
), A = D == null ? void 0 : D.querySelector(".endOfContent");
|
|
850
|
+
A && D && (A.style.width = D.style.width, A.style.height = D.style.height, (L = R.parentElement) == null || L.insertBefore(A, R.nextSibling)), b = E.cloneRange();
|
|
851
851
|
},
|
|
852
852
|
{ signal: g }
|
|
853
853
|
);
|
|
@@ -855,62 +855,62 @@ const So = () => {
|
|
|
855
855
|
var g;
|
|
856
856
|
(g = T.current) == null || g.abort(), T.current = void 0;
|
|
857
857
|
}), [C]);
|
|
858
|
-
const
|
|
858
|
+
const S = N(() => {
|
|
859
859
|
o.current && o.current.classList.add(he.selecting);
|
|
860
860
|
}, []), d = N(() => {
|
|
861
861
|
o.current && o.current.classList.remove(he.selecting);
|
|
862
862
|
}, []);
|
|
863
863
|
return k(() => {
|
|
864
864
|
var c;
|
|
865
|
-
if ((c = v.current) == null || c.classList.remove("selected"), !
|
|
865
|
+
if ((c = v.current) == null || c.classList.remove("selected"), !l.length || !a || a.pageIndex !== t - 1)
|
|
866
866
|
return;
|
|
867
|
-
const f =
|
|
867
|
+
const f = p.findIndex(
|
|
868
868
|
(b) => JSON.stringify(b) === JSON.stringify(a)
|
|
869
869
|
);
|
|
870
870
|
if (f === -1)
|
|
871
871
|
return;
|
|
872
|
-
const g =
|
|
873
|
-
g && (v.current = g.element,
|
|
874
|
-
}, [a,
|
|
872
|
+
const g = l.find((b) => b.index === f);
|
|
873
|
+
g && (v.current = g.element, s(g.element), g.element.classList.add("selected"));
|
|
874
|
+
}, [a, l, p]), k(() => {
|
|
875
875
|
const f = n.get(t);
|
|
876
876
|
if (!f || !o.current)
|
|
877
877
|
return;
|
|
878
878
|
const g = o.current;
|
|
879
|
-
return
|
|
879
|
+
return h.current && h.current.cancel(), f.page.getTextContent().then((c) => {
|
|
880
880
|
const b = f.page.getViewport({ scale: 1 });
|
|
881
|
-
return
|
|
881
|
+
return h.current = new Sr.TextLayer({
|
|
882
882
|
viewport: b,
|
|
883
883
|
textContentSource: c,
|
|
884
884
|
container: g
|
|
885
|
-
}), m.current = c, g && (g.innerText = ""),
|
|
885
|
+
}), m.current = c, g && (g.innerText = ""), h.current.render();
|
|
886
886
|
}).then(() => {
|
|
887
887
|
var P, E;
|
|
888
888
|
[].slice.call(g.children).forEach((x) => {
|
|
889
889
|
x.classList.add(he["rp-text-layer-text"]), x.setAttribute("data-rp", "rp-text-layer-text");
|
|
890
890
|
});
|
|
891
|
-
const b = (P =
|
|
892
|
-
b && m.current &&
|
|
893
|
-
const
|
|
894
|
-
|
|
891
|
+
const b = (P = h.current) == null ? void 0 : P.textDivs;
|
|
892
|
+
b && m.current && w(m.current, b);
|
|
893
|
+
const _ = document.createElement("div");
|
|
894
|
+
_.className = "endOfContent", (E = o.current) == null || E.appendChild(_);
|
|
895
895
|
}).catch(() => {
|
|
896
896
|
}), () => {
|
|
897
897
|
var c;
|
|
898
|
-
(c =
|
|
898
|
+
(c = h.current) == null || c.cancel();
|
|
899
899
|
};
|
|
900
900
|
}, [n, t]), k(() => {
|
|
901
901
|
var c;
|
|
902
902
|
[].slice.call(o.current.children).forEach((b) => {
|
|
903
903
|
b.classList.add(he["rp-text-layer-text"]);
|
|
904
904
|
});
|
|
905
|
-
const g = (c =
|
|
906
|
-
g && m.current &&
|
|
907
|
-
}, [
|
|
905
|
+
const g = (c = h.current) == null ? void 0 : c.textDivs;
|
|
906
|
+
g && m.current && w(m.current, g, !0);
|
|
907
|
+
}, [w]), /* @__PURE__ */ i(
|
|
908
908
|
"div",
|
|
909
909
|
{
|
|
910
910
|
"data-rp": `page-${t}-textLayer`,
|
|
911
911
|
className: he["rp-text-layer"],
|
|
912
912
|
ref: o,
|
|
913
|
-
onMouseDown:
|
|
913
|
+
onMouseDown: S,
|
|
914
914
|
onMouseUp: d
|
|
915
915
|
}
|
|
916
916
|
);
|
|
@@ -919,42 +919,42 @@ const So = () => {
|
|
|
919
919
|
};
|
|
920
920
|
let Oo = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
921
921
|
const Do = (e) => {
|
|
922
|
-
const { pageNumber: t } = e, n = H(null), { pages: o, pdf: r } = J(), a = H(), [
|
|
922
|
+
const { pageNumber: t } = e, n = H(null), { pages: o, pdf: r } = J(), a = H(), [s, l] = $(), { setFocusedPage: u, goToPage: h } = ie(), { scrollMode: m } = De(), { print: v } = tt(), { download: p } = Hn(), w = W(() => o.get(t), [o, t]), T = W(() => w == null ? void 0 : w.page.getViewport(), [w]);
|
|
923
923
|
k(() => {
|
|
924
924
|
a.current && (a.current.div.replaceChildren(), a.current = void 0);
|
|
925
925
|
}, [r]), k(() => {
|
|
926
|
-
|
|
927
|
-
a.current = void 0,
|
|
926
|
+
w && w.page.getAnnotations().then((C) => {
|
|
927
|
+
a.current = void 0, l(C), n.current && (n.current.innerText = "");
|
|
928
928
|
});
|
|
929
|
-
}, [
|
|
930
|
-
const
|
|
929
|
+
}, [w]);
|
|
930
|
+
const y = N(
|
|
931
931
|
(C) => {
|
|
932
|
-
!
|
|
932
|
+
!s || !r || (Er(C), Nr(C, r, s).then((S) => {
|
|
933
933
|
var d, f;
|
|
934
|
-
((d =
|
|
935
|
-
}), m === ee.PAGE_SCROLLING ?
|
|
934
|
+
((d = S == null ? void 0 : S.data) == null ? void 0 : d.action) === "Print" ? v() : ((f = S == null ? void 0 : S.data) == null ? void 0 : f.action) === "SaveAs" && p();
|
|
935
|
+
}), m === ee.PAGE_SCROLLING ? zt(C, s, r, (S) => u(S.pageIndex + 1)) : zt(C, s, r, (S) => h(S.pageIndex + 1)));
|
|
936
936
|
},
|
|
937
|
-
[r,
|
|
937
|
+
[r, s, h, u, m, v, p]
|
|
938
938
|
);
|
|
939
939
|
return k(() => {
|
|
940
|
-
if (!
|
|
940
|
+
if (!w || !s)
|
|
941
941
|
return;
|
|
942
|
-
const C =
|
|
942
|
+
const C = w.page.getViewport();
|
|
943
943
|
if (a.current) {
|
|
944
944
|
a.current.update({
|
|
945
945
|
viewport: C.clone({ dontFlip: !0 })
|
|
946
946
|
});
|
|
947
947
|
return;
|
|
948
948
|
}
|
|
949
|
-
const
|
|
950
|
-
for (const g of
|
|
949
|
+
const S = /* @__PURE__ */ new Map([]);
|
|
950
|
+
for (const g of s) {
|
|
951
951
|
const { annotationType: c } = g;
|
|
952
952
|
switch (c) {
|
|
953
|
-
case
|
|
953
|
+
case At.Link:
|
|
954
954
|
Dr(g);
|
|
955
955
|
break;
|
|
956
|
-
case
|
|
957
|
-
Or(g, C,
|
|
956
|
+
case At.Widget:
|
|
957
|
+
Or(g, C, S);
|
|
958
958
|
break;
|
|
959
959
|
}
|
|
960
960
|
}
|
|
@@ -967,20 +967,20 @@ const Do = (e) => {
|
|
|
967
967
|
annotationCanvasMap: void 0,
|
|
968
968
|
annotationEditorUIManager: void 0,
|
|
969
969
|
structTreeLayer: null,
|
|
970
|
-
page:
|
|
970
|
+
page: w.page,
|
|
971
971
|
viewport: C.clone({ dontFlip: !0 })
|
|
972
|
-
}), n.current && Ft(n.current,
|
|
972
|
+
}), n.current && Ft(n.current, y);
|
|
973
973
|
const g = await (r == null ? void 0 : r.hasJSActions()), c = await (r == null ? void 0 : r.getFieldObjects());
|
|
974
974
|
if (d.signal.aborted)
|
|
975
975
|
throw "abort";
|
|
976
976
|
return (b = a.current) == null ? void 0 : b.render({
|
|
977
|
-
annotations:
|
|
977
|
+
annotations: s,
|
|
978
978
|
annotationStorage: r == null ? void 0 : r.annotationStorage,
|
|
979
979
|
hasJSActions: g,
|
|
980
980
|
fieldObjects: c,
|
|
981
981
|
div: n.current,
|
|
982
982
|
viewport: C.clone({ dontFlip: !0 }),
|
|
983
|
-
page:
|
|
983
|
+
page: w.page,
|
|
984
984
|
imageResourcesPath: Oo,
|
|
985
985
|
renderForms: !0,
|
|
986
986
|
linkService: new Lr(),
|
|
@@ -988,14 +988,14 @@ const Do = (e) => {
|
|
|
988
988
|
enableScripting: !1
|
|
989
989
|
});
|
|
990
990
|
})().then(() => {
|
|
991
|
-
n.current &&
|
|
991
|
+
n.current && Ar(n.current, y);
|
|
992
992
|
}).catch((g) => {
|
|
993
993
|
if (g !== "abort")
|
|
994
994
|
throw g;
|
|
995
995
|
}), () => {
|
|
996
|
-
d.abort("clear"), n.current && Ft(n.current,
|
|
996
|
+
d.abort("clear"), n.current && Ft(n.current, y);
|
|
997
997
|
};
|
|
998
|
-
}, [r,
|
|
998
|
+
}, [r, s, y]), /* @__PURE__ */ i(
|
|
999
999
|
"div",
|
|
1000
1000
|
{
|
|
1001
1001
|
"data-rp": `page-${t}-annotationLayer`,
|
|
@@ -1004,29 +1004,29 @@ const Do = (e) => {
|
|
|
1004
1004
|
ref: n
|
|
1005
1005
|
}
|
|
1006
1006
|
);
|
|
1007
|
-
},
|
|
1007
|
+
}, Ao = {
|
|
1008
1008
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1009
|
-
},
|
|
1010
|
-
const [n, o] = $(), { pages: r } = J(), { highlightKeywords: a } = pr(),
|
|
1009
|
+
}, zo = ({ pageNumber: e, viewport: t }) => {
|
|
1010
|
+
const [n, o] = $(), { pages: r } = J(), { highlightKeywords: a } = pr(), s = !0, l = H(null), [u, h] = $(null), [m, v] = $([]);
|
|
1011
1011
|
k(() => {
|
|
1012
|
-
|
|
1013
|
-
}, [
|
|
1012
|
+
l.current && h(l.current.parentElement);
|
|
1013
|
+
}, [l]), k(() => {
|
|
1014
1014
|
(async () => {
|
|
1015
1015
|
const f = r.get(e);
|
|
1016
|
-
if (!f || !
|
|
1016
|
+
if (!f || !l.current)
|
|
1017
1017
|
return;
|
|
1018
1018
|
const g = await f.page.getTextContent();
|
|
1019
1019
|
o(g);
|
|
1020
1020
|
})();
|
|
1021
1021
|
}, [r, e]);
|
|
1022
|
-
const
|
|
1022
|
+
const p = W(() => a ? a.map((d) => {
|
|
1023
1023
|
var f, g;
|
|
1024
1024
|
return {
|
|
1025
|
-
...
|
|
1025
|
+
...zr(d.keyword, (f = d.options) == null ? void 0 : f.matchCase, (g = d.options) == null ? void 0 : g.wholeWords),
|
|
1026
1026
|
color: d.highlightColor
|
|
1027
1027
|
};
|
|
1028
1028
|
}) : [], [a]);
|
|
1029
|
-
function
|
|
1029
|
+
function w(d, f) {
|
|
1030
1030
|
if (!d)
|
|
1031
1031
|
return;
|
|
1032
1032
|
const g = `[data-rp="page-${f}-textLayer"]`;
|
|
@@ -1051,38 +1051,38 @@ const Do = (e) => {
|
|
|
1051
1051
|
f(Array.from(g));
|
|
1052
1052
|
return;
|
|
1053
1053
|
}
|
|
1054
|
-
new MutationObserver((b,
|
|
1054
|
+
new MutationObserver((b, _) => {
|
|
1055
1055
|
const P = d.querySelectorAll(
|
|
1056
1056
|
".vpv-text-layer-text"
|
|
1057
1057
|
);
|
|
1058
|
-
P.length && (f(Array.from(P)),
|
|
1058
|
+
P.length && (f(Array.from(P)), _.disconnect());
|
|
1059
1059
|
}).observe(d, { childList: !0, subtree: !0 });
|
|
1060
1060
|
});
|
|
1061
1061
|
}
|
|
1062
|
-
const
|
|
1062
|
+
const y = (d, f, g, c) => {
|
|
1063
1063
|
var Z;
|
|
1064
|
-
const b = document.createRange(),
|
|
1065
|
-
if (!
|
|
1064
|
+
const b = document.createRange(), _ = g.firstChild;
|
|
1065
|
+
if (!_ || _.nodeType !== Node.TEXT_NODE)
|
|
1066
1066
|
return null;
|
|
1067
|
-
const P = ((Z =
|
|
1067
|
+
const P = ((Z = _.textContent) == null ? void 0 : Z.length) ?? 0, E = c[0].charIdxInSpan, x = c.length === 1 ? E : c[c.length - 1].charIdxInSpan;
|
|
1068
1068
|
if (E > P || x + 1 > P)
|
|
1069
1069
|
return null;
|
|
1070
|
-
b.setStart(
|
|
1070
|
+
b.setStart(_, E), b.setEnd(_, x + 1);
|
|
1071
1071
|
const R = document.createElement("span");
|
|
1072
1072
|
R.style.width = "auto", b.surroundContents(R);
|
|
1073
|
-
const D = R.getBoundingClientRect(),
|
|
1073
|
+
const D = R.getBoundingClientRect(), A = d.getBoundingClientRect(), z = A.height, L = A.width, I = 100 * (D.left - A.left) / L, O = 100 * (D.top - A.top) / z, M = 100 * D.height / z, G = 100 * D.width / L;
|
|
1074
1074
|
return kr(R), {
|
|
1075
1075
|
keywordStr: f,
|
|
1076
1076
|
left: I,
|
|
1077
1077
|
top: O,
|
|
1078
1078
|
height: M,
|
|
1079
1079
|
width: G,
|
|
1080
|
-
pageHeight:
|
|
1080
|
+
pageHeight: z,
|
|
1081
1081
|
pageWidth: L
|
|
1082
1082
|
};
|
|
1083
1083
|
};
|
|
1084
1084
|
async function C(d, f) {
|
|
1085
|
-
const g = await
|
|
1085
|
+
const g = await w(u, d);
|
|
1086
1086
|
if (!g)
|
|
1087
1087
|
return;
|
|
1088
1088
|
const c = await T(g);
|
|
@@ -1102,18 +1102,18 @@ const Do = (e) => {
|
|
|
1102
1102
|
spanIdx: 0
|
|
1103
1103
|
}
|
|
1104
1104
|
]
|
|
1105
|
-
).slice(1),
|
|
1106
|
-
v(
|
|
1105
|
+
).slice(1), _ = S(g, f, c, b);
|
|
1106
|
+
v(_);
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
|
-
const
|
|
1109
|
+
const S = (d, f, g, c) => {
|
|
1110
1110
|
const b = f.length;
|
|
1111
1111
|
if (!c.length || !b)
|
|
1112
1112
|
return [];
|
|
1113
|
-
const
|
|
1114
|
-
return
|
|
1115
|
-
const { keyword: x, regExp: R, wholeWords: D, color:
|
|
1116
|
-
if (!
|
|
1113
|
+
const _ = [], P = c.map((E) => E.char).join("");
|
|
1114
|
+
return p.forEach((E) => {
|
|
1115
|
+
const { keyword: x, regExp: R, wholeWords: D, color: A } = E, z = x;
|
|
1116
|
+
if (!z.trim())
|
|
1117
1117
|
return;
|
|
1118
1118
|
const L = R.flags.indexOf("g") === -1 ? new RegExp(R, `${R.flags}g`) : R;
|
|
1119
1119
|
let I;
|
|
@@ -1127,7 +1127,7 @@ const Do = (e) => {
|
|
|
1127
1127
|
const M = O.map((G) => ({
|
|
1128
1128
|
keyword: G.keyword,
|
|
1129
1129
|
indexes: c.slice(G.startIndex, G.endIndex),
|
|
1130
|
-
color:
|
|
1130
|
+
color: A
|
|
1131
1131
|
}));
|
|
1132
1132
|
for (const G of M) {
|
|
1133
1133
|
const Z = G.indexes.reduce(
|
|
@@ -1136,21 +1136,21 @@ const Do = (e) => {
|
|
|
1136
1136
|
);
|
|
1137
1137
|
for (const j of Object.values(Z))
|
|
1138
1138
|
if (j.length !== 1 || j[0].char.trim() !== "") {
|
|
1139
|
-
const U = j, Q = g[U[0].spanIdx], X =
|
|
1139
|
+
const U = j, Q = g[U[0].spanIdx], X = y(
|
|
1140
1140
|
d,
|
|
1141
|
-
|
|
1141
|
+
z,
|
|
1142
1142
|
Q,
|
|
1143
1143
|
U
|
|
1144
1144
|
);
|
|
1145
1145
|
if (X) {
|
|
1146
1146
|
const { left: le, top: ae } = X;
|
|
1147
|
-
if (
|
|
1147
|
+
if (_.find((te) => te.left === le && te.top === ae))
|
|
1148
1148
|
continue;
|
|
1149
|
-
|
|
1149
|
+
_.push({ ...X, highlightColor: G.color });
|
|
1150
1150
|
}
|
|
1151
1151
|
}
|
|
1152
1152
|
}
|
|
1153
|
-
}),
|
|
1153
|
+
}), _.sort(Fr), _;
|
|
1154
1154
|
};
|
|
1155
1155
|
return k(() => {
|
|
1156
1156
|
(async () => {
|
|
@@ -1161,10 +1161,10 @@ const Do = (e) => {
|
|
|
1161
1161
|
console.error(f);
|
|
1162
1162
|
}
|
|
1163
1163
|
})();
|
|
1164
|
-
}, [
|
|
1164
|
+
}, [s, a, e, n, t]), /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ i("div", { ref: l, "data-rp": `page-${e}-textHighlightLayer`, children: m.map((d, f) => /* @__PURE__ */ i(
|
|
1165
1165
|
"div",
|
|
1166
1166
|
{
|
|
1167
|
-
className:
|
|
1167
|
+
className: Ao["rp-text-highlight"],
|
|
1168
1168
|
style: {
|
|
1169
1169
|
top: `${d.top}%`,
|
|
1170
1170
|
left: `${d.left}%`,
|
|
@@ -1176,42 +1176,42 @@ const Do = (e) => {
|
|
|
1176
1176
|
f
|
|
1177
1177
|
)) }) });
|
|
1178
1178
|
}, It = $e((e, t) => {
|
|
1179
|
-
const { pageNumber: n, style: o, ...r } = e, { pages: a } = J(), { rotate:
|
|
1179
|
+
const { pageNumber: n, style: o, ...r } = e, { pages: a } = J(), { rotate: s } = Ge(), { textLayer: l } = or(), { currentZoom: u } = Qe(), h = H(a.get(n)), [m, v] = $(!1), p = H(null), [w, T] = $({
|
|
1180
1180
|
width: 0,
|
|
1181
1181
|
height: 0
|
|
1182
1182
|
});
|
|
1183
|
-
cn(t, () =>
|
|
1184
|
-
if (a && (
|
|
1185
|
-
const d =
|
|
1183
|
+
cn(t, () => p.current), k(() => {
|
|
1184
|
+
if (a && (h.current = a.get(n), h.current)) {
|
|
1185
|
+
const d = h.current.page.getViewport({ scale: u, rotation: s });
|
|
1186
1186
|
T(d);
|
|
1187
1187
|
}
|
|
1188
|
-
}, [a, n,
|
|
1189
|
-
const
|
|
1190
|
-
switch (
|
|
1188
|
+
}, [a, n, s, u]);
|
|
1189
|
+
const y = W(() => {
|
|
1190
|
+
switch (s) {
|
|
1191
1191
|
case 90:
|
|
1192
|
-
return `${
|
|
1192
|
+
return `${w.width / 2}px ${w.width / 2}px`;
|
|
1193
1193
|
case -90:
|
|
1194
1194
|
case 270:
|
|
1195
|
-
return `${
|
|
1195
|
+
return `${w.height / 2}px ${w.height / 2}px`;
|
|
1196
1196
|
default:
|
|
1197
1197
|
return "center";
|
|
1198
1198
|
}
|
|
1199
|
-
}, [
|
|
1199
|
+
}, [s, w]), C = N(() => {
|
|
1200
1200
|
v(!0);
|
|
1201
|
-
}, []),
|
|
1201
|
+
}, []), S = N(() => {
|
|
1202
1202
|
v(!1);
|
|
1203
1203
|
}, []);
|
|
1204
1204
|
return /* @__PURE__ */ i(
|
|
1205
1205
|
"div",
|
|
1206
1206
|
{
|
|
1207
|
-
ref:
|
|
1207
|
+
ref: p,
|
|
1208
1208
|
id: `page-${n}`,
|
|
1209
1209
|
"data-rp": `page-${n}`,
|
|
1210
1210
|
...r,
|
|
1211
1211
|
style: {
|
|
1212
1212
|
...o,
|
|
1213
|
-
"--rp-rotate": `${
|
|
1214
|
-
"--rp-page-rotate-translate": `${
|
|
1213
|
+
"--rp-rotate": `${s}deg`,
|
|
1214
|
+
"--rp-page-rotate-translate": `${y}`,
|
|
1215
1215
|
"--scale-factor": u
|
|
1216
1216
|
},
|
|
1217
1217
|
className: lt["rp-page-wrapper"],
|
|
@@ -1219,15 +1219,15 @@ const Do = (e) => {
|
|
|
1219
1219
|
"div",
|
|
1220
1220
|
{
|
|
1221
1221
|
style: {
|
|
1222
|
-
width: `${
|
|
1223
|
-
height: `${
|
|
1222
|
+
width: `${w.width}px`,
|
|
1223
|
+
height: `${w.height}px`
|
|
1224
1224
|
},
|
|
1225
1225
|
className: lt["rp-page"],
|
|
1226
1226
|
children: [
|
|
1227
|
-
/* @__PURE__ */ i(Io, { onLoading: C, onLoaded:
|
|
1227
|
+
/* @__PURE__ */ i(Io, { onLoading: C, onLoaded: S, pageNumber: n }),
|
|
1228
1228
|
m && /* @__PURE__ */ i("div", { className: lt["rp-loader-wrapper"], children: /* @__PURE__ */ i(Ct, {}) }),
|
|
1229
|
-
|
|
1230
|
-
/* @__PURE__ */ i(
|
|
1229
|
+
l && /* @__PURE__ */ i(Eo, { pageNumber: n }),
|
|
1230
|
+
/* @__PURE__ */ i(zo, { pageNumber: n, viewport: w }),
|
|
1231
1231
|
/* @__PURE__ */ i(Do, { pageNumber: n })
|
|
1232
1232
|
]
|
|
1233
1233
|
}
|
|
@@ -1265,12 +1265,12 @@ function Wo(e, t) {
|
|
|
1265
1265
|
function dt(e, t) {
|
|
1266
1266
|
t === void 0 && (t = Wo);
|
|
1267
1267
|
var n, o = [], r, a = !1;
|
|
1268
|
-
function
|
|
1269
|
-
for (var
|
|
1270
|
-
|
|
1271
|
-
return a && n === this && t(
|
|
1268
|
+
function s() {
|
|
1269
|
+
for (var l = [], u = 0; u < arguments.length; u++)
|
|
1270
|
+
l[u] = arguments[u];
|
|
1271
|
+
return a && n === this && t(l, o) || (r = e.apply(this, l), a = !0, n = this, o = l), r;
|
|
1272
1272
|
}
|
|
1273
|
-
return
|
|
1273
|
+
return s;
|
|
1274
1274
|
}
|
|
1275
1275
|
function Ut(e, t) {
|
|
1276
1276
|
if (e == null)
|
|
@@ -1328,12 +1328,12 @@ var Go = 150, qo = function(t) {
|
|
|
1328
1328
|
}, Be = null, Ze = null, je = null;
|
|
1329
1329
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Be = /* @__PURE__ */ new WeakSet(), Ze = /* @__PURE__ */ new WeakSet(), je = /* @__PURE__ */ new WeakSet());
|
|
1330
1330
|
function Vo(e) {
|
|
1331
|
-
var t, n = e.getColumnOffset, o = e.getColumnStartIndexForOffset, r = e.getColumnStopIndexForStartIndex, a = e.getColumnWidth,
|
|
1332
|
-
return t = /* @__PURE__ */ function(
|
|
1333
|
-
Fo(d,
|
|
1331
|
+
var t, n = e.getColumnOffset, o = e.getColumnStartIndexForOffset, r = e.getColumnStopIndexForStartIndex, a = e.getColumnWidth, s = e.getEstimatedTotalHeight, l = e.getEstimatedTotalWidth, u = e.getOffsetForColumnAndAlignment, h = e.getOffsetForRowAndAlignment, m = e.getRowHeight, v = e.getRowOffset, p = e.getRowStartIndexForOffset, w = e.getRowStopIndexForStartIndex, T = e.initInstanceProps, y = e.shouldResetStyleCacheOnItemSizeChange, C = e.validateProps;
|
|
1332
|
+
return t = /* @__PURE__ */ function(S) {
|
|
1333
|
+
Fo(d, S);
|
|
1334
1334
|
function d(g) {
|
|
1335
1335
|
var c;
|
|
1336
|
-
return c =
|
|
1336
|
+
return c = S.call(this, g) || this, c._instanceProps = T(c.props, qt(c)), c._resetIsScrollingTimeoutId = null, c._outerRef = void 0, c.state = {
|
|
1337
1337
|
instance: qt(c),
|
|
1338
1338
|
isScrolling: !1,
|
|
1339
1339
|
horizontalScrollDirection: "forward",
|
|
@@ -1341,47 +1341,47 @@ function Vo(e) {
|
|
|
1341
1341
|
scrollTop: typeof c.props.initialScrollTop == "number" ? c.props.initialScrollTop : 0,
|
|
1342
1342
|
scrollUpdateWasRequested: !1,
|
|
1343
1343
|
verticalScrollDirection: "forward"
|
|
1344
|
-
}, c._callOnItemsRendered = void 0, c._callOnItemsRendered = dt(function(b,
|
|
1344
|
+
}, c._callOnItemsRendered = void 0, c._callOnItemsRendered = dt(function(b, _, P, E, x, R, D, A) {
|
|
1345
1345
|
return c.props.onItemsRendered({
|
|
1346
1346
|
overscanColumnStartIndex: b,
|
|
1347
|
-
overscanColumnStopIndex:
|
|
1347
|
+
overscanColumnStopIndex: _,
|
|
1348
1348
|
overscanRowStartIndex: P,
|
|
1349
1349
|
overscanRowStopIndex: E,
|
|
1350
1350
|
visibleColumnStartIndex: x,
|
|
1351
1351
|
visibleColumnStopIndex: R,
|
|
1352
1352
|
visibleRowStartIndex: D,
|
|
1353
|
-
visibleRowStopIndex:
|
|
1353
|
+
visibleRowStopIndex: A
|
|
1354
1354
|
});
|
|
1355
|
-
}), c._callOnScroll = void 0, c._callOnScroll = dt(function(b,
|
|
1355
|
+
}), c._callOnScroll = void 0, c._callOnScroll = dt(function(b, _, P, E, x) {
|
|
1356
1356
|
return c.props.onScroll({
|
|
1357
1357
|
horizontalScrollDirection: P,
|
|
1358
1358
|
scrollLeft: b,
|
|
1359
|
-
scrollTop:
|
|
1359
|
+
scrollTop: _,
|
|
1360
1360
|
verticalScrollDirection: E,
|
|
1361
1361
|
scrollUpdateWasRequested: x
|
|
1362
1362
|
});
|
|
1363
|
-
}), c._getItemStyle = void 0, c._getItemStyle = function(b,
|
|
1364
|
-
var P = c.props, E = P.columnWidth, x = P.direction, R = P.rowHeight, D = c._getItemStyleCache(
|
|
1365
|
-
if (D.hasOwnProperty(
|
|
1366
|
-
|
|
1363
|
+
}), c._getItemStyle = void 0, c._getItemStyle = function(b, _) {
|
|
1364
|
+
var P = c.props, E = P.columnWidth, x = P.direction, R = P.rowHeight, D = c._getItemStyleCache(y && E, y && x, y && R), A = b + ":" + _, z;
|
|
1365
|
+
if (D.hasOwnProperty(A))
|
|
1366
|
+
z = D[A];
|
|
1367
1367
|
else {
|
|
1368
|
-
var L = n(c.props,
|
|
1369
|
-
D[
|
|
1368
|
+
var L = n(c.props, _, c._instanceProps), I = x === "rtl";
|
|
1369
|
+
D[A] = z = {
|
|
1370
1370
|
position: "absolute",
|
|
1371
1371
|
left: I ? void 0 : L,
|
|
1372
1372
|
right: I ? L : void 0,
|
|
1373
1373
|
top: v(c.props, b, c._instanceProps),
|
|
1374
1374
|
height: m(c.props, b, c._instanceProps),
|
|
1375
|
-
width: a(c.props,
|
|
1375
|
+
width: a(c.props, _, c._instanceProps)
|
|
1376
1376
|
};
|
|
1377
1377
|
}
|
|
1378
|
-
return
|
|
1379
|
-
}, c._getItemStyleCache = void 0, c._getItemStyleCache = dt(function(b,
|
|
1378
|
+
return z;
|
|
1379
|
+
}, c._getItemStyleCache = void 0, c._getItemStyleCache = dt(function(b, _, P) {
|
|
1380
1380
|
return {};
|
|
1381
1381
|
}), c._onScroll = function(b) {
|
|
1382
|
-
var
|
|
1383
|
-
c.setState(function(
|
|
1384
|
-
if (
|
|
1382
|
+
var _ = b.currentTarget, P = _.clientHeight, E = _.clientWidth, x = _.scrollLeft, R = _.scrollTop, D = _.scrollHeight, A = _.scrollWidth;
|
|
1383
|
+
c.setState(function(z) {
|
|
1384
|
+
if (z.scrollLeft === x && z.scrollTop === R)
|
|
1385
1385
|
return null;
|
|
1386
1386
|
var L = c.props.direction, I = x;
|
|
1387
1387
|
if (L === "rtl")
|
|
@@ -1390,23 +1390,23 @@ function Vo(e) {
|
|
|
1390
1390
|
I = -x;
|
|
1391
1391
|
break;
|
|
1392
1392
|
case "positive-descending":
|
|
1393
|
-
I =
|
|
1393
|
+
I = A - E - x;
|
|
1394
1394
|
break;
|
|
1395
1395
|
}
|
|
1396
|
-
I = Math.max(0, Math.min(I,
|
|
1396
|
+
I = Math.max(0, Math.min(I, A - E));
|
|
1397
1397
|
var O = Math.max(0, Math.min(R, D - P));
|
|
1398
1398
|
return {
|
|
1399
1399
|
isScrolling: !0,
|
|
1400
|
-
horizontalScrollDirection:
|
|
1400
|
+
horizontalScrollDirection: z.scrollLeft < x ? "forward" : "backward",
|
|
1401
1401
|
scrollLeft: I,
|
|
1402
1402
|
scrollTop: O,
|
|
1403
|
-
verticalScrollDirection:
|
|
1403
|
+
verticalScrollDirection: z.scrollTop < R ? "forward" : "backward",
|
|
1404
1404
|
scrollUpdateWasRequested: !1
|
|
1405
1405
|
};
|
|
1406
1406
|
}, c._resetIsScrollingDebounced);
|
|
1407
1407
|
}, c._outerRefSetter = function(b) {
|
|
1408
|
-
var
|
|
1409
|
-
c._outerRef = b, typeof
|
|
1408
|
+
var _ = c.props.outerRef;
|
|
1409
|
+
c._outerRef = b, typeof _ == "function" ? _(b) : _ != null && typeof _ == "object" && _.hasOwnProperty("current") && (_.current = b);
|
|
1410
1410
|
}, c._resetIsScrollingDebounced = function() {
|
|
1411
1411
|
c._resetIsScrollingTimeoutId !== null && Zt(c._resetIsScrollingTimeoutId), c._resetIsScrollingTimeoutId = Ho(c._resetIsScrolling, Go);
|
|
1412
1412
|
}, c._resetIsScrolling = function() {
|
|
@@ -1422,75 +1422,75 @@ function Vo(e) {
|
|
|
1422
1422
|
};
|
|
1423
1423
|
var f = d.prototype;
|
|
1424
1424
|
return f.scrollTo = function(c) {
|
|
1425
|
-
var b = c.scrollLeft,
|
|
1426
|
-
b !== void 0 && (b = Math.max(0, b)),
|
|
1427
|
-
return b === void 0 && (b = P.scrollLeft),
|
|
1425
|
+
var b = c.scrollLeft, _ = c.scrollTop;
|
|
1426
|
+
b !== void 0 && (b = Math.max(0, b)), _ !== void 0 && (_ = Math.max(0, _)), this.setState(function(P) {
|
|
1427
|
+
return b === void 0 && (b = P.scrollLeft), _ === void 0 && (_ = P.scrollTop), P.scrollLeft === b && P.scrollTop === _ ? null : {
|
|
1428
1428
|
horizontalScrollDirection: P.scrollLeft < b ? "forward" : "backward",
|
|
1429
1429
|
scrollLeft: b,
|
|
1430
|
-
scrollTop:
|
|
1430
|
+
scrollTop: _,
|
|
1431
1431
|
scrollUpdateWasRequested: !0,
|
|
1432
|
-
verticalScrollDirection: P.scrollTop <
|
|
1432
|
+
verticalScrollDirection: P.scrollTop < _ ? "forward" : "backward"
|
|
1433
1433
|
};
|
|
1434
1434
|
}, this._resetIsScrollingDebounced);
|
|
1435
1435
|
}, f.scrollToItem = function(c) {
|
|
1436
|
-
var b = c.align,
|
|
1437
|
-
P !== void 0 && (P = Math.max(0, Math.min(P, R - 1))), E !== void 0 && (E = Math.max(0, Math.min(E,
|
|
1438
|
-
var G =
|
|
1436
|
+
var b = c.align, _ = b === void 0 ? "auto" : b, P = c.columnIndex, E = c.rowIndex, x = this.props, R = x.columnCount, D = x.height, A = x.rowCount, z = x.width, L = this.state, I = L.scrollLeft, O = L.scrollTop, M = $o();
|
|
1437
|
+
P !== void 0 && (P = Math.max(0, Math.min(P, R - 1))), E !== void 0 && (E = Math.max(0, Math.min(E, A - 1)));
|
|
1438
|
+
var G = s(this.props, this._instanceProps), Z = l(this.props, this._instanceProps), j = Z > z ? M : 0, U = G > D ? M : 0;
|
|
1439
1439
|
this.scrollTo({
|
|
1440
|
-
scrollLeft: P !== void 0 ? u(this.props, P,
|
|
1441
|
-
scrollTop: E !== void 0 ?
|
|
1440
|
+
scrollLeft: P !== void 0 ? u(this.props, P, _, I, this._instanceProps, U) : I,
|
|
1441
|
+
scrollTop: E !== void 0 ? h(this.props, E, _, O, this._instanceProps, j) : O
|
|
1442
1442
|
});
|
|
1443
1443
|
}, f.componentDidMount = function() {
|
|
1444
|
-
var c = this.props, b = c.initialScrollLeft,
|
|
1444
|
+
var c = this.props, b = c.initialScrollLeft, _ = c.initialScrollTop;
|
|
1445
1445
|
if (this._outerRef != null) {
|
|
1446
1446
|
var P = this._outerRef;
|
|
1447
|
-
typeof b == "number" && (P.scrollLeft = b), typeof
|
|
1447
|
+
typeof b == "number" && (P.scrollLeft = b), typeof _ == "number" && (P.scrollTop = _);
|
|
1448
1448
|
}
|
|
1449
1449
|
this._callPropsCallbacks();
|
|
1450
1450
|
}, f.componentDidUpdate = function() {
|
|
1451
|
-
var c = this.props.direction, b = this.state,
|
|
1451
|
+
var c = this.props.direction, b = this.state, _ = b.scrollLeft, P = b.scrollTop, E = b.scrollUpdateWasRequested;
|
|
1452
1452
|
if (E && this._outerRef != null) {
|
|
1453
1453
|
var x = this._outerRef;
|
|
1454
1454
|
if (c === "rtl")
|
|
1455
1455
|
switch (jt()) {
|
|
1456
1456
|
case "negative":
|
|
1457
|
-
x.scrollLeft = -
|
|
1457
|
+
x.scrollLeft = -_;
|
|
1458
1458
|
break;
|
|
1459
1459
|
case "positive-ascending":
|
|
1460
|
-
x.scrollLeft =
|
|
1460
|
+
x.scrollLeft = _;
|
|
1461
1461
|
break;
|
|
1462
1462
|
default:
|
|
1463
1463
|
var R = x.clientWidth, D = x.scrollWidth;
|
|
1464
|
-
x.scrollLeft = D - R -
|
|
1464
|
+
x.scrollLeft = D - R - _;
|
|
1465
1465
|
break;
|
|
1466
1466
|
}
|
|
1467
1467
|
else
|
|
1468
|
-
x.scrollLeft = Math.max(0,
|
|
1468
|
+
x.scrollLeft = Math.max(0, _);
|
|
1469
1469
|
x.scrollTop = Math.max(0, P);
|
|
1470
1470
|
}
|
|
1471
1471
|
this._callPropsCallbacks();
|
|
1472
1472
|
}, f.componentWillUnmount = function() {
|
|
1473
1473
|
this._resetIsScrollingTimeoutId !== null && Zt(this._resetIsScrollingTimeoutId);
|
|
1474
1474
|
}, f.render = function() {
|
|
1475
|
-
var c = this.props, b = c.children,
|
|
1475
|
+
var c = this.props, b = c.children, _ = c.className, P = c.columnCount, E = c.direction, x = c.height, R = c.innerRef, D = c.innerElementType, A = c.innerTagName, z = c.itemData, L = c.itemKey, I = L === void 0 ? qo : L, O = c.outerElementType, M = c.outerTagName, G = c.rowCount, Z = c.style, j = c.useIsScrolling, U = c.width, Q = this.state.isScrolling, X = this._getHorizontalRangeToRender(), le = X[0], ae = X[1], de = this._getVerticalRangeToRender(), te = de[0], ze = de[1], Re = [];
|
|
1476
1476
|
if (P > 0 && G)
|
|
1477
|
-
for (var Te = te; Te <=
|
|
1477
|
+
for (var Te = te; Te <= ze; Te++)
|
|
1478
1478
|
for (var we = le; we <= ae; we++)
|
|
1479
1479
|
Re.push(Ue(b, {
|
|
1480
1480
|
columnIndex: we,
|
|
1481
|
-
data:
|
|
1481
|
+
data: z,
|
|
1482
1482
|
isScrolling: j ? Q : void 0,
|
|
1483
1483
|
key: I({
|
|
1484
1484
|
columnIndex: we,
|
|
1485
|
-
data:
|
|
1485
|
+
data: z,
|
|
1486
1486
|
rowIndex: Te
|
|
1487
1487
|
}),
|
|
1488
1488
|
rowIndex: Te,
|
|
1489
1489
|
style: this._getItemStyle(Te, we)
|
|
1490
1490
|
}));
|
|
1491
|
-
var nt =
|
|
1491
|
+
var nt = s(this.props, this._instanceProps), rt = l(this.props, this._instanceProps);
|
|
1492
1492
|
return Ue(O || M || "div", {
|
|
1493
|
-
className:
|
|
1493
|
+
className: _,
|
|
1494
1494
|
onScroll: this._onScroll,
|
|
1495
1495
|
ref: this._outerRefSetter,
|
|
1496
1496
|
style: Wr({
|
|
@@ -1502,7 +1502,7 @@ function Vo(e) {
|
|
|
1502
1502
|
willChange: "transform",
|
|
1503
1503
|
direction: E
|
|
1504
1504
|
}, Z)
|
|
1505
|
-
}, Ue(D ||
|
|
1505
|
+
}, Ue(D || A || "div", {
|
|
1506
1506
|
children: Re,
|
|
1507
1507
|
ref: R,
|
|
1508
1508
|
style: {
|
|
@@ -1512,26 +1512,26 @@ function Vo(e) {
|
|
|
1512
1512
|
}
|
|
1513
1513
|
}));
|
|
1514
1514
|
}, f._callPropsCallbacks = function() {
|
|
1515
|
-
var c = this.props, b = c.columnCount,
|
|
1516
|
-
if (typeof
|
|
1517
|
-
var x = this._getHorizontalRangeToRender(), R = x[0], D = x[1],
|
|
1518
|
-
this._callOnItemsRendered(R, D, I, O,
|
|
1515
|
+
var c = this.props, b = c.columnCount, _ = c.onItemsRendered, P = c.onScroll, E = c.rowCount;
|
|
1516
|
+
if (typeof _ == "function" && b > 0 && E > 0) {
|
|
1517
|
+
var x = this._getHorizontalRangeToRender(), R = x[0], D = x[1], A = x[2], z = x[3], L = this._getVerticalRangeToRender(), I = L[0], O = L[1], M = L[2], G = L[3];
|
|
1518
|
+
this._callOnItemsRendered(R, D, I, O, A, z, M, G);
|
|
1519
1519
|
}
|
|
1520
1520
|
if (typeof P == "function") {
|
|
1521
1521
|
var Z = this.state, j = Z.horizontalScrollDirection, U = Z.scrollLeft, Q = Z.scrollTop, X = Z.scrollUpdateWasRequested, le = Z.verticalScrollDirection;
|
|
1522
1522
|
this._callOnScroll(U, Q, j, le, X);
|
|
1523
1523
|
}
|
|
1524
1524
|
}, f._getHorizontalRangeToRender = function() {
|
|
1525
|
-
var c = this.props, b = c.columnCount,
|
|
1525
|
+
var c = this.props, b = c.columnCount, _ = c.overscanColumnCount, P = c.overscanColumnsCount, E = c.overscanCount, x = c.rowCount, R = this.state, D = R.horizontalScrollDirection, A = R.isScrolling, z = R.scrollLeft, L = _ || P || E || 1;
|
|
1526
1526
|
if (b === 0 || x === 0)
|
|
1527
1527
|
return [0, 0, 0, 0];
|
|
1528
|
-
var I = o(this.props,
|
|
1528
|
+
var I = o(this.props, z, this._instanceProps), O = r(this.props, I, z, this._instanceProps), M = !A || D === "backward" ? Math.max(1, L) : 1, G = !A || D === "forward" ? Math.max(1, L) : 1;
|
|
1529
1529
|
return [Math.max(0, I - M), Math.max(0, Math.min(b - 1, O + G)), I, O];
|
|
1530
1530
|
}, f._getVerticalRangeToRender = function() {
|
|
1531
|
-
var c = this.props, b = c.columnCount,
|
|
1531
|
+
var c = this.props, b = c.columnCount, _ = c.overscanCount, P = c.overscanRowCount, E = c.overscanRowsCount, x = c.rowCount, R = this.state, D = R.isScrolling, A = R.verticalScrollDirection, z = R.scrollTop, L = P || E || _ || 1;
|
|
1532
1532
|
if (b === 0 || x === 0)
|
|
1533
1533
|
return [0, 0, 0, 0];
|
|
1534
|
-
var I =
|
|
1534
|
+
var I = p(this.props, z, this._instanceProps), O = w(this.props, I, z, this._instanceProps), M = !D || A === "backward" ? Math.max(1, L) : 1, G = !D || A === "forward" ? Math.max(1, L) : 1;
|
|
1535
1535
|
return [Math.max(0, I - M), Math.max(0, Math.min(x - 1, O + G)), I, O];
|
|
1536
1536
|
}, d;
|
|
1537
1537
|
}(Jn), t.defaultProps = {
|
|
@@ -1541,9 +1541,9 @@ function Vo(e) {
|
|
|
1541
1541
|
}, t;
|
|
1542
1542
|
}
|
|
1543
1543
|
var Uo = function(t, n) {
|
|
1544
|
-
var o = t.children, r = t.direction, a = t.height,
|
|
1544
|
+
var o = t.children, r = t.direction, a = t.height, s = t.innerTagName, l = t.outerTagName, u = t.overscanColumnsCount, h = t.overscanCount, m = t.overscanRowsCount, v = t.width, p = n.instance;
|
|
1545
1545
|
if (process.env.NODE_ENV !== "production") {
|
|
1546
|
-
if (typeof
|
|
1546
|
+
if (typeof h == "number" && Be && !Be.has(p) && (Be.add(p), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof u == "number" || typeof m == "number") && Ze && !Ze.has(p) && (Ze.add(p), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (s != null || l != null) && je && !je.has(p) && (je.add(p), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), o == null)
|
|
1547
1547
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
1548
1548
|
switch (r) {
|
|
1549
1549
|
case "ltr":
|
|
@@ -1558,31 +1558,31 @@ var Uo = function(t, n) {
|
|
|
1558
1558
|
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (a === null ? "null" : typeof a) + '" was specified.'));
|
|
1559
1559
|
}
|
|
1560
1560
|
}, Kt = 50, Pn = function(t, n) {
|
|
1561
|
-
var o = t.rowCount, r = n.rowMetadataMap, a = n.estimatedRowHeight,
|
|
1562
|
-
if (
|
|
1563
|
-
var u = r[
|
|
1564
|
-
|
|
1561
|
+
var o = t.rowCount, r = n.rowMetadataMap, a = n.estimatedRowHeight, s = n.lastMeasuredRowIndex, l = 0;
|
|
1562
|
+
if (s >= o && (s = o - 1), s >= 0) {
|
|
1563
|
+
var u = r[s];
|
|
1564
|
+
l = u.offset + u.size;
|
|
1565
1565
|
}
|
|
1566
|
-
var
|
|
1567
|
-
return
|
|
1566
|
+
var h = o - s - 1, m = h * a;
|
|
1567
|
+
return l + m;
|
|
1568
1568
|
}, Sn = function(t, n) {
|
|
1569
|
-
var o = t.columnCount, r = n.columnMetadataMap, a = n.estimatedColumnWidth,
|
|
1570
|
-
if (
|
|
1571
|
-
var u = r[
|
|
1572
|
-
|
|
1569
|
+
var o = t.columnCount, r = n.columnMetadataMap, a = n.estimatedColumnWidth, s = n.lastMeasuredColumnIndex, l = 0;
|
|
1570
|
+
if (s >= o && (s = o - 1), s >= 0) {
|
|
1571
|
+
var u = r[s];
|
|
1572
|
+
l = u.offset + u.size;
|
|
1573
1573
|
}
|
|
1574
|
-
var
|
|
1575
|
-
return
|
|
1574
|
+
var h = o - s - 1, m = h * a;
|
|
1575
|
+
return l + m;
|
|
1576
1576
|
}, me = function(t, n, o, r) {
|
|
1577
|
-
var a,
|
|
1578
|
-
if (t === "column" ? (a = r.columnMetadataMap,
|
|
1577
|
+
var a, s, l;
|
|
1578
|
+
if (t === "column" ? (a = r.columnMetadataMap, s = n.columnWidth, l = r.lastMeasuredColumnIndex) : (a = r.rowMetadataMap, s = n.rowHeight, l = r.lastMeasuredRowIndex), o > l) {
|
|
1579
1579
|
var u = 0;
|
|
1580
|
-
if (
|
|
1581
|
-
var
|
|
1582
|
-
u =
|
|
1580
|
+
if (l >= 0) {
|
|
1581
|
+
var h = a[l];
|
|
1582
|
+
u = h.offset + h.size;
|
|
1583
1583
|
}
|
|
1584
|
-
for (var m =
|
|
1585
|
-
var v =
|
|
1584
|
+
for (var m = l + 1; m <= o; m++) {
|
|
1585
|
+
var v = s(m);
|
|
1586
1586
|
a[m] = {
|
|
1587
1587
|
offset: u,
|
|
1588
1588
|
size: v
|
|
@@ -1592,34 +1592,34 @@ var Uo = function(t, n) {
|
|
|
1592
1592
|
}
|
|
1593
1593
|
return a[o];
|
|
1594
1594
|
}, Xt = function(t, n, o, r) {
|
|
1595
|
-
var a,
|
|
1596
|
-
t === "column" ? (a = o.columnMetadataMap,
|
|
1597
|
-
var
|
|
1598
|
-
return
|
|
1599
|
-
}, yn = function(t, n, o, r, a,
|
|
1595
|
+
var a, s;
|
|
1596
|
+
t === "column" ? (a = o.columnMetadataMap, s = o.lastMeasuredColumnIndex) : (a = o.rowMetadataMap, s = o.lastMeasuredRowIndex);
|
|
1597
|
+
var l = s > 0 ? a[s].offset : 0;
|
|
1598
|
+
return l >= r ? yn(t, n, o, s, 0, r) : Bo(t, n, o, Math.max(0, s), r);
|
|
1599
|
+
}, yn = function(t, n, o, r, a, s) {
|
|
1600
1600
|
for (; a <= r; ) {
|
|
1601
|
-
var
|
|
1602
|
-
if (u ===
|
|
1603
|
-
return
|
|
1604
|
-
u <
|
|
1601
|
+
var l = a + Math.floor((r - a) / 2), u = me(t, n, l, o).offset;
|
|
1602
|
+
if (u === s)
|
|
1603
|
+
return l;
|
|
1604
|
+
u < s ? a = l + 1 : u > s && (r = l - 1);
|
|
1605
1605
|
}
|
|
1606
1606
|
return a > 0 ? a - 1 : 0;
|
|
1607
1607
|
}, Bo = function(t, n, o, r, a) {
|
|
1608
|
-
for (var
|
|
1609
|
-
r +=
|
|
1610
|
-
return yn(t, n, o, Math.min(r,
|
|
1611
|
-
}, Yt = function(t, n, o, r, a,
|
|
1612
|
-
var u = t === "column" ? n.width : n.height,
|
|
1613
|
-
switch (r === "smart" && (a >=
|
|
1608
|
+
for (var s = t === "column" ? n.columnCount : n.rowCount, l = 1; r < s && me(t, n, r, o).offset < a; )
|
|
1609
|
+
r += l, l *= 2;
|
|
1610
|
+
return yn(t, n, o, Math.min(r, s - 1), Math.floor(r / 2), a);
|
|
1611
|
+
}, Yt = function(t, n, o, r, a, s, l) {
|
|
1612
|
+
var u = t === "column" ? n.width : n.height, h = me(t, n, o, s), m = t === "column" ? Sn(n, s) : Pn(n, s), v = Math.max(0, Math.min(m - u, h.offset)), p = Math.max(0, h.offset - u + l + h.size);
|
|
1613
|
+
switch (r === "smart" && (a >= p - u && a <= v + u ? r = "auto" : r = "center"), r) {
|
|
1614
1614
|
case "start":
|
|
1615
1615
|
return v;
|
|
1616
1616
|
case "end":
|
|
1617
|
-
return
|
|
1617
|
+
return p;
|
|
1618
1618
|
case "center":
|
|
1619
|
-
return Math.round(
|
|
1619
|
+
return Math.round(p + (v - p) / 2);
|
|
1620
1620
|
case "auto":
|
|
1621
1621
|
default:
|
|
1622
|
-
return a >=
|
|
1622
|
+
return a >= p && a <= v ? a : p > v || a < p ? p : v;
|
|
1623
1623
|
}
|
|
1624
1624
|
}, Zo = /* @__PURE__ */ Vo({
|
|
1625
1625
|
getColumnOffset: function(t, n, o) {
|
|
@@ -1629,8 +1629,8 @@ var Uo = function(t, n) {
|
|
|
1629
1629
|
return Xt("column", t, o, n);
|
|
1630
1630
|
},
|
|
1631
1631
|
getColumnStopIndexForStartIndex: function(t, n, o, r) {
|
|
1632
|
-
for (var a = t.columnCount,
|
|
1633
|
-
m++,
|
|
1632
|
+
for (var a = t.columnCount, s = t.width, l = me("column", t, n, r), u = o + s, h = l.offset + l.size, m = n; m < a - 1 && h < u; )
|
|
1633
|
+
m++, h += me("column", t, m, r).size;
|
|
1634
1634
|
return m;
|
|
1635
1635
|
},
|
|
1636
1636
|
getColumnWidth: function(t, n, o) {
|
|
@@ -1638,11 +1638,11 @@ var Uo = function(t, n) {
|
|
|
1638
1638
|
},
|
|
1639
1639
|
getEstimatedTotalHeight: Pn,
|
|
1640
1640
|
getEstimatedTotalWidth: Sn,
|
|
1641
|
-
getOffsetForColumnAndAlignment: function(t, n, o, r, a,
|
|
1642
|
-
return Yt("column", t, n, o, r, a,
|
|
1641
|
+
getOffsetForColumnAndAlignment: function(t, n, o, r, a, s) {
|
|
1642
|
+
return Yt("column", t, n, o, r, a, s);
|
|
1643
1643
|
},
|
|
1644
|
-
getOffsetForRowAndAlignment: function(t, n, o, r, a,
|
|
1645
|
-
return Yt("row", t, n, o, r, a,
|
|
1644
|
+
getOffsetForRowAndAlignment: function(t, n, o, r, a, s) {
|
|
1645
|
+
return Yt("row", t, n, o, r, a, s);
|
|
1646
1646
|
},
|
|
1647
1647
|
getRowOffset: function(t, n, o) {
|
|
1648
1648
|
return me("row", t, n, o).offset;
|
|
@@ -1654,12 +1654,12 @@ var Uo = function(t, n) {
|
|
|
1654
1654
|
return Xt("row", t, o, n);
|
|
1655
1655
|
},
|
|
1656
1656
|
getRowStopIndexForStartIndex: function(t, n, o, r) {
|
|
1657
|
-
for (var a = t.rowCount,
|
|
1658
|
-
m++,
|
|
1657
|
+
for (var a = t.rowCount, s = t.height, l = me("row", t, n, r), u = o + s, h = l.offset + l.size, m = n; m < a - 1 && h < u; )
|
|
1658
|
+
m++, h += me("row", t, m, r).size;
|
|
1659
1659
|
return m;
|
|
1660
1660
|
},
|
|
1661
1661
|
initInstanceProps: function(t, n) {
|
|
1662
|
-
var o = t, r = o.estimatedColumnWidth, a = o.estimatedRowHeight,
|
|
1662
|
+
var o = t, r = o.estimatedColumnWidth, a = o.estimatedRowHeight, s = {
|
|
1663
1663
|
columnMetadataMap: {},
|
|
1664
1664
|
estimatedColumnWidth: r || Kt,
|
|
1665
1665
|
estimatedRowHeight: a || Kt,
|
|
@@ -1667,20 +1667,20 @@ var Uo = function(t, n) {
|
|
|
1667
1667
|
lastMeasuredRowIndex: -1,
|
|
1668
1668
|
rowMetadataMap: {}
|
|
1669
1669
|
};
|
|
1670
|
-
return n.resetAfterColumnIndex = function(
|
|
1670
|
+
return n.resetAfterColumnIndex = function(l, u) {
|
|
1671
1671
|
u === void 0 && (u = !0), n.resetAfterIndices({
|
|
1672
|
-
columnIndex:
|
|
1672
|
+
columnIndex: l,
|
|
1673
1673
|
shouldForceUpdate: u
|
|
1674
1674
|
});
|
|
1675
|
-
}, n.resetAfterRowIndex = function(
|
|
1675
|
+
}, n.resetAfterRowIndex = function(l, u) {
|
|
1676
1676
|
u === void 0 && (u = !0), n.resetAfterIndices({
|
|
1677
|
-
rowIndex:
|
|
1677
|
+
rowIndex: l,
|
|
1678
1678
|
shouldForceUpdate: u
|
|
1679
1679
|
});
|
|
1680
|
-
}, n.resetAfterIndices = function(
|
|
1681
|
-
var u =
|
|
1682
|
-
typeof u == "number" && (
|
|
1683
|
-
},
|
|
1680
|
+
}, n.resetAfterIndices = function(l) {
|
|
1681
|
+
var u = l.columnIndex, h = l.rowIndex, m = l.shouldForceUpdate, v = m === void 0 ? !0 : m;
|
|
1682
|
+
typeof u == "number" && (s.lastMeasuredColumnIndex = Math.min(s.lastMeasuredColumnIndex, u - 1)), typeof h == "number" && (s.lastMeasuredRowIndex = Math.min(s.lastMeasuredRowIndex, h - 1)), n._getItemStyleCache(-1), v && n.forceUpdate();
|
|
1683
|
+
}, s;
|
|
1684
1684
|
},
|
|
1685
1685
|
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
1686
1686
|
validateProps: function(t) {
|
|
@@ -1709,25 +1709,31 @@ function Xo(e, t) {
|
|
|
1709
1709
|
return !Jt(n, r) && !Jt(o, a);
|
|
1710
1710
|
}
|
|
1711
1711
|
const Yo = () => {
|
|
1712
|
-
const { viewMode: e } =
|
|
1713
|
-
|
|
1714
|
-
[
|
|
1715
|
-
),
|
|
1716
|
-
(
|
|
1712
|
+
const { viewMode: e } = Ae(), { scrollMode: t } = De(), { setColumnCount: n } = dn(), { virtualScrollableElementRef: o } = et(), r = qe(), a = W(() => r.heights.length, [r.heights]), s = W(() => t === ee.HORIZONTAL_SCROLLING ? a : e === He.DUAL_PAGE ? 2 : 1, [e, t, t, a, o]), l = W(() => r.widths.reduce((T, y, C) => {
|
|
1713
|
+
const S = C % s;
|
|
1714
|
+
return (!T[S] || y > T[S]) && (T[S] = y), T;
|
|
1715
|
+
}, []), [r.widths, s]), u = N(
|
|
1716
|
+
(w) => {
|
|
1717
|
+
const T = w % l.length;
|
|
1718
|
+
return l[T] || 0;
|
|
1719
|
+
},
|
|
1720
|
+
[l]
|
|
1721
|
+
), h = N(
|
|
1722
|
+
(w) => r.heights[w] || 0,
|
|
1717
1723
|
[r.heights]
|
|
1718
|
-
)
|
|
1724
|
+
);
|
|
1719
1725
|
k(() => {
|
|
1720
|
-
n(
|
|
1721
|
-
}, [
|
|
1722
|
-
const m = W(() => t === ee.HORIZONTAL_SCROLLING || t === ee.PAGE_SCROLLING ? 1 : Math.round(
|
|
1726
|
+
n(s);
|
|
1727
|
+
}, [s, n]);
|
|
1728
|
+
const m = W(() => t === ee.HORIZONTAL_SCROLLING || t === ee.PAGE_SCROLLING ? 1 : Math.round(a / s), [s, a, t]), v = W(() => r.heights.reduce((w, T) => w + T, 0) / r.heights.length || 0, [r]), p = W(() => r.widths.reduce((w, T) => w + T, 0) / r.heights.length || 0, [r]);
|
|
1723
1729
|
return {
|
|
1724
1730
|
rowCount: m,
|
|
1725
|
-
rowHeight:
|
|
1726
|
-
columnCount:
|
|
1727
|
-
columnWidth:
|
|
1731
|
+
rowHeight: h,
|
|
1732
|
+
columnCount: s,
|
|
1733
|
+
columnWidth: u,
|
|
1728
1734
|
pageDimension: r,
|
|
1729
1735
|
estimatedRowHeight: v,
|
|
1730
|
-
estimatedColumnWidth:
|
|
1736
|
+
estimatedColumnWidth: p
|
|
1731
1737
|
};
|
|
1732
1738
|
};
|
|
1733
1739
|
let oe;
|
|
@@ -1747,71 +1753,71 @@ ht == null || tn == null ? (_t = pt, bt = function(t) {
|
|
|
1747
1753
|
return [n, o];
|
|
1748
1754
|
});
|
|
1749
1755
|
function Jo(e) {
|
|
1750
|
-
let t, n, o, r, a,
|
|
1756
|
+
let t, n, o, r, a, s, l;
|
|
1751
1757
|
const u = typeof document < "u" && document.attachEvent;
|
|
1752
1758
|
if (!u) {
|
|
1753
|
-
|
|
1754
|
-
const d =
|
|
1759
|
+
s = function(S) {
|
|
1760
|
+
const d = S.__resizeTriggers__, f = d.firstElementChild, g = d.lastElementChild, c = f.firstElementChild;
|
|
1755
1761
|
g.scrollLeft = g.scrollWidth, g.scrollTop = g.scrollHeight, c.style.width = f.offsetWidth + 1 + "px", c.style.height = f.offsetHeight + 1 + "px", f.scrollLeft = f.scrollWidth, f.scrollTop = f.scrollHeight;
|
|
1756
|
-
}, a = function(
|
|
1757
|
-
return
|
|
1758
|
-
},
|
|
1759
|
-
if (
|
|
1762
|
+
}, a = function(S) {
|
|
1763
|
+
return S.offsetWidth !== S.__resizeLast__.width || S.offsetHeight !== S.__resizeLast__.height;
|
|
1764
|
+
}, l = function(S) {
|
|
1765
|
+
if (S.target.className && typeof S.target.className.indexOf == "function" && S.target.className.indexOf("contract-trigger") < 0 && S.target.className.indexOf("expand-trigger") < 0)
|
|
1760
1766
|
return;
|
|
1761
1767
|
const d = this;
|
|
1762
|
-
|
|
1768
|
+
s(this), this.__resizeRAF__ && _t(this.__resizeRAF__), this.__resizeRAF__ = bt(function() {
|
|
1763
1769
|
a(d) && (d.__resizeLast__.width = d.offsetWidth, d.__resizeLast__.height = d.offsetHeight, d.__resizeListeners__.forEach(function(c) {
|
|
1764
|
-
c.call(d,
|
|
1770
|
+
c.call(d, S);
|
|
1765
1771
|
}));
|
|
1766
1772
|
});
|
|
1767
1773
|
};
|
|
1768
|
-
let
|
|
1774
|
+
let p = !1, w = "";
|
|
1769
1775
|
o = "animationstart";
|
|
1770
1776
|
const T = "Webkit Moz O ms".split(" ");
|
|
1771
|
-
let
|
|
1777
|
+
let y = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), C = "";
|
|
1772
1778
|
{
|
|
1773
|
-
const
|
|
1774
|
-
if (
|
|
1779
|
+
const S = document.createElement("fakeelement");
|
|
1780
|
+
if (S.style.animationName !== void 0 && (p = !0), p === !1) {
|
|
1775
1781
|
for (let d = 0; d < T.length; d++)
|
|
1776
|
-
if (
|
|
1777
|
-
C = T[d],
|
|
1782
|
+
if (S.style[T[d] + "AnimationName"] !== void 0) {
|
|
1783
|
+
C = T[d], w = "-" + C.toLowerCase() + "-", o = y[d], p = !0;
|
|
1778
1784
|
break;
|
|
1779
1785
|
}
|
|
1780
1786
|
}
|
|
1781
1787
|
}
|
|
1782
|
-
n = "resizeanim", t = "@" +
|
|
1788
|
+
n = "resizeanim", t = "@" + w + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", r = w + "animation: 1ms " + n + "; ";
|
|
1783
1789
|
}
|
|
1784
|
-
const
|
|
1785
|
-
if (!
|
|
1786
|
-
const
|
|
1787
|
-
|
|
1790
|
+
const h = function(p) {
|
|
1791
|
+
if (!p.getElementById("detectElementResize")) {
|
|
1792
|
+
const w = (t || "") + ".resize-triggers { " + (r || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', T = p.head || p.getElementsByTagName("head")[0], y = p.createElement("style");
|
|
1793
|
+
y.id = "detectElementResize", y.type = "text/css", e != null && y.setAttribute("nonce", e), y.styleSheet ? y.styleSheet.cssText = w : y.appendChild(p.createTextNode(w)), T.appendChild(y);
|
|
1788
1794
|
}
|
|
1789
1795
|
};
|
|
1790
1796
|
return {
|
|
1791
|
-
addResizeListener: function(
|
|
1797
|
+
addResizeListener: function(p, w) {
|
|
1792
1798
|
if (u)
|
|
1793
|
-
|
|
1799
|
+
p.attachEvent("onresize", w);
|
|
1794
1800
|
else {
|
|
1795
|
-
if (!
|
|
1796
|
-
const T =
|
|
1797
|
-
|
|
1801
|
+
if (!p.__resizeTriggers__) {
|
|
1802
|
+
const T = p.ownerDocument, y = oe.getComputedStyle(p);
|
|
1803
|
+
y && y.position === "static" && (p.style.position = "relative"), h(T), p.__resizeLast__ = {}, p.__resizeListeners__ = [], (p.__resizeTriggers__ = T.createElement("div")).className = "resize-triggers";
|
|
1798
1804
|
const C = T.createElement("div");
|
|
1799
1805
|
C.className = "expand-trigger", C.appendChild(T.createElement("div"));
|
|
1800
|
-
const
|
|
1801
|
-
|
|
1802
|
-
f.animationName === n &&
|
|
1803
|
-
},
|
|
1806
|
+
const S = T.createElement("div");
|
|
1807
|
+
S.className = "contract-trigger", p.__resizeTriggers__.appendChild(C), p.__resizeTriggers__.appendChild(S), p.appendChild(p.__resizeTriggers__), s(p), p.addEventListener("scroll", l, !0), o && (p.__resizeTriggers__.__animationListener__ = function(f) {
|
|
1808
|
+
f.animationName === n && s(p);
|
|
1809
|
+
}, p.__resizeTriggers__.addEventListener(o, p.__resizeTriggers__.__animationListener__));
|
|
1804
1810
|
}
|
|
1805
|
-
|
|
1811
|
+
p.__resizeListeners__.push(w);
|
|
1806
1812
|
}
|
|
1807
1813
|
},
|
|
1808
|
-
removeResizeListener: function(
|
|
1814
|
+
removeResizeListener: function(p, w) {
|
|
1809
1815
|
if (u)
|
|
1810
|
-
|
|
1811
|
-
else if (
|
|
1812
|
-
|
|
1816
|
+
p.detachEvent("onresize", w);
|
|
1817
|
+
else if (p.__resizeListeners__.splice(p.__resizeListeners__.indexOf(w), 1), !p.__resizeListeners__.length) {
|
|
1818
|
+
p.removeEventListener("scroll", l, !0), p.__resizeTriggers__.__animationListener__ && (p.__resizeTriggers__.removeEventListener(o, p.__resizeTriggers__.__animationListener__), p.__resizeTriggers__.__animationListener__ = null);
|
|
1813
1819
|
try {
|
|
1814
|
-
|
|
1820
|
+
p.__resizeTriggers__ = !p.removeChild(p.__resizeTriggers__);
|
|
1815
1821
|
} catch {
|
|
1816
1822
|
}
|
|
1817
1823
|
}
|
|
@@ -1833,16 +1839,16 @@ class Qo extends Qn {
|
|
|
1833
1839
|
onResize: r
|
|
1834
1840
|
} = this.props;
|
|
1835
1841
|
if (this._parentNode) {
|
|
1836
|
-
const a = window.getComputedStyle(this._parentNode) || {},
|
|
1837
|
-
(!n && (this.state.height !==
|
|
1838
|
-
height:
|
|
1842
|
+
const a = window.getComputedStyle(this._parentNode) || {}, s = parseFloat(a.paddingLeft || "0"), l = parseFloat(a.paddingRight || "0"), u = parseFloat(a.paddingTop || "0"), h = parseFloat(a.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(), v = m.height - u - h, p = m.width - s - l, w = this._parentNode.offsetHeight - u - h, T = this._parentNode.offsetWidth - s - l;
|
|
1843
|
+
(!n && (this.state.height !== w || this.state.scaledHeight !== v) || !o && (this.state.width !== T || this.state.scaledWidth !== p)) && (this.setState({
|
|
1844
|
+
height: w,
|
|
1839
1845
|
width: T,
|
|
1840
1846
|
scaledHeight: v,
|
|
1841
|
-
scaledWidth:
|
|
1847
|
+
scaledWidth: p
|
|
1842
1848
|
}), typeof r == "function" && r({
|
|
1843
|
-
height:
|
|
1849
|
+
height: w,
|
|
1844
1850
|
scaledHeight: v,
|
|
1845
|
-
scaledWidth:
|
|
1851
|
+
scaledWidth: p,
|
|
1846
1852
|
width: T
|
|
1847
1853
|
}));
|
|
1848
1854
|
}
|
|
@@ -1872,39 +1878,39 @@ class Qo extends Qn {
|
|
|
1872
1878
|
defaultWidth: o,
|
|
1873
1879
|
disableHeight: r = !1,
|
|
1874
1880
|
disableWidth: a = !1,
|
|
1875
|
-
doNotBailOutOnEmptyChildren:
|
|
1876
|
-
nonce:
|
|
1881
|
+
doNotBailOutOnEmptyChildren: s = !1,
|
|
1882
|
+
nonce: l,
|
|
1877
1883
|
onResize: u,
|
|
1878
|
-
style:
|
|
1884
|
+
style: h = {},
|
|
1879
1885
|
tagName: m = "div",
|
|
1880
1886
|
...v
|
|
1881
1887
|
} = this.props, {
|
|
1882
|
-
height:
|
|
1883
|
-
scaledHeight:
|
|
1888
|
+
height: p,
|
|
1889
|
+
scaledHeight: w,
|
|
1884
1890
|
scaledWidth: T,
|
|
1885
|
-
width:
|
|
1891
|
+
width: y
|
|
1886
1892
|
} = this.state, C = {
|
|
1887
1893
|
overflow: "visible"
|
|
1888
|
-
},
|
|
1894
|
+
}, S = {};
|
|
1889
1895
|
let d = !1;
|
|
1890
|
-
return r || (
|
|
1896
|
+
return r || (p === 0 && (d = !0), C.height = 0, S.height = p, S.scaledHeight = w), a || (y === 0 && (d = !0), C.width = 0, S.width = y, S.scaledWidth = T), s && (d = !1), Ue(m, {
|
|
1891
1897
|
ref: this._setRef,
|
|
1892
1898
|
style: {
|
|
1893
1899
|
...C,
|
|
1894
|
-
...
|
|
1900
|
+
...h
|
|
1895
1901
|
},
|
|
1896
1902
|
...v
|
|
1897
|
-
}, !d && t(
|
|
1903
|
+
}, !d && t(S));
|
|
1898
1904
|
}
|
|
1899
1905
|
}
|
|
1900
1906
|
const ei = ({ widths: e, heights: t }) => {
|
|
1901
1907
|
const { focusedPage: n, totalPages: o } = ie(), r = W(() => {
|
|
1902
|
-
const
|
|
1903
|
-
if (
|
|
1904
|
-
const
|
|
1905
|
-
|
|
1908
|
+
const l = [], u = Math.ceil(n / 2) * 2 - 1;
|
|
1909
|
+
if (l.push(u), u + 1 < o) {
|
|
1910
|
+
const h = u + 1;
|
|
1911
|
+
l.push(h);
|
|
1906
1912
|
}
|
|
1907
|
-
return
|
|
1913
|
+
return l;
|
|
1908
1914
|
}, [n, o]), a = W(() => [
|
|
1909
1915
|
{
|
|
1910
1916
|
position: "absolute",
|
|
@@ -1919,8 +1925,8 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
1919
1925
|
width: e(n),
|
|
1920
1926
|
height: t(n)
|
|
1921
1927
|
}
|
|
1922
|
-
], [e, t, r]),
|
|
1923
|
-
return /* @__PURE__ */ i("div", { style: { width:
|
|
1928
|
+
], [e, t, r]), s = W(() => a.reduce((l, u) => l + Number(u.width || 0), 0), [a]);
|
|
1929
|
+
return /* @__PURE__ */ i("div", { style: { width: s, position: "relative" }, children: r.map((l, u) => /* @__PURE__ */ i(It, { style: a[u], pageNumber: l }, l)) });
|
|
1924
1930
|
}, ti = ({ widths: e, heights: t }) => {
|
|
1925
1931
|
const { focusedPage: n } = ie(), o = W(() => ({
|
|
1926
1932
|
position: "absolute",
|
|
@@ -1938,11 +1944,11 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
1938
1944
|
}
|
|
1939
1945
|
);
|
|
1940
1946
|
}, ni = (e, t, n) => {
|
|
1941
|
-
const o = H(), { contentRef: r } = ge(), { heights: a, widths:
|
|
1942
|
-
const C =
|
|
1947
|
+
const o = H(), { contentRef: r } = ge(), { heights: a, widths: s } = qe(), { setFocusedPage: l } = ie(), [u, h] = $([]), { targetScrollPage: m } = un(), v = Tt(u, 0, 500), p = W(() => a.map((T, y) => {
|
|
1948
|
+
const C = s[y], S = Vr(y + 1, e), d = C * S.columnIndex, f = T * S.rowIndex, g = d + C, c = f + T;
|
|
1943
1949
|
return {
|
|
1944
|
-
pageNumber:
|
|
1945
|
-
...
|
|
1950
|
+
pageNumber: y + 1,
|
|
1951
|
+
...S,
|
|
1946
1952
|
width: C,
|
|
1947
1953
|
height: T,
|
|
1948
1954
|
startX: d,
|
|
@@ -1950,71 +1956,71 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
1950
1956
|
endX: g,
|
|
1951
1957
|
endY: c
|
|
1952
1958
|
};
|
|
1953
|
-
}), [a,
|
|
1959
|
+
}), [a, s, e, t]);
|
|
1954
1960
|
k(() => {
|
|
1955
|
-
var
|
|
1956
|
-
v.length > 0 && !m.current &&
|
|
1957
|
-
let T = (
|
|
1961
|
+
var y;
|
|
1962
|
+
v.length > 0 && !m.current && l(v[0].pageNumber);
|
|
1963
|
+
let T = (y = v[0]) == null ? void 0 : y.ratio;
|
|
1958
1964
|
T && v.filter((C) => Math.round(C.ratio) === Math.round(T)).some((C) => C.pageNumber === m.current) && setTimeout(() => {
|
|
1959
1965
|
m.current = void 0;
|
|
1960
1966
|
}, 500);
|
|
1961
|
-
}, [v,
|
|
1962
|
-
const
|
|
1967
|
+
}, [v, l]);
|
|
1968
|
+
const w = N(
|
|
1963
1969
|
(T) => {
|
|
1964
1970
|
o.current && cancelAnimationFrame(o.current), o.current = requestAnimationFrame(() => {
|
|
1965
|
-
const
|
|
1966
|
-
startTop:
|
|
1967
|
-
startLeft:
|
|
1968
|
-
endTop:
|
|
1969
|
-
endLeft:
|
|
1970
|
-
},
|
|
1971
|
+
const y = T.target, C = {
|
|
1972
|
+
startTop: y.scrollTop,
|
|
1973
|
+
startLeft: y.scrollLeft,
|
|
1974
|
+
endTop: y.scrollTop + y.clientHeight,
|
|
1975
|
+
endLeft: y.scrollLeft + y.clientWidth
|
|
1976
|
+
}, S = p.filter((d) => {
|
|
1971
1977
|
const f = d.endX >= C.startLeft && d.endY >= C.startTop, g = d.startX <= C.endLeft && d.startY <= C.endTop;
|
|
1972
1978
|
return f && g;
|
|
1973
1979
|
}).map((d) => {
|
|
1974
|
-
const f = C.startLeft > d.startX ? C.startLeft : d.startX, g = C.startTop > d.startY ? C.startTop : d.startY, c = C.endLeft < d.endX ? C.endLeft : d.endX, b = C.endTop < d.endY ? C.endTop : d.endY,
|
|
1980
|
+
const f = C.startLeft > d.startX ? C.startLeft : d.startX, g = C.startTop > d.startY ? C.startTop : d.startY, c = C.endLeft < d.endX ? C.endLeft : d.endX, b = C.endTop < d.endY ? C.endTop : d.endY, _ = c - f, P = b - g, x = +(_ * P / (d.width * d.height) * 100).toFixed(2);
|
|
1975
1981
|
return {
|
|
1976
1982
|
pageNumber: d.pageNumber,
|
|
1977
1983
|
ratio: x
|
|
1978
1984
|
};
|
|
1979
1985
|
}).sort((d, f) => f.ratio - d.ratio);
|
|
1980
|
-
|
|
1986
|
+
h(S);
|
|
1981
1987
|
});
|
|
1982
1988
|
},
|
|
1983
|
-
[r,
|
|
1989
|
+
[r, p]
|
|
1984
1990
|
);
|
|
1985
1991
|
k(() => {
|
|
1986
1992
|
if (n)
|
|
1987
|
-
return n == null || n.addEventListener("scroll",
|
|
1988
|
-
n == null || n.removeEventListener("scroll",
|
|
1993
|
+
return n == null || n.addEventListener("scroll", w), () => {
|
|
1994
|
+
n == null || n.removeEventListener("scroll", w);
|
|
1989
1995
|
};
|
|
1990
|
-
}, [n,
|
|
1996
|
+
}, [n, w]);
|
|
1991
1997
|
}, ri = er(({ columnIndex: e, rowIndex: t, data: n, style: o }) => {
|
|
1992
1998
|
const r = Ur(t, e, n.columnCount);
|
|
1993
1999
|
return /* @__PURE__ */ i(It, { style: o, pageNumber: r }, r);
|
|
1994
2000
|
}, Xo), qs = () => {
|
|
1995
2001
|
const { initialPage: e = 1, initialScrollMode: t, instanceId: n } = ar(), { pagesRef: o, setPagesRef: r } = ge(), { scrollToPage: a } = vn(), {
|
|
1996
|
-
virtualScrollRef:
|
|
1997
|
-
getVirtualScrollRef:
|
|
2002
|
+
virtualScrollRef: s,
|
|
2003
|
+
getVirtualScrollRef: l,
|
|
1998
2004
|
getPageScrollElementRef: u,
|
|
1999
|
-
getVirtualScrollableElementRef:
|
|
2005
|
+
getVirtualScrollableElementRef: h,
|
|
2000
2006
|
setTotalInnerDimensions: m,
|
|
2001
2007
|
virtualScrollableElementRef: v,
|
|
2002
|
-
totalInnerDimensions:
|
|
2003
|
-
pageScrollElementRef:
|
|
2004
|
-
} = et(), T = H(!0), { nextPage:
|
|
2005
|
-
|
|
2008
|
+
totalInnerDimensions: p,
|
|
2009
|
+
pageScrollElementRef: w
|
|
2010
|
+
} = et(), T = H(!0), { nextPage: y, prevPage: C, setFocusedPage: S, focusedPage: d } = ie(), { scrollMode: f } = De(), { viewMode: g } = Ae(), c = H(null), { loading: b } = J(), { passwordRequired: _ } = nr(), { LoaderImageComponent: P } = pn(), E = H(
|
|
2011
|
+
p
|
|
2006
2012
|
), x = H({
|
|
2007
2013
|
viewMode: g,
|
|
2008
2014
|
scrollMode: f
|
|
2009
|
-
}), R = H(!1), D = H(), { isFullScreen:
|
|
2010
|
-
pageDimension:
|
|
2015
|
+
}), R = H(!1), D = H(), { isFullScreen: A } = sr(), {
|
|
2016
|
+
pageDimension: z,
|
|
2011
2017
|
rowCount: L,
|
|
2012
2018
|
rowHeight: I,
|
|
2013
2019
|
columnCount: O,
|
|
2014
2020
|
columnWidth: M,
|
|
2015
2021
|
estimatedColumnWidth: G,
|
|
2016
2022
|
estimatedRowHeight: Z
|
|
2017
|
-
} = Yo(), j = Tt(
|
|
2023
|
+
} = Yo(), j = Tt(p, 100), U = H();
|
|
2018
2024
|
ni(O, L, v);
|
|
2019
2025
|
const Q = H({
|
|
2020
2026
|
scrollTop: 0,
|
|
@@ -2023,27 +2029,27 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2023
2029
|
Gr(o);
|
|
2024
2030
|
const { isPressed: X } = Hr(), { selectionMode: le } = ir(), { initializeGrabScroll: ae, resetGrabState: de } = $r({
|
|
2025
2031
|
isPressed: X
|
|
2026
|
-
}), te = W(() => le === tr.HAND, [le]),
|
|
2032
|
+
}), te = W(() => le === tr.HAND, [le]), ze = W(() => ({
|
|
2027
2033
|
columnCount: O
|
|
2028
2034
|
}), [O]), Re = N(
|
|
2029
2035
|
(q) => {
|
|
2030
2036
|
const V = document.activeElement !== o;
|
|
2031
|
-
!
|
|
2037
|
+
!A && V || (["ArrowUp", "ArrowLeft"].includes(q.key) ? (q.preventDefault(), C()) : ["ArrowDown", "ArrowRight"].includes(q.key) && (q.preventDefault(), y()));
|
|
2032
2038
|
},
|
|
2033
|
-
[
|
|
2039
|
+
[y, C, A, f]
|
|
2034
2040
|
);
|
|
2035
2041
|
k(() => (window.addEventListener("keydown", Re), () => {
|
|
2036
2042
|
window.removeEventListener("keydown", Re);
|
|
2037
2043
|
}), [Re]), k(() => {
|
|
2038
|
-
if (c.current && (c.current.style.position = "relative"), !!
|
|
2044
|
+
if (c.current && (c.current.style.position = "relative"), !!s)
|
|
2039
2045
|
for (let q = 0; q < L; q++)
|
|
2040
2046
|
for (let V = 0; V < O; V++)
|
|
2041
|
-
|
|
2047
|
+
s.resetAfterIndices({
|
|
2042
2048
|
columnIndex: V,
|
|
2043
2049
|
rowIndex: q,
|
|
2044
2050
|
shouldForceUpdate: !0
|
|
2045
2051
|
});
|
|
2046
|
-
}, [L, O,
|
|
2052
|
+
}, [L, O, z, s]);
|
|
2047
2053
|
const Te = N(
|
|
2048
2054
|
(q, V) => {
|
|
2049
2055
|
if (!v)
|
|
@@ -2075,7 +2081,7 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2075
2081
|
const jn = Se / Ot * ye, Kn = ot / Dt * it, Xn = Math.round(Math.min(jn, ye)) || 0, Yn = Math.round(Math.min(Kn, it)) || 0;
|
|
2076
2082
|
D.current = setTimeout(() => {
|
|
2077
2083
|
requestAnimationFrame(() => {
|
|
2078
|
-
|
|
2084
|
+
s == null || s.scrollTo({
|
|
2079
2085
|
scrollTop: Xn,
|
|
2080
2086
|
scrollLeft: Yn
|
|
2081
2087
|
});
|
|
@@ -2085,7 +2091,7 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2085
2091
|
width: V.width
|
|
2086
2092
|
};
|
|
2087
2093
|
},
|
|
2088
|
-
[
|
|
2094
|
+
[s, g, f, a]
|
|
2089
2095
|
);
|
|
2090
2096
|
k(() => {
|
|
2091
2097
|
clearTimeout(D.current);
|
|
@@ -2100,7 +2106,7 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2100
2106
|
height: q,
|
|
2101
2107
|
width: V
|
|
2102
2108
|
});
|
|
2103
|
-
}, [
|
|
2109
|
+
}, [z, L, O, we]);
|
|
2104
2110
|
const nt = N(
|
|
2105
2111
|
(q) => {
|
|
2106
2112
|
Q.current = {
|
|
@@ -2130,16 +2136,16 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2130
2136
|
}, [b]), k(() => {
|
|
2131
2137
|
if (!(j.height === 0 || !T.current)) {
|
|
2132
2138
|
if (t === ee.PAGE_SCROLLING) {
|
|
2133
|
-
e !== d &&
|
|
2139
|
+
e !== d && w && S(e), T.current = !1;
|
|
2134
2140
|
return;
|
|
2135
2141
|
}
|
|
2136
|
-
a(e, "auto"),
|
|
2142
|
+
a(e, "auto"), S(e), T.current = !1;
|
|
2137
2143
|
}
|
|
2138
2144
|
}, [
|
|
2139
2145
|
a,
|
|
2140
2146
|
t,
|
|
2141
|
-
|
|
2142
|
-
|
|
2147
|
+
w,
|
|
2148
|
+
S,
|
|
2143
2149
|
j
|
|
2144
2150
|
]), /* @__PURE__ */ F(fe, { children: [
|
|
2145
2151
|
/* @__PURE__ */ i("div", { id: n, ref: r, tabIndex: -1, className: rt, children: /* @__PURE__ */ i(Qo, { style: { minHeight: "50px" }, children: ({ width: q, height: V }) => /* @__PURE__ */ i("div", { "data-rp": "pages", ref: Zn, style: { width: q, height: V }, children: f === ee.PAGE_SCROLLING ? /* @__PURE__ */ i(
|
|
@@ -2153,9 +2159,9 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2153
2159
|
) : G ? /* @__PURE__ */ i(
|
|
2154
2160
|
Zo,
|
|
2155
2161
|
{
|
|
2156
|
-
ref:
|
|
2157
|
-
itemData:
|
|
2158
|
-
outerRef:
|
|
2162
|
+
ref: l,
|
|
2163
|
+
itemData: ze,
|
|
2164
|
+
outerRef: h,
|
|
2159
2165
|
innerRef: c,
|
|
2160
2166
|
onScroll: nt,
|
|
2161
2167
|
columnCount: O,
|
|
@@ -2186,7 +2192,7 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2186
2192
|
children: P && /* @__PURE__ */ i(P, {})
|
|
2187
2193
|
}
|
|
2188
2194
|
) }) }) }),
|
|
2189
|
-
|
|
2195
|
+
_ && /* @__PURE__ */ i(qr, {})
|
|
2190
2196
|
] });
|
|
2191
2197
|
}, Fe = {
|
|
2192
2198
|
"rp-toolbar-content": "_rp-toolbar-content_sz31z_1",
|
|
@@ -2205,23 +2211,23 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2205
2211
|
const { nextIcon: e } = pe();
|
|
2206
2212
|
return e || /* @__PURE__ */ i(Me, { style: { transform: "rotate(180deg" } });
|
|
2207
2213
|
}, ai = () => {
|
|
2208
|
-
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: a } = ie(), [
|
|
2214
|
+
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: a } = ie(), [s, l] = $(e.toString()), { pageNavigationTool: u = !0 } = ve(), { isSmallScreen: h } = Ce(), { localeMessages: m } = se();
|
|
2209
2215
|
k(() => {
|
|
2210
|
-
|
|
2216
|
+
l(e.toString());
|
|
2211
2217
|
}, [e]);
|
|
2212
|
-
const v = N((
|
|
2213
|
-
const C =
|
|
2214
|
-
|
|
2215
|
-
}, []),
|
|
2216
|
-
const
|
|
2217
|
-
|
|
2218
|
-
}, [a,
|
|
2219
|
-
|
|
2218
|
+
const v = N((y) => {
|
|
2219
|
+
const C = y.target.value;
|
|
2220
|
+
l(C);
|
|
2221
|
+
}, []), p = N(async () => {
|
|
2222
|
+
const y = a(s);
|
|
2223
|
+
y.success || l(y.currentPage.toString());
|
|
2224
|
+
}, [a, s, t]), w = N(() => {
|
|
2225
|
+
l(e.toString());
|
|
2220
2226
|
}, [e]), T = N(
|
|
2221
|
-
(
|
|
2222
|
-
|
|
2227
|
+
(y) => {
|
|
2228
|
+
y.key === "Enter" && p();
|
|
2223
2229
|
},
|
|
2224
|
-
[
|
|
2230
|
+
[p]
|
|
2225
2231
|
);
|
|
2226
2232
|
return typeof u != "boolean" ? /* @__PURE__ */ i(
|
|
2227
2233
|
u,
|
|
@@ -2234,7 +2240,7 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2234
2240
|
changePage: n
|
|
2235
2241
|
}
|
|
2236
2242
|
) : u ? /* @__PURE__ */ F("div", { className: mt["rp-paginate"], children: [
|
|
2237
|
-
!
|
|
2243
|
+
!h && /* @__PURE__ */ i(K, { content: m == null ? void 0 : m.previousPageTooltip, children: /* @__PURE__ */ i(
|
|
2238
2244
|
re,
|
|
2239
2245
|
{
|
|
2240
2246
|
onClick: r,
|
|
@@ -2247,9 +2253,9 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2247
2253
|
ln,
|
|
2248
2254
|
{
|
|
2249
2255
|
onKeyDown: T,
|
|
2250
|
-
onBlur:
|
|
2256
|
+
onBlur: w,
|
|
2251
2257
|
onChange: v,
|
|
2252
|
-
value:
|
|
2258
|
+
value: s,
|
|
2253
2259
|
className: mt["rp-page-input"]
|
|
2254
2260
|
}
|
|
2255
2261
|
) }),
|
|
@@ -2257,7 +2263,7 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2257
2263
|
"/",
|
|
2258
2264
|
t
|
|
2259
2265
|
] }),
|
|
2260
|
-
!
|
|
2266
|
+
!h && /* @__PURE__ */ i(K, { content: m == null ? void 0 : m.nextPageTooltip, children: /* @__PURE__ */ i(
|
|
2261
2267
|
re,
|
|
2262
2268
|
{
|
|
2263
2269
|
onClick: o,
|
|
@@ -2275,8 +2281,8 @@ var Rt = "Dialog", [xn, Vs] = Xr(Rt), [si, ce] = xn(Rt), In = (e) => {
|
|
|
2275
2281
|
open: o,
|
|
2276
2282
|
defaultOpen: r,
|
|
2277
2283
|
onOpenChange: a,
|
|
2278
|
-
modal:
|
|
2279
|
-
} = e,
|
|
2284
|
+
modal: s = !0
|
|
2285
|
+
} = e, l = B.useRef(null), u = B.useRef(null), [h = !1, m] = Qr({
|
|
2280
2286
|
prop: o,
|
|
2281
2287
|
defaultProp: r,
|
|
2282
2288
|
onChange: a
|
|
@@ -2285,15 +2291,15 @@ var Rt = "Dialog", [xn, Vs] = Xr(Rt), [si, ce] = xn(Rt), In = (e) => {
|
|
|
2285
2291
|
si,
|
|
2286
2292
|
{
|
|
2287
2293
|
scope: t,
|
|
2288
|
-
triggerRef:
|
|
2294
|
+
triggerRef: l,
|
|
2289
2295
|
contentRef: u,
|
|
2290
2296
|
contentId: ct(),
|
|
2291
2297
|
titleId: ct(),
|
|
2292
2298
|
descriptionId: ct(),
|
|
2293
|
-
open:
|
|
2299
|
+
open: h,
|
|
2294
2300
|
onOpenChange: m,
|
|
2295
2301
|
onOpenToggle: B.useCallback(() => m((v) => !v), [m]),
|
|
2296
|
-
modal:
|
|
2302
|
+
modal: s,
|
|
2297
2303
|
children: n
|
|
2298
2304
|
}
|
|
2299
2305
|
);
|
|
@@ -2322,7 +2328,7 @@ var Lt = "DialogPortal", [li, Ln] = xn(Lt, {
|
|
|
2322
2328
|
forceMount: void 0
|
|
2323
2329
|
}), En = (e) => {
|
|
2324
2330
|
const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, a = ce(Lt, t);
|
|
2325
|
-
return /* @__PURE__ */ i(li, { scope: t, forceMount: n, children: B.Children.map(o, (
|
|
2331
|
+
return /* @__PURE__ */ i(li, { scope: t, forceMount: n, children: B.Children.map(o, (s) => /* @__PURE__ */ i(St, { present: n || a.open, children: /* @__PURE__ */ i(oo, { asChild: !0, container: r, children: s }) })) });
|
|
2326
2332
|
};
|
|
2327
2333
|
En.displayName = Lt;
|
|
2328
2334
|
var Xe = "DialogOverlay", Nn = B.forwardRef(
|
|
@@ -2371,12 +2377,12 @@ var ui = B.forwardRef(
|
|
|
2371
2377
|
trapFocus: n.open,
|
|
2372
2378
|
disableOutsidePointerEvents: !0,
|
|
2373
2379
|
onCloseAutoFocus: We(e.onCloseAutoFocus, (a) => {
|
|
2374
|
-
var
|
|
2375
|
-
a.preventDefault(), (
|
|
2380
|
+
var s;
|
|
2381
|
+
a.preventDefault(), (s = n.triggerRef.current) == null || s.focus();
|
|
2376
2382
|
}),
|
|
2377
2383
|
onPointerDownOutside: We(e.onPointerDownOutside, (a) => {
|
|
2378
|
-
const
|
|
2379
|
-
(
|
|
2384
|
+
const s = a.detail.originalEvent, l = s.button === 0 && s.ctrlKey === !0;
|
|
2385
|
+
(s.button === 2 || l) && a.preventDefault();
|
|
2380
2386
|
}),
|
|
2381
2387
|
onFocusOutside: We(
|
|
2382
2388
|
e.onFocusOutside,
|
|
@@ -2396,21 +2402,21 @@ var ui = B.forwardRef(
|
|
|
2396
2402
|
trapFocus: !1,
|
|
2397
2403
|
disableOutsidePointerEvents: !1,
|
|
2398
2404
|
onCloseAutoFocus: (a) => {
|
|
2399
|
-
var
|
|
2400
|
-
(
|
|
2405
|
+
var s, l;
|
|
2406
|
+
(s = e.onCloseAutoFocus) == null || s.call(e, a), a.defaultPrevented || (o.current || (l = n.triggerRef.current) == null || l.focus(), a.preventDefault()), o.current = !1, r.current = !1;
|
|
2401
2407
|
},
|
|
2402
2408
|
onInteractOutside: (a) => {
|
|
2403
|
-
var u,
|
|
2409
|
+
var u, h;
|
|
2404
2410
|
(u = e.onInteractOutside) == null || u.call(e, a), a.defaultPrevented || (o.current = !0, a.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
2405
|
-
const
|
|
2406
|
-
((
|
|
2411
|
+
const s = a.target;
|
|
2412
|
+
((h = n.triggerRef.current) == null ? void 0 : h.contains(s)) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && r.current && a.preventDefault();
|
|
2407
2413
|
}
|
|
2408
2414
|
}
|
|
2409
2415
|
);
|
|
2410
2416
|
}
|
|
2411
2417
|
), Dn = B.forwardRef(
|
|
2412
2418
|
(e, t) => {
|
|
2413
|
-
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: a, ...
|
|
2419
|
+
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: a, ...s } = e, l = ce(Ie, n), u = B.useRef(null), h = Pt(t, u);
|
|
2414
2420
|
return no(), /* @__PURE__ */ F(fe, { children: [
|
|
2415
2421
|
/* @__PURE__ */ i(
|
|
2416
2422
|
ro,
|
|
@@ -2424,37 +2430,37 @@ var ui = B.forwardRef(
|
|
|
2424
2430
|
eo,
|
|
2425
2431
|
{
|
|
2426
2432
|
role: "dialog",
|
|
2427
|
-
id:
|
|
2428
|
-
"aria-describedby":
|
|
2429
|
-
"aria-labelledby":
|
|
2430
|
-
"data-state": Nt(
|
|
2431
|
-
...
|
|
2432
|
-
ref:
|
|
2433
|
-
onDismiss: () =>
|
|
2433
|
+
id: l.contentId,
|
|
2434
|
+
"aria-describedby": l.descriptionId,
|
|
2435
|
+
"aria-labelledby": l.titleId,
|
|
2436
|
+
"data-state": Nt(l.open),
|
|
2437
|
+
...s,
|
|
2438
|
+
ref: h,
|
|
2439
|
+
onDismiss: () => l.onOpenChange(!1)
|
|
2434
2440
|
}
|
|
2435
2441
|
)
|
|
2436
2442
|
}
|
|
2437
2443
|
),
|
|
2438
2444
|
/* @__PURE__ */ F(fe, { children: [
|
|
2439
|
-
/* @__PURE__ */ i(mi, { titleId:
|
|
2440
|
-
/* @__PURE__ */ i(gi, { contentRef: u, descriptionId:
|
|
2445
|
+
/* @__PURE__ */ i(mi, { titleId: l.titleId }),
|
|
2446
|
+
/* @__PURE__ */ i(gi, { contentRef: u, descriptionId: l.descriptionId })
|
|
2441
2447
|
] })
|
|
2442
2448
|
] });
|
|
2443
2449
|
}
|
|
2444
|
-
), Et = "DialogTitle",
|
|
2450
|
+
), Et = "DialogTitle", An = B.forwardRef(
|
|
2445
2451
|
(e, t) => {
|
|
2446
2452
|
const { __scopeDialog: n, ...o } = e, r = ce(Et, n);
|
|
2447
2453
|
return /* @__PURE__ */ i(Ve.h2, { id: r.titleId, ...o, ref: t });
|
|
2448
2454
|
}
|
|
2449
2455
|
);
|
|
2450
|
-
|
|
2451
|
-
var
|
|
2456
|
+
An.displayName = Et;
|
|
2457
|
+
var zn = "DialogDescription", hi = B.forwardRef(
|
|
2452
2458
|
(e, t) => {
|
|
2453
|
-
const { __scopeDialog: n, ...o } = e, r = ce(
|
|
2459
|
+
const { __scopeDialog: n, ...o } = e, r = ce(zn, n);
|
|
2454
2460
|
return /* @__PURE__ */ i(Ve.p, { id: r.descriptionId, ...o, ref: t });
|
|
2455
2461
|
}
|
|
2456
2462
|
);
|
|
2457
|
-
hi.displayName =
|
|
2463
|
+
hi.displayName = zn;
|
|
2458
2464
|
var Fn = "DialogClose", kn = B.forwardRef(
|
|
2459
2465
|
(e, t) => {
|
|
2460
2466
|
const { __scopeDialog: n, ...o } = e, r = ce(Fn, n);
|
|
@@ -2493,7 +2499,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
2493
2499
|
const r = (a = e.current) == null ? void 0 : a.getAttribute("aria-describedby");
|
|
2494
2500
|
t && r && (document.getElementById(t) || console.warn(o));
|
|
2495
2501
|
}, [o, e, t]), null;
|
|
2496
|
-
}, vi = In, wi = En, _i = Nn, bi = On, Ci =
|
|
2502
|
+
}, vi = In, wi = En, _i = Nn, bi = On, Ci = An, Ti = kn;
|
|
2497
2503
|
const xe = {
|
|
2498
2504
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2499
2505
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
@@ -2507,28 +2513,28 @@ const xe = {
|
|
|
2507
2513
|
if (!e)
|
|
2508
2514
|
return [];
|
|
2509
2515
|
const {
|
|
2510
|
-
fileSize:
|
|
2511
|
-
filename:
|
|
2516
|
+
fileSize: s,
|
|
2517
|
+
filename: l,
|
|
2512
2518
|
title: u,
|
|
2513
|
-
author:
|
|
2519
|
+
author: h,
|
|
2514
2520
|
subject: m,
|
|
2515
2521
|
createdOn: v,
|
|
2516
|
-
creator:
|
|
2517
|
-
keywords:
|
|
2522
|
+
creator: p,
|
|
2523
|
+
keywords: w,
|
|
2518
2524
|
modifiedOn: T,
|
|
2519
|
-
pdfProducer:
|
|
2525
|
+
pdfProducer: y,
|
|
2520
2526
|
pdfVersion: C,
|
|
2521
|
-
pageCount:
|
|
2527
|
+
pageCount: S
|
|
2522
2528
|
} = e;
|
|
2523
2529
|
return [
|
|
2524
|
-
{ label: r == null ? void 0 : r.propertiesFilenameLabel, value:
|
|
2525
|
-
{ label: r == null ? void 0 : r.propertiesFileSizeLabel, value:
|
|
2530
|
+
{ label: r == null ? void 0 : r.propertiesFilenameLabel, value: l },
|
|
2531
|
+
{ label: r == null ? void 0 : r.propertiesFileSizeLabel, value: s },
|
|
2526
2532
|
{ separate: !0 },
|
|
2527
2533
|
{ label: r == null ? void 0 : r.propertiesTitleLabel, value: u },
|
|
2528
|
-
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value:
|
|
2534
|
+
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value: h },
|
|
2529
2535
|
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value: m },
|
|
2530
|
-
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value:
|
|
2531
|
-
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value:
|
|
2536
|
+
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value: w },
|
|
2537
|
+
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value: p },
|
|
2532
2538
|
{
|
|
2533
2539
|
label: r == null ? void 0 : r.propertiesCreateOnLabel,
|
|
2534
2540
|
value: v ? Wt(v) : ""
|
|
@@ -2538,16 +2544,16 @@ const xe = {
|
|
|
2538
2544
|
value: T ? Wt(T) : ""
|
|
2539
2545
|
},
|
|
2540
2546
|
{ separate: !0 },
|
|
2541
|
-
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value:
|
|
2547
|
+
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value: y },
|
|
2542
2548
|
{ label: r == null ? void 0 : r.propertiesPDFVersionLabel, value: C },
|
|
2543
|
-
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value:
|
|
2549
|
+
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value: S }
|
|
2544
2550
|
];
|
|
2545
2551
|
}, [e, r]);
|
|
2546
2552
|
return /* @__PURE__ */ i(vi, { open: n, onOpenChange: o, children: /* @__PURE__ */ i(wi, { container: t, children: /* @__PURE__ */ F("div", { className: xe["rp-dialog-wrapper"], children: [
|
|
2547
2553
|
/* @__PURE__ */ i(_i, { className: xe["rp-dialog-overlay"] }),
|
|
2548
2554
|
/* @__PURE__ */ F(bi, { className: xe["rp-document-dialog"], children: [
|
|
2549
2555
|
/* @__PURE__ */ i(Ci, { className: xe["rp-dialog-title"], children: r == null ? void 0 : r.documentPropertiesLabel }),
|
|
2550
|
-
/* @__PURE__ */ i("div", { className: xe["rp-document-properties"], children: a.map((
|
|
2556
|
+
/* @__PURE__ */ i("div", { className: xe["rp-document-properties"], children: a.map((s, l) => /* @__PURE__ */ i("div", { children: s.separate ? /* @__PURE__ */ i("div", { className: xe["rp-properties-divider"] }) : /* @__PURE__ */ i(so, { label: s.label, value: s.value }) }, l)) }),
|
|
2551
2557
|
/* @__PURE__ */ i(Ti, { asChild: !0, className: xe["rp-dialog-close"], children: /* @__PURE__ */ i(ao, {}) })
|
|
2552
2558
|
] })
|
|
2553
2559
|
] }) }) });
|
|
@@ -2558,8 +2564,8 @@ const xe = {
|
|
|
2558
2564
|
return yi(n);
|
|
2559
2565
|
}, Hn = () => {
|
|
2560
2566
|
const { filename: e, pdfSrc: t } = J(), { downloadFilename: n } = hr(), o = (a) => {
|
|
2561
|
-
const
|
|
2562
|
-
return
|
|
2567
|
+
const s = n || a;
|
|
2568
|
+
return s.endsWith(nn) ? s : `${s}${nn}`;
|
|
2563
2569
|
};
|
|
2564
2570
|
return { download: N(async () => {
|
|
2565
2571
|
if (!e || !t)
|
|
@@ -2583,9 +2589,9 @@ const xe = {
|
|
|
2583
2589
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Vn, {}) }),
|
|
2584
2590
|
t == null ? void 0 : t.printLabel
|
|
2585
2591
|
] }) }), Bn = () => {
|
|
2586
|
-
const { print: e, cancel: t, setOnProgress: n, setOnComplete: o, setOnError: r, progress: a } = tt(), { printTool:
|
|
2587
|
-
return
|
|
2588
|
-
|
|
2592
|
+
const { print: e, cancel: t, setOnProgress: n, setOnComplete: o, setOnError: r, progress: a } = tt(), { printTool: s = !0 } = ve(), { isSmallScreen: l } = Ce(), { localeMessages: u } = se();
|
|
2593
|
+
return s ? l ? /* @__PURE__ */ i(Ei, { print: e, localeMessages: u }) : typeof s == "function" ? /* @__PURE__ */ i(
|
|
2594
|
+
s,
|
|
2589
2595
|
{
|
|
2590
2596
|
print: e,
|
|
2591
2597
|
cancel: t,
|
|
@@ -2594,7 +2600,7 @@ const xe = {
|
|
|
2594
2600
|
setOnComplete: o,
|
|
2595
2601
|
progress: a
|
|
2596
2602
|
}
|
|
2597
|
-
) :
|
|
2603
|
+
) : s ? /* @__PURE__ */ i(Li, { print: e, localeMessages: u }) : null : null;
|
|
2598
2604
|
}, Ni = {
|
|
2599
2605
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2600
2606
|
}, Oi = () => {
|
|
@@ -2603,46 +2609,46 @@ const xe = {
|
|
|
2603
2609
|
}, Di = () => {
|
|
2604
2610
|
const { goToLastPageIcon: e } = pe();
|
|
2605
2611
|
return e || /* @__PURE__ */ i(gn, {});
|
|
2606
|
-
}, rn = { width: "100%" },
|
|
2607
|
-
const { goToPage: e, totalPages: t, focusedPage: n } = ie(), { jumpNavigationTool: o = !0 } = ve(), { localeMessages: r } = se(), a = W(() => n === 1, [n]),
|
|
2612
|
+
}, rn = { width: "100%" }, Ai = () => {
|
|
2613
|
+
const { goToPage: e, totalPages: t, focusedPage: n } = ie(), { jumpNavigationTool: o = !0 } = ve(), { localeMessages: r } = se(), a = W(() => n === 1, [n]), s = W(() => n === t, [n, t]), l = N(() => {
|
|
2608
2614
|
e(1);
|
|
2609
2615
|
}, [e]), u = N(() => {
|
|
2610
2616
|
e(t);
|
|
2611
2617
|
}, [e, t]);
|
|
2612
2618
|
return o ? /* @__PURE__ */ F(Ke, { children: [
|
|
2613
|
-
/* @__PURE__ */ i(be, { onClick:
|
|
2619
|
+
/* @__PURE__ */ i(be, { onClick: l, children: /* @__PURE__ */ i(K, { content: r == null ? void 0 : r.firstPageTooltip, style: rn, children: /* @__PURE__ */ F("div", { className: "rp-menu-item", "aria-disabled": a, children: [
|
|
2614
2620
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Oi, {}) }),
|
|
2615
2621
|
/* @__PURE__ */ i("span", { children: r == null ? void 0 : r.firstPageLabel })
|
|
2616
2622
|
] }) }) }),
|
|
2617
|
-
/* @__PURE__ */ i(be, { onClick: u, children: /* @__PURE__ */ i(K, { content: r == null ? void 0 : r.lastPageTooltip, style: rn, children: /* @__PURE__ */ F("div", { className: "rp-menu-item", "aria-disabled":
|
|
2623
|
+
/* @__PURE__ */ i(be, { onClick: u, children: /* @__PURE__ */ i(K, { content: r == null ? void 0 : r.lastPageTooltip, style: rn, children: /* @__PURE__ */ F("div", { className: "rp-menu-item", "aria-disabled": s, children: [
|
|
2618
2624
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Di, {}) }),
|
|
2619
2625
|
/* @__PURE__ */ i("span", { children: r == null ? void 0 : r.lastPageLabel })
|
|
2620
2626
|
] }) }) }),
|
|
2621
2627
|
/* @__PURE__ */ i(yt, {})
|
|
2622
2628
|
] }) : null;
|
|
2623
|
-
},
|
|
2629
|
+
}, zi = () => {
|
|
2624
2630
|
const { container: e } = ge(), { isSmallScreen: t } = Ce(), {
|
|
2625
2631
|
openFileTool: n,
|
|
2626
2632
|
downloadTool: o,
|
|
2627
2633
|
documentProperties: r,
|
|
2628
2634
|
scrollModeTool: a,
|
|
2629
|
-
rotateTool:
|
|
2630
|
-
selectionModeTool:
|
|
2635
|
+
rotateTool: s,
|
|
2636
|
+
selectionModeTool: l,
|
|
2631
2637
|
jumpNavigationTool: u,
|
|
2632
|
-
printTool:
|
|
2638
|
+
printTool: h,
|
|
2633
2639
|
fullscreenTool: m
|
|
2634
2640
|
} = ve(), { localeMessages: v } = se();
|
|
2635
2641
|
return W(() => {
|
|
2636
|
-
const
|
|
2642
|
+
const w = u || s || l || a || r;
|
|
2637
2643
|
let T = !1;
|
|
2638
|
-
return t && (T = !(!n && !o && !
|
|
2644
|
+
return t && (T = !(!n && !o && !h && !m)), w || T;
|
|
2639
2645
|
}, [
|
|
2640
2646
|
n,
|
|
2641
2647
|
o,
|
|
2642
2648
|
r,
|
|
2643
2649
|
a,
|
|
2644
|
-
l,
|
|
2645
2650
|
s,
|
|
2651
|
+
l,
|
|
2646
2652
|
u,
|
|
2647
2653
|
t
|
|
2648
2654
|
]) ? /* @__PURE__ */ F(lo, { children: [
|
|
@@ -2659,7 +2665,7 @@ const xe = {
|
|
|
2659
2665
|
/* @__PURE__ */ i(fn, {}),
|
|
2660
2666
|
/* @__PURE__ */ i(yt, {})
|
|
2661
2667
|
] }),
|
|
2662
|
-
/* @__PURE__ */ i(
|
|
2668
|
+
/* @__PURE__ */ i(Ai, {}),
|
|
2663
2669
|
/* @__PURE__ */ i(po, {}),
|
|
2664
2670
|
/* @__PURE__ */ i(vo, {}),
|
|
2665
2671
|
/* @__PURE__ */ i(ho, {}),
|
|
@@ -2680,7 +2686,7 @@ const xe = {
|
|
|
2680
2686
|
/* @__PURE__ */ i(Bn, {}),
|
|
2681
2687
|
/* @__PURE__ */ i(fn, {})
|
|
2682
2688
|
] }),
|
|
2683
|
-
/* @__PURE__ */ i(
|
|
2689
|
+
/* @__PURE__ */ i(zi, {})
|
|
2684
2690
|
] });
|
|
2685
2691
|
}, Ee = {
|
|
2686
2692
|
"rp-zoom-wrapper": "_rp-zoom-wrapper_cocqs_1",
|
|
@@ -2695,22 +2701,22 @@ const xe = {
|
|
|
2695
2701
|
const { zoomOutIcon: e } = pe();
|
|
2696
2702
|
return e || /* @__PURE__ */ i(_o, {});
|
|
2697
2703
|
}, $i = () => {
|
|
2698
|
-
const { zoomLevel: e, setZoomLevel: t } = Qe(), { container: n, contentRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: a } = ie(), { rotate:
|
|
2704
|
+
const { zoomLevel: e, setZoomLevel: t } = Qe(), { container: n, contentRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: a } = ie(), { rotate: s } = Ge(), { pages: l } = J(), { isSmallScreen: u } = Ce(), { localeMessages: h } = se(), { viewMode: m } = Ae(), v = N(() => {
|
|
2699
2705
|
t((d) => {
|
|
2700
2706
|
const f = Math.floor(d / 25) * 25;
|
|
2701
2707
|
return Math.min(f + 25, ft);
|
|
2702
2708
|
});
|
|
2703
|
-
}, [t]),
|
|
2709
|
+
}, [t]), p = N(() => {
|
|
2704
2710
|
t((d) => {
|
|
2705
2711
|
const f = Math.ceil(d / 25) * 25;
|
|
2706
2712
|
return Math.min(f - 25, ft);
|
|
2707
2713
|
});
|
|
2708
|
-
}, [t]),
|
|
2714
|
+
}, [t]), w = W(() => e === ki, [e]), T = W(() => e === ft, [e]), y = W(() => {
|
|
2709
2715
|
var d;
|
|
2710
|
-
return (d =
|
|
2711
|
-
}, [
|
|
2716
|
+
return (d = l.get(a)) == null ? void 0 : d.page.getViewport({ scale: 1, rotation: s });
|
|
2717
|
+
}, [l, a, s]), C = N(
|
|
2712
2718
|
(d) => {
|
|
2713
|
-
const f = ((
|
|
2719
|
+
const f = ((y == null ? void 0 : y.width) || 0) + 2 * Mt, g = ((y == null ? void 0 : y.height) || 0) + 2 * Mt, c = (o == null ? void 0 : o.clientWidth) || 0, b = (o == null ? void 0 : o.clientHeight) || 0, _ = bo(
|
|
2714
2720
|
d,
|
|
2715
2721
|
c,
|
|
2716
2722
|
b,
|
|
@@ -2718,22 +2724,22 @@ const xe = {
|
|
|
2718
2724
|
g,
|
|
2719
2725
|
m
|
|
2720
2726
|
);
|
|
2721
|
-
t(
|
|
2727
|
+
t(_);
|
|
2722
2728
|
},
|
|
2723
|
-
[t,
|
|
2724
|
-
),
|
|
2729
|
+
[t, y]
|
|
2730
|
+
), S = N(
|
|
2725
2731
|
(d) => {
|
|
2726
2732
|
typeof d == "number" ? t(d) : C(d);
|
|
2727
2733
|
},
|
|
2728
2734
|
[t, C]
|
|
2729
2735
|
);
|
|
2730
2736
|
return typeof r != "boolean" ? /* @__PURE__ */ i(r, { zoomLevel: e, setZoomLevel: t }) : r ? /* @__PURE__ */ F("div", { className: Ee["rp-zoom-wrapper"], children: [
|
|
2731
|
-
/* @__PURE__ */ i(K, { content:
|
|
2737
|
+
/* @__PURE__ */ i(K, { content: h == null ? void 0 : h.zoomOutTooltip, children: /* @__PURE__ */ i(
|
|
2732
2738
|
re,
|
|
2733
2739
|
{
|
|
2734
|
-
disabled:
|
|
2735
|
-
onClick:
|
|
2736
|
-
"aria-label":
|
|
2740
|
+
disabled: w,
|
|
2741
|
+
onClick: p,
|
|
2742
|
+
"aria-label": h == null ? void 0 : h.zoomOutTooltip,
|
|
2737
2743
|
children: /* @__PURE__ */ i(Hi, {})
|
|
2738
2744
|
}
|
|
2739
2745
|
) }),
|
|
@@ -2741,11 +2747,11 @@ const xe = {
|
|
|
2741
2747
|
mn,
|
|
2742
2748
|
{
|
|
2743
2749
|
container: n,
|
|
2744
|
-
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content:
|
|
2750
|
+
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content: h == null ? void 0 : h.zoomSelectTooltip, children: /* @__PURE__ */ F(
|
|
2745
2751
|
re,
|
|
2746
2752
|
{
|
|
2747
2753
|
className: Ee["rp-current-zoom-wrapper"],
|
|
2748
|
-
"aria-label":
|
|
2754
|
+
"aria-label": h == null ? void 0 : h.zoomSelectTooltip,
|
|
2749
2755
|
children: [
|
|
2750
2756
|
/* @__PURE__ */ i("span", { className: Ee["rp-current-zoom-text"], children: e }),
|
|
2751
2757
|
/* @__PURE__ */ i("span", { className: Ee["rp-current-zoom-text"], children: "%" }),
|
|
@@ -2757,24 +2763,24 @@ const xe = {
|
|
|
2757
2763
|
align: "center",
|
|
2758
2764
|
children: /* @__PURE__ */ F("div", { className: Ee["rp-zoom-dropdown-content"], children: [
|
|
2759
2765
|
/* @__PURE__ */ F(Ke, { children: [
|
|
2760
|
-
/* @__PURE__ */ i(be, { onClick: () =>
|
|
2761
|
-
/* @__PURE__ */ i(be, { onClick: () =>
|
|
2762
|
-
/* @__PURE__ */ i(be, { onClick: () =>
|
|
2766
|
+
/* @__PURE__ */ i(be, { onClick: () => S(at.ACTUAL), children: h == null ? void 0 : h.zoomActualSize }),
|
|
2767
|
+
/* @__PURE__ */ i(be, { onClick: () => S(at.PAGE_FIT), children: h == null ? void 0 : h.zoomPageFit }),
|
|
2768
|
+
/* @__PURE__ */ i(be, { onClick: () => S(at.PAGE_WIDTH), children: h == null ? void 0 : h.zoomPageWidth })
|
|
2763
2769
|
] }),
|
|
2764
2770
|
/* @__PURE__ */ i(yt, {}),
|
|
2765
|
-
/* @__PURE__ */ i(Ke, { children: Wi.map((d) => /* @__PURE__ */ F(be, { onClick: () =>
|
|
2771
|
+
/* @__PURE__ */ i(Ke, { children: Wi.map((d) => /* @__PURE__ */ F(be, { onClick: () => S(d), children: [
|
|
2766
2772
|
d,
|
|
2767
2773
|
" %"
|
|
2768
2774
|
] }, d)) })
|
|
2769
2775
|
] })
|
|
2770
2776
|
}
|
|
2771
2777
|
),
|
|
2772
|
-
/* @__PURE__ */ i(K, { content:
|
|
2778
|
+
/* @__PURE__ */ i(K, { content: h == null ? void 0 : h.zoomInTooltip, children: /* @__PURE__ */ i(
|
|
2773
2779
|
re,
|
|
2774
2780
|
{
|
|
2775
2781
|
disabled: T,
|
|
2776
2782
|
onClick: v,
|
|
2777
|
-
"aria-label":
|
|
2783
|
+
"aria-label": h == null ? void 0 : h.zoomInTooltip,
|
|
2778
2784
|
children: /* @__PURE__ */ i(Mi, {})
|
|
2779
2785
|
}
|
|
2780
2786
|
) })
|
|
@@ -2807,56 +2813,56 @@ const xe = {
|
|
|
2807
2813
|
return e || /* @__PURE__ */ i(Co, {});
|
|
2808
2814
|
}, Gi = () => {
|
|
2809
2815
|
const { container: e } = ge(), [t, n] = $(!1), { pdf: o } = J(), [r, a] = $(null), {
|
|
2810
|
-
searchOptions:
|
|
2811
|
-
setSearchOptions:
|
|
2816
|
+
searchOptions: s,
|
|
2817
|
+
setSearchOptions: l,
|
|
2812
2818
|
loading: u,
|
|
2813
|
-
setSearch:
|
|
2819
|
+
setSearch: h,
|
|
2814
2820
|
totalMatches: m,
|
|
2815
2821
|
currentMatchPosition: v,
|
|
2816
|
-
nextMatch:
|
|
2817
|
-
prevMatch:
|
|
2822
|
+
nextMatch: p,
|
|
2823
|
+
prevMatch: w,
|
|
2818
2824
|
search: T
|
|
2819
|
-
} = xt(), { searchTool:
|
|
2825
|
+
} = xt(), { searchTool: y = !0 } = ve(), [C, S] = $(T), { localeMessages: d } = se(), { isSmallScreen: f } = Ce(), g = N(() => {
|
|
2820
2826
|
n(!0);
|
|
2821
2827
|
}, []), c = N(() => {
|
|
2822
|
-
|
|
2823
|
-
}, [
|
|
2828
|
+
h(""), S(""), n(!1);
|
|
2829
|
+
}, [h]), b = (I) => {
|
|
2824
2830
|
const O = I.key === "Enter", M = I.key === " ";
|
|
2825
2831
|
(O || M) && c();
|
|
2826
|
-
},
|
|
2832
|
+
}, _ = N(
|
|
2827
2833
|
(I) => {
|
|
2828
2834
|
I.key === "Escape" && t && c();
|
|
2829
2835
|
},
|
|
2830
2836
|
[t]
|
|
2831
2837
|
), P = N(
|
|
2832
2838
|
(I) => {
|
|
2833
|
-
I.shiftKey && I.key === "Enter" ?
|
|
2839
|
+
I.shiftKey && I.key === "Enter" ? w() : I.key === "Enter" && T !== C ? h(C) : I.key === "Enter" && p();
|
|
2834
2840
|
},
|
|
2835
|
-
[C,
|
|
2841
|
+
[C, w, p, h, T]
|
|
2836
2842
|
);
|
|
2837
|
-
k(() => (window.addEventListener("keydown",
|
|
2838
|
-
window.removeEventListener("keydown",
|
|
2839
|
-
}), [
|
|
2843
|
+
k(() => (window.addEventListener("keydown", _), () => {
|
|
2844
|
+
window.removeEventListener("keydown", _);
|
|
2845
|
+
}), [_]), k(() => {
|
|
2840
2846
|
r && r.focus();
|
|
2841
2847
|
}, [r]);
|
|
2842
2848
|
const E = N((I) => {
|
|
2843
|
-
|
|
2849
|
+
S(I.target.value);
|
|
2844
2850
|
}, []), x = N(() => {
|
|
2845
|
-
|
|
2846
|
-
}, [
|
|
2851
|
+
S(""), h("");
|
|
2852
|
+
}, [h]), R = W(() => `${v} / ${m}`, [v, m]), { wholeWords: D, matchCase: A } = W(() => s, [s]), z = N(
|
|
2847
2853
|
(I) => {
|
|
2848
|
-
|
|
2854
|
+
l((O) => ({ ...O, matchCase: I }));
|
|
2849
2855
|
},
|
|
2850
|
-
[
|
|
2856
|
+
[l]
|
|
2851
2857
|
), L = N(
|
|
2852
2858
|
(I) => {
|
|
2853
|
-
|
|
2859
|
+
l((O) => ({ ...O, wholeWords: I }));
|
|
2854
2860
|
},
|
|
2855
|
-
[
|
|
2861
|
+
[l]
|
|
2856
2862
|
);
|
|
2857
2863
|
return k(() => {
|
|
2858
2864
|
c();
|
|
2859
|
-
}, [o, c]),
|
|
2865
|
+
}, [o, c]), y ? /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ i(
|
|
2860
2866
|
Mr,
|
|
2861
2867
|
{
|
|
2862
2868
|
open: t,
|
|
@@ -2883,7 +2889,7 @@ const xe = {
|
|
|
2883
2889
|
] }),
|
|
2884
2890
|
/* @__PURE__ */ F("div", { className: Y["rp-search-tool-input-checkboxes"], children: [
|
|
2885
2891
|
f && /* @__PURE__ */ i(on, {}),
|
|
2886
|
-
/* @__PURE__ */ i($t, { name: "matchCase", value:
|
|
2892
|
+
/* @__PURE__ */ i($t, { name: "matchCase", value: A, onChange: z, children: d == null ? void 0 : d.searchMatchCaseLabel }),
|
|
2887
2893
|
!f && /* @__PURE__ */ i(K, { content: d == null ? void 0 : d.searchMatchCaseTooltip, children: /* @__PURE__ */ i("div", { className: Y["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(Gt, {}) }) }),
|
|
2888
2894
|
/* @__PURE__ */ i($t, { name: "wholeWord", value: D, onChange: L, children: d == null ? void 0 : d.searchWholeWordsLabel }),
|
|
2889
2895
|
!f && /* @__PURE__ */ i(K, { content: d == null ? void 0 : d.searchWholeWordsTooltip, children: /* @__PURE__ */ i("div", { className: Y["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(Gt, {}) }) })
|
|
@@ -2921,9 +2927,9 @@ const xe = {
|
|
|
2921
2927
|
/* @__PURE__ */ i("button", { className: ne(Ne["rp-loading-cancel-button"]), onClick: t, children: n == null ? void 0 : n.printCancelLabel })
|
|
2922
2928
|
] }) });
|
|
2923
2929
|
}, Ui = $e((e, t) => {
|
|
2924
|
-
const { showPrintProgress: n } = ve(), { progress: o } = tt(), { isSmallScreen: r } = Ce(), { percentage: a } = o || {},
|
|
2930
|
+
const { showPrintProgress: n } = ve(), { progress: o } = tt(), { isSmallScreen: r } = Ce(), { percentage: a } = o || {}, s = () => r ? { gridTemplateColumns: "25% 60% 15%" } : void 0;
|
|
2925
2931
|
return /* @__PURE__ */ F("div", { children: [
|
|
2926
|
-
/* @__PURE__ */ i("div", { "data-rp": "topBar", ref: t, className: Fe["rp-toolbar-content"], children: /* @__PURE__ */ F("div", { className: Fe["rp-toolbar-wrapper"], style:
|
|
2932
|
+
/* @__PURE__ */ i("div", { "data-rp": "topBar", ref: t, className: Fe["rp-toolbar-content"], children: /* @__PURE__ */ F("div", { className: Fe["rp-toolbar-wrapper"], style: s(), children: [
|
|
2927
2933
|
/* @__PURE__ */ F("div", { "data-rp": "topBarLeft", className: Fe["rp-toolbar-start"], children: [
|
|
2928
2934
|
/* @__PURE__ */ i(Gi, {}),
|
|
2929
2935
|
/* @__PURE__ */ i(ai, {})
|
|
@@ -2945,7 +2951,7 @@ const xe = {
|
|
|
2945
2951
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
2946
2952
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
2947
2953
|
}, Bi = (e) => {
|
|
2948
|
-
const { thumbnailSrc: t, pageNumber: n, isFocused: o, viewport: r } = e, { goToPage: a } = ie(),
|
|
2954
|
+
const { thumbnailSrc: t, pageNumber: n, isFocused: o, viewport: r } = e, { goToPage: a } = ie(), s = W(() => o ? ke["rp-thumbnail-active"] : "", [o]), l = W(() => ({
|
|
2949
2955
|
width: Math.round(r.width),
|
|
2950
2956
|
height: Math.round(r.height)
|
|
2951
2957
|
}), [r]), u = N(() => {
|
|
@@ -2958,12 +2964,12 @@ const xe = {
|
|
|
2958
2964
|
id: `page-${n}`,
|
|
2959
2965
|
className: ke["rp-thumbnail-wrapper"],
|
|
2960
2966
|
children: [
|
|
2961
|
-
/* @__PURE__ */ i("div", { className: ne(
|
|
2967
|
+
/* @__PURE__ */ i("div", { className: ne(s, ke["rp-thumbnail"]), children: t ? /* @__PURE__ */ i(
|
|
2962
2968
|
"img",
|
|
2963
2969
|
{
|
|
2964
2970
|
src: t,
|
|
2965
|
-
width:
|
|
2966
|
-
height:
|
|
2971
|
+
width: l.width,
|
|
2972
|
+
height: l.height,
|
|
2967
2973
|
alt: "thumbnail"
|
|
2968
2974
|
}
|
|
2969
2975
|
) : /* @__PURE__ */ i(
|
|
@@ -2971,8 +2977,8 @@ const xe = {
|
|
|
2971
2977
|
{
|
|
2972
2978
|
className: ke["rp-thumbnail-loader"],
|
|
2973
2979
|
style: {
|
|
2974
|
-
width: `${
|
|
2975
|
-
height: `${
|
|
2980
|
+
width: `${l.width}px`,
|
|
2981
|
+
height: `${l.height}px`
|
|
2976
2982
|
},
|
|
2977
2983
|
children: /* @__PURE__ */ i(Ct, {})
|
|
2978
2984
|
}
|
|
@@ -2988,24 +2994,24 @@ const xe = {
|
|
|
2988
2994
|
const n = e == null ? void 0 : e.querySelector(`#page-${t}`);
|
|
2989
2995
|
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) - Zi);
|
|
2990
2996
|
}, Ki = $e((e, t) => {
|
|
2991
|
-
const { show: n } = e, { focusedPage: o, totalPages: r } = ie(), { thumbnailPages: a, addPage:
|
|
2992
|
-
cn(t, () =>
|
|
2993
|
-
const v = W(() => Object.values(a), [a]),
|
|
2994
|
-
const
|
|
2995
|
-
|
|
2996
|
-
}, [
|
|
2997
|
+
const { show: n } = e, { focusedPage: o, totalPages: r } = ie(), { thumbnailPages: a, addPage: s, thumbnailLength: l, addToPage: u } = Cn(), h = H(null), m = H(1);
|
|
2998
|
+
cn(t, () => h.current);
|
|
2999
|
+
const v = W(() => Object.values(a), [a]), p = N(() => {
|
|
3000
|
+
const w = l + 1;
|
|
3001
|
+
w <= r && s(w);
|
|
3002
|
+
}, [s, r, l]);
|
|
2997
3003
|
return k(() => {
|
|
2998
|
-
o >
|
|
2999
|
-
}, [o,
|
|
3000
|
-
var
|
|
3004
|
+
o > l ? u(o) : n && m.current !== o && (ji(h.current, o), m.current = o);
|
|
3005
|
+
}, [o, l, u, n, v]), fr(h.current, p), /* @__PURE__ */ i("div", { ref: h, className: sn["rp-thumbnails-container"], children: /* @__PURE__ */ i("div", { className: sn["rp-thumbnails"], children: n ? v.map((w, T) => {
|
|
3006
|
+
var y, C;
|
|
3001
3007
|
return /* @__PURE__ */ i(
|
|
3002
3008
|
Bi,
|
|
3003
3009
|
{
|
|
3004
|
-
isFocused: o === ((
|
|
3005
|
-
pageNumber: (C =
|
|
3006
|
-
thumbnailSrc:
|
|
3007
|
-
loading:
|
|
3008
|
-
viewport:
|
|
3010
|
+
isFocused: o === ((y = w.page) == null ? void 0 : y.pageNumber),
|
|
3011
|
+
pageNumber: (C = w.page) == null ? void 0 : C.pageNumber,
|
|
3012
|
+
thumbnailSrc: w.thumbnailSrc,
|
|
3013
|
+
loading: w.loading,
|
|
3014
|
+
viewport: w.viewport
|
|
3009
3015
|
},
|
|
3010
3016
|
T
|
|
3011
3017
|
);
|
|
@@ -3014,25 +3020,25 @@ const xe = {
|
|
|
3014
3020
|
const { thumbnailIcon: e } = pe();
|
|
3015
3021
|
return e || /* @__PURE__ */ i(mr, {});
|
|
3016
3022
|
}, Yi = () => {
|
|
3017
|
-
const { active: e, setActive: t } = Cn(), [n, o] = $(200), r = H(null), { thumbnailTool: a, sidebarEnable:
|
|
3023
|
+
const { active: e, setActive: t } = Cn(), [n, o] = $(200), r = H(null), { thumbnailTool: a, sidebarEnable: s } = ve(), { localeMessages: l } = se(), u = N(() => {
|
|
3018
3024
|
t((m) => !m);
|
|
3019
|
-
}, []),
|
|
3025
|
+
}, []), h = W(() => typeof a != "boolean" && a ? /* @__PURE__ */ i(a, { onClick: u, active: e }) : a ? /* @__PURE__ */ i(K, { content: l == null ? void 0 : l.thumbnailTooltip, children: /* @__PURE__ */ i(
|
|
3020
3026
|
re,
|
|
3021
3027
|
{
|
|
3022
3028
|
onClick: u,
|
|
3023
3029
|
active: e,
|
|
3024
|
-
"aria-label":
|
|
3030
|
+
"aria-label": l == null ? void 0 : l.thumbnailTooltip,
|
|
3025
3031
|
children: /* @__PURE__ */ i(Xi, {})
|
|
3026
3032
|
}
|
|
3027
|
-
) }) : null, [a, e, u,
|
|
3028
|
-
return /* @__PURE__ */ i(fe, { children:
|
|
3033
|
+
) }) : null, [a, e, u, l]);
|
|
3034
|
+
return /* @__PURE__ */ i(fe, { children: s && /* @__PURE__ */ F(
|
|
3029
3035
|
"div",
|
|
3030
3036
|
{
|
|
3031
3037
|
style: { "--rp-thumbnail-width": `${n}px` },
|
|
3032
3038
|
className: gt["rp-sidebar-content-wrapper"],
|
|
3033
3039
|
"data-rp": "sidebar",
|
|
3034
3040
|
children: [
|
|
3035
|
-
/* @__PURE__ */ i("div", { className: gt["rp-sidebar-content"], children:
|
|
3041
|
+
/* @__PURE__ */ i("div", { className: gt["rp-sidebar-content"], children: h }),
|
|
3036
3042
|
/* @__PURE__ */ F(
|
|
3037
3043
|
"div",
|
|
3038
3044
|
{
|
|
@@ -3049,16 +3055,16 @@ const xe = {
|
|
|
3049
3055
|
}
|
|
3050
3056
|
) });
|
|
3051
3057
|
}, _e = {
|
|
3052
|
-
"rp-layout": "_rp-
|
|
3053
|
-
"rp-content": "_rp-
|
|
3054
|
-
"rp-pages": "_rp-
|
|
3055
|
-
"rp-container": "_rp-
|
|
3056
|
-
"rp-loader": "_rp-
|
|
3057
|
-
"rp-theme-variables": "_rp-theme-
|
|
3058
|
-
"rp-dark-mode": "_rp-dark-
|
|
3058
|
+
"rp-layout": "_rp-layout_1uujy_1",
|
|
3059
|
+
"rp-content": "_rp-content_1uujy_5",
|
|
3060
|
+
"rp-pages": "_rp-pages_1uujy_11",
|
|
3061
|
+
"rp-container": "_rp-container_1uujy_16",
|
|
3062
|
+
"rp-loader": "_rp-loader_1uujy_52",
|
|
3063
|
+
"rp-theme-variables": "_rp-theme-variables_1uujy_56",
|
|
3064
|
+
"rp-dark-mode": "_rp-dark-mode_1uujy_162"
|
|
3059
3065
|
}, Ji = $e(
|
|
3060
3066
|
(e, t) => {
|
|
3061
|
-
const { children: n, toolbarRef: o, style: r, className: a } = e, { customVariables:
|
|
3067
|
+
const { children: n, toolbarRef: o, style: r, className: a } = e, { customVariables: s, customDarkVariables: l } = Pr(), { darkMode: u } = rr();
|
|
3062
3068
|
return /* @__PURE__ */ i(
|
|
3063
3069
|
"div",
|
|
3064
3070
|
{
|
|
@@ -3071,8 +3077,8 @@ const xe = {
|
|
|
3071
3077
|
),
|
|
3072
3078
|
style: {
|
|
3073
3079
|
"--rp-toolbar-height": `${(o == null ? void 0 : o.clientHeight) || 48}px`,
|
|
3074
|
-
...
|
|
3075
|
-
...u ?
|
|
3080
|
+
...s,
|
|
3081
|
+
...u ? l : {},
|
|
3076
3082
|
...r
|
|
3077
3083
|
},
|
|
3078
3084
|
children: n
|
|
@@ -3085,18 +3091,18 @@ const xe = {
|
|
|
3085
3091
|
slots: o,
|
|
3086
3092
|
icons: r,
|
|
3087
3093
|
style: a,
|
|
3088
|
-
className:
|
|
3089
|
-
mobileWidth:
|
|
3094
|
+
className: s,
|
|
3095
|
+
mobileWidth: l,
|
|
3090
3096
|
onLoaded: u,
|
|
3091
|
-
cleanupOnLoaded:
|
|
3097
|
+
cleanupOnLoaded: h,
|
|
3092
3098
|
onLayoutWidthChange: m
|
|
3093
|
-
} = e, [v,
|
|
3099
|
+
} = e, [v, p] = $(null), { setContainer: w, setContentRef: T } = ge(), { loading: y } = J(), { LoaderImageComponent: C } = pn();
|
|
3094
3100
|
return k(() => (u && u(), () => {
|
|
3095
|
-
|
|
3096
|
-
}), [u,
|
|
3101
|
+
h && h();
|
|
3102
|
+
}), [u, h]), /* @__PURE__ */ i(Ji, { toolbarRef: v, ref: t, children: /* @__PURE__ */ i(Tr, { mobileWidth: l, onLayoutWidthChange: m, children: /* @__PURE__ */ i(vr, { slots: o, children: /* @__PURE__ */ i(wr, { icons: r, children: /* @__PURE__ */ F(_r, { getContainerRef: w, style: a, className: s, children: [
|
|
3097
3103
|
/* @__PURE__ */ F(br, { children: [
|
|
3098
3104
|
/* @__PURE__ */ F("div", { className: _e["rp-layout"], children: [
|
|
3099
|
-
/* @__PURE__ */ i(Ui, { ref:
|
|
3105
|
+
/* @__PURE__ */ i(Ui, { ref: p }),
|
|
3100
3106
|
/* @__PURE__ */ F("div", { className: _e["rp-content"], children: [
|
|
3101
3107
|
/* @__PURE__ */ i("div", { className: _e["rp-sidebar"], children: /* @__PURE__ */ i(Yi, {}) }),
|
|
3102
3108
|
/* @__PURE__ */ i("div", { ref: T, className: _e["rp-pages"], children: n })
|
|
@@ -3104,7 +3110,7 @@ const xe = {
|
|
|
3104
3110
|
] }),
|
|
3105
3111
|
/* @__PURE__ */ i(Cr, {})
|
|
3106
3112
|
] }),
|
|
3107
|
-
|
|
3113
|
+
y ? /* @__PURE__ */ i(
|
|
3108
3114
|
"div",
|
|
3109
3115
|
{
|
|
3110
3116
|
className: _e["rp-loader"],
|
|
@@ -3147,8 +3153,8 @@ export {
|
|
|
3147
3153
|
Yi as J,
|
|
3148
3154
|
Ji as K,
|
|
3149
3155
|
Vi as L,
|
|
3150
|
-
|
|
3151
|
-
|
|
3156
|
+
Ai as M,
|
|
3157
|
+
zi as O,
|
|
3152
3158
|
Ms as P,
|
|
3153
3159
|
qs as R,
|
|
3154
3160
|
Gs as S,
|
|
@@ -3170,7 +3176,7 @@ export {
|
|
|
3170
3176
|
xo as n,
|
|
3171
3177
|
Tn as o,
|
|
3172
3178
|
Eo as p,
|
|
3173
|
-
|
|
3179
|
+
zo as q,
|
|
3174
3180
|
It as r,
|
|
3175
3181
|
Yo as s,
|
|
3176
3182
|
ti as t,
|