@pdf-viewer/react 1.5.0-beta.1 → 1.5.0-beta.3

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