@pdf-viewer/react 1.5.0-beta.0 → 1.5.0-beta.2

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