@pdf-viewer/react 1.11.0-beta.0 → 1.11.0-beta.1

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