@pdf-viewer/react 1.4.0-beta.9 → 1.4.0-rc.1

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