@pdf-viewer/react 0.0.0-experimental.2 → 0.0.0-experimental.3

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