@react-pdf-kit/viewer 2.6.0-beta.2 → 2.6.0-rc.0

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 (343) hide show
  1. package/dist/AnnotationLayer-D6BfL976.js +113 -0
  2. package/dist/Button-jStpvb3T.js +21 -0
  3. package/dist/Checkbox-Brta-YKG.js +195 -0
  4. package/dist/Combination-DqNkTtir.js +695 -0
  5. package/dist/Container-DTWaZzc7.js +16 -0
  6. package/dist/CustomThumbnailElement-C2quEICO.js +19 -0
  7. package/dist/DarkPdfIcon-B5ehd9CV.js +9 -0
  8. package/dist/DocumentDialog-DHAWcYIz.js +324 -0
  9. package/dist/DropDown-DikL-krI.js +33 -0
  10. package/dist/Input-Bb_-ljl1.js +31 -0
  11. package/dist/LightPdfIcon-DL8MYtWQ.js +9 -0
  12. package/dist/LoaderIcon-D9YjinGf.js +14 -0
  13. package/dist/LoadingIndicator-MWrbKa6X.js +45 -0
  14. package/dist/MenuItem-BJDWfzAw.js +15 -0
  15. package/dist/MenuSeparator-D1H5l8Ej.js +6 -0
  16. package/dist/MostPageTool.module-BRVv-sGz.js +4 -0
  17. package/dist/OtherTool.module-BQY9Nfqz.js +4 -0
  18. package/dist/Paginate.module-B0GMw-MB.js +8 -0
  19. package/dist/PaginationContext--n91mIJ4.js +232 -0
  20. package/dist/PasswordModal-BDHdSpxf.js +76 -0
  21. package/dist/PropertyItem-evJWWmWZ.js +18 -0
  22. package/dist/RPDropFileZone-BunRfzst.js +35 -0
  23. package/dist/RPLayout.module-Vc3h4xxS.js +14 -0
  24. package/dist/RPPage-BuSGUFzw.js +91 -0
  25. package/dist/RPPages-V5CNUXFD.js +1007 -0
  26. package/dist/RPSplitter-C63X9M8w.js +121 -0
  27. package/dist/RPToolbar.module-BwqWLviy.js +10 -0
  28. package/dist/RPTooltip-ZZoFqP7C.js +381 -0
  29. package/dist/RotateTool.module-DH5yWbvM.js +4 -0
  30. package/dist/SearchTool.module-DUkVXfOn.js +16 -0
  31. package/dist/SkipLink-Bvbn3miT.js +18 -0
  32. package/dist/TextHighlightLayer-BSVgBxR3.js +157 -0
  33. package/dist/TextLayer-DWGFN9SF.js +125 -0
  34. package/dist/Thumbnail-Dwo2-4Ki.js +97 -0
  35. package/dist/Thumbnails-ComClyJJ.js +52 -0
  36. package/dist/ToolbarLayout.module-Zo715dbb.js +12 -0
  37. package/dist/WrapperLayout-Dcd9l9xH.js +13 -0
  38. package/dist/ZoomTool.module-BrIPy8pO.js +11 -0
  39. package/dist/assets/AnnotationLayer.css +1 -0
  40. package/dist/assets/Button.css +1 -0
  41. package/dist/assets/Checkbox.css +1 -0
  42. package/dist/assets/Container.css +1 -0
  43. package/dist/assets/CustomThumbnailElement.css +1 -0
  44. package/dist/assets/DocumentDialog.css +1 -0
  45. package/dist/assets/DropDown.css +1 -0
  46. package/dist/assets/Input.css +1 -0
  47. package/dist/assets/LoaderIcon.css +1 -0
  48. package/dist/assets/LoadingIndicator.css +1 -0
  49. package/dist/assets/MenuItem.css +1 -0
  50. package/dist/assets/MenuSeparator.css +1 -0
  51. package/dist/assets/MostPageTool.css +1 -0
  52. package/dist/assets/OtherTool.css +1 -0
  53. package/dist/assets/Paginate.css +1 -0
  54. package/dist/assets/PasswordModal.css +1 -0
  55. package/dist/assets/PropertyItem.css +1 -0
  56. package/dist/assets/RPDropFileZone.css +1 -0
  57. package/dist/assets/RPLayout.css +1 -0
  58. package/dist/assets/RPPage.css +1 -0
  59. package/dist/assets/RPPages.css +1 -0
  60. package/dist/assets/RPSplitter.css +1 -0
  61. package/dist/assets/RPToolbar.css +1 -0
  62. package/dist/assets/RPTooltip.css +1 -0
  63. package/dist/assets/RotateTool.css +1 -0
  64. package/dist/assets/SearchTool.css +1 -0
  65. package/dist/assets/SkipLink.css +1 -0
  66. package/dist/assets/TextHighlightLayer.css +1 -0
  67. package/dist/assets/TextLayer.css +1 -0
  68. package/dist/assets/Thumbnail.css +1 -0
  69. package/dist/assets/Thumbnails.css +1 -0
  70. package/dist/assets/ToolbarLayout.css +1 -0
  71. package/dist/assets/WrapperLayout.css +1 -0
  72. package/dist/assets/ZoomTool.css +1 -0
  73. package/dist/assets/style.js +2 -77
  74. package/dist/chunk-C_CI6nMA.js +13 -0
  75. package/dist/clsx-B7LyVm5O.js +16 -0
  76. package/dist/components/RPConfig.js +24 -26
  77. package/dist/components/RPController.js +85 -135
  78. package/dist/components/RPDropFileZone.js +3 -61
  79. package/dist/components/RPPages.js +3 -1115
  80. package/dist/components/RPProvider.js +50 -131
  81. package/dist/components/RPTheme.js +20 -21
  82. package/dist/components/icons/CheckIcon.js +16 -22
  83. package/dist/components/icons/ChevronDownIcon.js +17 -23
  84. package/dist/components/icons/ChevronUpIcon.js +16 -22
  85. package/dist/components/icons/ClearIcon.js +26 -25
  86. package/dist/components/icons/ClockwiseIcon.js +16 -22
  87. package/dist/components/icons/CloseIcon.js +16 -22
  88. package/dist/components/icons/DarkPdfIcon.js +2 -15
  89. package/dist/components/icons/DualPageIcon.js +16 -22
  90. package/dist/components/icons/DualPageWithCoverIcon.js +16 -22
  91. package/dist/components/icons/FileDownloadDefaultIcon.js +20 -23
  92. package/dist/components/icons/FileUploadDefaultIcon.js +20 -23
  93. package/dist/components/icons/FullScreenIcon.js +16 -22
  94. package/dist/components/icons/GoToDownIcon.js +16 -22
  95. package/dist/components/icons/HandModeDefaultIcon.js +16 -22
  96. package/dist/components/icons/HorizontalScrollingIcon.js +18 -24
  97. package/dist/components/icons/InfoIcon.js +16 -22
  98. package/dist/components/icons/LightPdfIcon.js +2 -15
  99. package/dist/components/icons/LoaderIcon.js +2 -17
  100. package/dist/components/icons/MoonIcon.js +16 -22
  101. package/dist/components/icons/PageScrollingIcon.js +18 -24
  102. package/dist/components/icons/PrintDefaultIcon.js +20 -23
  103. package/dist/components/icons/SearchIcon.js +16 -22
  104. package/dist/components/icons/SinglePageIcon.js +15 -21
  105. package/dist/components/icons/SunIcon.js +26 -25
  106. package/dist/components/icons/TextSelectionDefaultIcon.js +20 -23
  107. package/dist/components/icons/ThreeDotIcon.js +16 -22
  108. package/dist/components/icons/Thumbnail.js +39 -54
  109. package/dist/components/icons/VerticalScrollingIcon.js +18 -24
  110. package/dist/components/icons/WrappedScrollingIcon.js +18 -24
  111. package/dist/components/icons/ZoomInIcon.js +16 -22
  112. package/dist/components/icons/ZoomOutIcon.js +16 -22
  113. package/dist/components/layout/Container.js +2 -21
  114. package/dist/components/layout/LayoutContainer.js +23 -34
  115. package/dist/components/layout/LayoutWrapper.js +14 -10
  116. package/dist/components/layout/RPDefaultLayout.js +99 -244
  117. package/dist/components/layout/RPLayout.js +70 -220
  118. package/dist/components/layout/SkipLink.js +3 -29
  119. package/dist/components/layout/WrapperLayout.js +2 -27
  120. package/dist/components/layout/sidebar/CustomThumbnailElement.js +2 -68
  121. package/dist/components/layout/sidebar/RPSidebar.js +61 -112
  122. package/dist/components/layout/sidebar/RPSplitter.js +2 -9
  123. package/dist/components/layout/sidebar/Thumbnail.js +3 -155
  124. package/dist/components/layout/sidebar/Thumbnails.js +2 -82
  125. package/dist/components/layout/toolbar/DarkModeTool.js +44 -36
  126. package/dist/components/layout/toolbar/DocumentDialog.js +2 -322
  127. package/dist/components/layout/toolbar/DocumentProperties.js +30 -39
  128. package/dist/components/layout/toolbar/FileDownloadTool.js +54 -50
  129. package/dist/components/layout/toolbar/FileUploadTool.js +54 -49
  130. package/dist/components/layout/toolbar/FullScreenTool.js +62 -72
  131. package/dist/components/layout/toolbar/MenuItem.js +2 -19
  132. package/dist/components/layout/toolbar/MenuSeparator.js +2 -15
  133. package/dist/components/layout/toolbar/MostPageTool.js +62 -81
  134. package/dist/components/layout/toolbar/OtherTool.js +97 -198
  135. package/dist/components/layout/toolbar/Paginate.js +111 -145
  136. package/dist/components/layout/toolbar/PrintTool.js +70 -72
  137. package/dist/components/layout/toolbar/PropertyItem.js +2 -12
  138. package/dist/components/layout/toolbar/RPMenuItem.js +22 -31
  139. package/dist/components/layout/toolbar/RPMoreOptions.js +140 -220
  140. package/dist/components/layout/toolbar/RPToolbar.js +45 -151
  141. package/dist/components/layout/toolbar/RPToolbarEnd.js +23 -121
  142. package/dist/components/layout/toolbar/RotateTool.js +49 -60
  143. package/dist/components/layout/toolbar/ScrollModeTool.js +79 -67
  144. package/dist/components/layout/toolbar/SearchCloseButton.js +23 -31
  145. package/dist/components/layout/toolbar/SearchResultNavigator.js +39 -100
  146. package/dist/components/layout/toolbar/SearchTool.js +226 -267
  147. package/dist/components/layout/toolbar/SelectionModeTool.js +59 -51
  148. package/dist/components/layout/toolbar/ThumbnailTool.js +30 -39
  149. package/dist/components/layout/toolbar/ToolbarCustom.js +56 -113
  150. package/dist/components/layout/toolbar/ToolbarDefault.js +58 -196
  151. package/dist/components/layout/toolbar/ToolbarLayout.js +12 -158
  152. package/dist/components/layout/toolbar/ViewModeTool.js +82 -62
  153. package/dist/components/layout/toolbar/ZoomTool.js +139 -150
  154. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +24 -54
  155. package/dist/components/layout/toolbar/tools/DualPageTool.js +23 -25
  156. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +2 -206
  157. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +23 -35
  158. package/dist/components/layout/toolbar/tools/FileUploadTool.js +23 -34
  159. package/dist/components/layout/toolbar/tools/FirstPageTool.js +2 -201
  160. package/dist/components/layout/toolbar/tools/FullScreenTool.js +25 -33
  161. package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +24 -36
  162. package/dist/components/layout/toolbar/tools/InputPageTool.js +51 -92
  163. package/dist/components/layout/toolbar/tools/LastPageTool.js +2 -201
  164. package/dist/components/layout/toolbar/tools/NextPageTool.js +32 -61
  165. package/dist/components/layout/toolbar/tools/PageScrollingTool.js +24 -36
  166. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +21 -62
  167. package/dist/components/layout/toolbar/tools/PrintTool.js +23 -35
  168. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +23 -47
  169. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +26 -47
  170. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +29 -38
  171. package/dist/components/layout/toolbar/tools/SinglePageTool.js +22 -24
  172. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +24 -35
  173. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +24 -46
  174. package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +24 -36
  175. package/dist/components/layout/toolbar/tools/ZoomInTool.js +29 -58
  176. package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +26 -26
  177. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +94 -133
  178. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +29 -58
  179. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +60 -148
  180. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +31 -42
  181. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +23 -28
  182. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +25 -52
  183. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +25 -51
  184. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +26 -42
  185. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +57 -87
  186. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +25 -52
  187. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +44 -64
  188. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +80 -71
  189. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +59 -57
  190. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +79 -66
  191. package/dist/components/page/AnnotationLayer.js +2 -146
  192. package/dist/components/page/CanvasLayer.js +47 -71
  193. package/dist/components/page/CustomElement.js +18 -53
  194. package/dist/components/page/DualPage.js +43 -98
  195. package/dist/components/page/DualPageWithCover.js +66 -130
  196. package/dist/components/page/RPPage.js +2 -143
  197. package/dist/components/page/SinglePage.js +27 -88
  198. package/dist/components/page/TextHighlightLayer.js +2 -198
  199. package/dist/components/page/TextLayer.js +2 -202
  200. package/dist/components/page/searchHighlight.js +32 -37
  201. package/dist/components/ui/Button.js +2 -25
  202. package/dist/components/ui/Checkbox.js +2 -273
  203. package/dist/components/ui/DropDown.js +2 -36
  204. package/dist/components/ui/Input.js +2 -28
  205. package/dist/components/ui/LoadingIndicator.js +2 -59
  206. package/dist/components/ui/PasswordModal.js +2 -75
  207. package/dist/components/ui/RPTooltip.js +2 -357
  208. package/dist/contexts/ConfigContext.js +13 -12
  209. package/dist/contexts/DarkModeContext.js +26 -27
  210. package/dist/contexts/DimensionPagesContext.js +49 -60
  211. package/dist/contexts/DocumentPasswordContext.js +37 -35
  212. package/dist/contexts/DownloadContext.js +13 -21
  213. package/dist/contexts/DropFileZoneContext.js +35 -62
  214. package/dist/contexts/ElementPageContext.js +114 -139
  215. package/dist/contexts/ElementThumbnailContext.js +132 -195
  216. package/dist/contexts/EventCallbackContext.js +19 -34
  217. package/dist/contexts/FileInputContext.js +30 -49
  218. package/dist/contexts/FullScreenContext.js +31 -24
  219. package/dist/contexts/GlobalCurrentPage.js +21 -18
  220. package/dist/contexts/HighlightContext.js +22 -31
  221. package/dist/contexts/IconContext.js +9 -11
  222. package/dist/contexts/IconToolContext.js +14 -11
  223. package/dist/contexts/InitialStateContext.js +9 -11
  224. package/dist/contexts/LayerContext.js +9 -8
  225. package/dist/contexts/LayoutContainerContext.js +12 -16
  226. package/dist/contexts/LayoutDropFileZoneContext.js +8 -11
  227. package/dist/contexts/LicenseContext.js +12 -17
  228. package/dist/contexts/LoaderContext.js +14 -27
  229. package/dist/contexts/LocalizationContext.js +22 -33
  230. package/dist/contexts/OtherToolContext.js +17 -17
  231. package/dist/contexts/PageViewportContext.js +9 -8
  232. package/dist/contexts/PagesRotateContext.js +42 -43
  233. package/dist/contexts/PaginationContext.js +2 -40
  234. package/dist/contexts/PrintContext.js +67 -78
  235. package/dist/contexts/RPDocumentContext.js +60 -73
  236. package/dist/contexts/RenderQueueProvider.js +43 -72
  237. package/dist/contexts/RenderedPagesCache.js +17 -13
  238. package/dist/contexts/RotationContext.js +27 -38
  239. package/dist/contexts/ScrollModeContext.js +22 -20
  240. package/dist/contexts/SearchContext.js +39 -97
  241. package/dist/contexts/SelectionModeContext.js +22 -23
  242. package/dist/contexts/SmoothScrollContext.js +18 -16
  243. package/dist/contexts/ThemeContext.js +5 -7
  244. package/dist/contexts/ThumbnailsContext.js +26 -43
  245. package/dist/contexts/ToolComponentContext.js +54 -51
  246. package/dist/contexts/ToolbarComponentContext.js +48 -47
  247. package/dist/contexts/ViewModeContext.js +34 -31
  248. package/dist/contexts/ViewportContext.js +91 -85
  249. package/dist/contexts/VirtualGridContext.js +17 -14
  250. package/dist/contexts/VirtualScrollContext.js +42 -52
  251. package/dist/contexts/ZoomContext.js +95 -107
  252. package/dist/de_DE--0LF-SJR.js +483 -0
  253. package/dist/dist-7FA4Do6I.js +1286 -0
  254. package/dist/dist-BRVqFn7R.js +144 -0
  255. package/dist/dist-C3WNMuW2.js +29 -0
  256. package/dist/dist-CKteKPPA.js +947 -0
  257. package/dist/dist-bK-AHWLF.js +314 -0
  258. package/dist/lib-BiapEtK1.js +10261 -0
  259. package/dist/libInjectCss.js +7 -8
  260. package/dist/main-CHO5p1qM.js +60 -0
  261. package/dist/main.js +53 -296
  262. package/dist/style-9n_QpMZt.js +5 -0
  263. package/dist/useWatermark-CvAAf66v.js +67 -0
  264. package/dist/utils/Queue.js +40 -46
  265. package/dist/utils/annotations.js +227 -261
  266. package/dist/utils/appConsole.js +24 -42
  267. package/dist/utils/approximateFragtion.js +16 -21
  268. package/dist/utils/calculatePage.js +29 -20
  269. package/dist/utils/charators.js +39 -48
  270. package/dist/utils/const.js +8 -11
  271. package/dist/utils/constants.js +4 -8
  272. package/dist/utils/convertPdfDate.js +20 -24
  273. package/dist/utils/dateFormatter.js +7 -7
  274. package/dist/utils/elementPagePosition.js +10 -10
  275. package/dist/utils/formatFileSize.js +17 -8
  276. package/dist/utils/getElementPositionInPage.js +44 -82
  277. package/dist/utils/getScrollDistance.js +4 -4
  278. package/dist/utils/getThumbnailViewport.js +12 -6
  279. package/dist/utils/getWordPositionInPage.js +24 -24
  280. package/dist/utils/getZoomLevel.js +16 -23
  281. package/dist/utils/highlight.js +195 -212
  282. package/dist/utils/hooks/useCopyText.js +23 -33
  283. package/dist/utils/hooks/useDarkMode.js +10 -10
  284. package/dist/utils/hooks/useDarkModeProps.js +9 -10
  285. package/dist/utils/hooks/useDebounce.js +22 -18
  286. package/dist/utils/hooks/useDropFileZone.js +13 -11
  287. package/dist/utils/hooks/useElementSize.js +24 -20
  288. package/dist/utils/hooks/useFileDownload.js +16 -33
  289. package/dist/utils/hooks/useFlickerSelectText.js +19 -24
  290. package/dist/utils/hooks/useFullScreen.js +31 -28
  291. package/dist/utils/hooks/useGrabScroll.js +52 -51
  292. package/dist/utils/hooks/useHighlight.js +92 -92
  293. package/dist/utils/hooks/useInfiniteScroll.js +17 -18
  294. package/dist/utils/hooks/useLicense.js +113 -135
  295. package/dist/utils/hooks/useLoadPdf.js +107 -100
  296. package/dist/utils/hooks/useLoadWorker.js +13 -15
  297. package/dist/utils/hooks/useLocalization.js +25 -25
  298. package/dist/utils/hooks/useMousePressed.js +25 -19
  299. package/dist/utils/hooks/usePageRotateContext.js +25 -41
  300. package/dist/utils/hooks/usePaginate.js +2 -38
  301. package/dist/utils/hooks/usePdfProperties.js +38 -36
  302. package/dist/utils/hooks/usePinch.js +65 -100
  303. package/dist/utils/hooks/usePresentPage.js +69 -92
  304. package/dist/utils/hooks/usePrint.js +167 -178
  305. package/dist/utils/hooks/useRequestAnimationFrame.js +16 -16
  306. package/dist/utils/hooks/useResizeObserver.js +18 -21
  307. package/dist/utils/hooks/useRotate.js +15 -27
  308. package/dist/utils/hooks/useScrollToPage.js +2 -38
  309. package/dist/utils/hooks/useSearch.js +125 -163
  310. package/dist/utils/hooks/useTextSelection.js +69 -75
  311. package/dist/utils/hooks/useThumbnail.js +42 -59
  312. package/dist/utils/hooks/useVirtualReactWindow.js +85 -96
  313. package/dist/utils/hooks/useWatermark.js +2 -78
  314. package/dist/utils/injectPrintCSS.js +6 -21
  315. package/dist/utils/link_service.js +59 -137
  316. package/dist/utils/renderPage.js +20 -19
  317. package/dist/utils/sanitizeExternalUrl.js +12 -15
  318. package/dist/utils/smoothScrollTo.js +8 -5
  319. package/dist/utils/types.js +29 -21
  320. package/dist/utils/withRef.js +7 -7
  321. package/dist/utils/zoom.js +5 -6
  322. package/package.json +7 -7
  323. package/dist/Combination-17ab8af1.js +0 -698
  324. package/dist/MostPageTool.module-13578ad6.js +0 -6
  325. package/dist/OtherTool.module-a4be5f1f.js +0 -6
  326. package/dist/Paginate.module-4eef00aa.js +0 -8
  327. package/dist/PaginationContext-87f832f2.js +0 -233
  328. package/dist/RPLayout.module-92fa19f7.js +0 -14
  329. package/dist/RPSplitter-b62772f9.js +0 -122
  330. package/dist/RPToolbar.module-27d7fe77.js +0 -10
  331. package/dist/RotateTool.module-67946714.js +0 -6
  332. package/dist/SearchTool.module-99f60dc7.js +0 -16
  333. package/dist/ToolbarLayout.module-6e339802.js +0 -12
  334. package/dist/ZoomTool.module-7082af8c.js +0 -12
  335. package/dist/assets/style.css +0 -1
  336. package/dist/clsx-0c6e471a.js +0 -22
  337. package/dist/de_DE-8145915f.js +0 -489
  338. package/dist/index-113053cf.js +0 -309
  339. package/dist/index-11f3cd64.js +0 -983
  340. package/dist/index-23911b43.js +0 -150
  341. package/dist/index-ada501c4.js +0 -27
  342. package/dist/index-d0f0aa9a.js +0 -1542
  343. package/dist/index-e04c91b1.js +0 -11671
@@ -0,0 +1,1007 @@
1
+ import { ErrorType as e, ScrollMode as t, SelectionMode as n, ViewMode as r } from "./utils/types.js";
2
+ import { useDocumentPasswordContext as i } from "./contexts/DocumentPasswordContext.js";
3
+ import { useDocumentContext as a } from "./contexts/RPDocumentContext.js";
4
+ import { useInitialStateContext as o } from "./contexts/InitialStateContext.js";
5
+ import { useScrollModeContext as s } from "./contexts/ScrollModeContext.js";
6
+ import { useViewModeContext as c } from "./contexts/ViewModeContext.js";
7
+ import { useVirtualScrollContext as l } from "./contexts/VirtualScrollContext.js";
8
+ import { useLayoutContainer as u } from "./contexts/LayoutContainerContext.js";
9
+ import { useEventCallbackContext as d } from "./contexts/EventCallbackContext.js";
10
+ import { useDebounce as f } from "./utils/hooks/useDebounce.js";
11
+ import { getPageFromPosition as p } from "./utils/calculatePage.js";
12
+ import { a as m, r as h } from "./PaginationContext--n91mIJ4.js";
13
+ import { useSelectionModeContext as g } from "./contexts/SelectionModeContext.js";
14
+ import { useFullScreenContext as _ } from "./contexts/FullScreenContext.js";
15
+ import { t as v } from "./clsx-B7LyVm5O.js";
16
+ import { useLoaderContext as ee } from "./contexts/LoaderContext.js";
17
+ import { t as y } from "./RPPage-BuSGUFzw.js";
18
+ import { useVirtualReactWindow as te } from "./utils/hooks/useVirtualReactWindow.js";
19
+ import { DualPage as ne } from "./components/page/DualPage.js";
20
+ import { DualPageWithCover as re } from "./components/page/DualPageWithCover.js";
21
+ import { SinglePage as ie } from "./components/page/SinglePage.js";
22
+ import { useMousePressed as ae } from "./utils/hooks/useMousePressed.js";
23
+ import { useGrabScroll as oe } from "./utils/hooks/useGrabScroll.js";
24
+ import { usePinch as se } from "./utils/hooks/usePinch.js";
25
+ import { t as b } from "./PasswordModal-BDHdSpxf.js";
26
+ import { usePresentPage as x } from "./utils/hooks/usePresentPage.js";
27
+ import { LayoutContainer as ce } from "./components/layout/LayoutContainer.js";
28
+ import { LayoutWrapper as le } from "./components/layout/LayoutWrapper.js";
29
+ import { useCopyText as ue } from "./utils/hooks/useCopyText.js";
30
+ import { useTextSelection as de } from "./utils/hooks/useTextSelection.js";
31
+ import { approximateFraction as fe } from "./utils/approximateFragtion.js";
32
+ import { Component as pe, PureComponent as S, createElement as C, memo as me, useCallback as w, useEffect as T, useMemo as he, useRef as E, useState as ge } from "react";
33
+ import { OutputScale as _e } from "pdfjs-dist";
34
+ import { Fragment as ve, jsx as D, jsxs as ye } from "react/jsx-runtime";
35
+ import './assets/RPPages.css';//#region lib/components/RPPages.module.css
36
+ var O = {
37
+ "rp-pages": "_rp-pages_fn8tz_1",
38
+ "rp-page-scrolling-wrapper": "_rp-page-scrolling-wrapper_fn8tz_6",
39
+ "rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_fn8tz_11",
40
+ "rp-not-supported-list": "_rp-not-supported-list_fn8tz_15",
41
+ "rp-pages-container": "_rp-pages-container_fn8tz_23",
42
+ "rp-viewer": "_rp-viewer_fn8tz_65",
43
+ "rp-cursor-grab": "_rp-cursor-grab_fn8tz_70",
44
+ "rp-cursor-grabbing": "_rp-cursor-grabbing_fn8tz_78",
45
+ "rp-loader": "_rp-loader_fn8tz_86",
46
+ "rp-not-supported": "_rp-not-supported_fn8tz_15",
47
+ "rp-not-supported-content": "_rp-not-supported-content_fn8tz_102",
48
+ "rp-load-error": "_rp-load-error_fn8tz_108",
49
+ "rp-load-error-message": "_rp-load-error-message_fn8tz_116"
50
+ };
51
+ //#endregion
52
+ //#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/extends.js
53
+ function k() {
54
+ return k = Object.assign ? Object.assign.bind() : function(e) {
55
+ for (var t = 1; t < arguments.length; t++) {
56
+ var n = arguments[t];
57
+ for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
58
+ }
59
+ return e;
60
+ }, k.apply(null, arguments);
61
+ }
62
+ //#endregion
63
+ //#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
64
+ function A(e) {
65
+ if (e === void 0) throw ReferenceError("this hasn't been initialised - super() hasn't been called");
66
+ return e;
67
+ }
68
+ //#endregion
69
+ //#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
70
+ function be(e, t) {
71
+ return be = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
72
+ return e.__proto__ = t, e;
73
+ }, be(e, t);
74
+ }
75
+ //#endregion
76
+ //#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
77
+ function xe(e, t) {
78
+ e.prototype = Object.create(t.prototype), e.prototype.constructor = e, be(e, t);
79
+ }
80
+ //#endregion
81
+ //#region node_modules/.pnpm/memoize-one@5.2.1/node_modules/memoize-one/dist/memoize-one.esm.js
82
+ var Se = Number.isNaN || function(e) {
83
+ return typeof e == "number" && e !== e;
84
+ };
85
+ function Ce(e, t) {
86
+ return !!(e === t || Se(e) && Se(t));
87
+ }
88
+ function j(e, t) {
89
+ if (e.length !== t.length) return !1;
90
+ for (var n = 0; n < e.length; n++) if (!Ce(e[n], t[n])) return !1;
91
+ return !0;
92
+ }
93
+ function M(e, t) {
94
+ t === void 0 && (t = j);
95
+ var n, r = [], i, a = !1;
96
+ function o() {
97
+ var o = [...arguments];
98
+ return a && n === this && t(o, r) ? i : (i = e.apply(this, o), a = !0, n = this, r = o, i);
99
+ }
100
+ return o;
101
+ }
102
+ //#endregion
103
+ //#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
104
+ function N(e, t) {
105
+ if (e == null) return {};
106
+ var n = {};
107
+ for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
108
+ if (t.indexOf(r) !== -1) continue;
109
+ n[r] = e[r];
110
+ }
111
+ return n;
112
+ }
113
+ //#endregion
114
+ //#region node_modules/.pnpm/react-window@1.8.11_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-window/dist/index.esm.js
115
+ var P = typeof performance == "object" && typeof performance.now == "function" ? function() {
116
+ return performance.now();
117
+ } : function() {
118
+ return Date.now();
119
+ };
120
+ function we(e) {
121
+ cancelAnimationFrame(e.id);
122
+ }
123
+ function Te(e, t) {
124
+ var n = P();
125
+ function r() {
126
+ P() - n >= t ? e.call(null) : i.id = requestAnimationFrame(r);
127
+ }
128
+ var i = { id: requestAnimationFrame(r) };
129
+ return i;
130
+ }
131
+ var F = -1;
132
+ function Ee(e) {
133
+ if (e === void 0 && (e = !1), F === -1 || e) {
134
+ var t = document.createElement("div"), n = t.style;
135
+ n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), F = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
136
+ }
137
+ return F;
138
+ }
139
+ var I = null;
140
+ function De(e) {
141
+ if (e === void 0 && (e = !1), I === null || e) {
142
+ var t = document.createElement("div"), n = t.style;
143
+ n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
144
+ var r = document.createElement("div"), i = r.style;
145
+ return i.width = "100px", i.height = "100px", t.appendChild(r), document.body.appendChild(t), t.scrollLeft > 0 ? I = "positive-descending" : (t.scrollLeft = 1, I = t.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(t), I;
146
+ }
147
+ return I;
148
+ }
149
+ var Oe = 150, L = function(e) {
150
+ var t = e.columnIndex;
151
+ return e.data, e.rowIndex + ":" + t;
152
+ }, R = null, z = null, B = null;
153
+ process.env.NODE_ENV !== "production" && typeof window < "u" && window.WeakSet !== void 0 && (R = /* @__PURE__ */ new WeakSet(), z = /* @__PURE__ */ new WeakSet(), B = /* @__PURE__ */ new WeakSet());
154
+ function ke(e) {
155
+ var t, n = e.getColumnOffset, r = e.getColumnStartIndexForOffset, i = e.getColumnStopIndexForStartIndex, a = e.getColumnWidth, o = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, c = e.getOffsetForColumnAndAlignment, l = e.getOffsetForRowAndAlignment, u = e.getRowHeight, d = e.getRowOffset, f = e.getRowStartIndexForOffset, p = e.getRowStopIndexForStartIndex, m = e.initInstanceProps, h = e.shouldResetStyleCacheOnItemSizeChange, g = e.validateProps;
156
+ return t = /* @__PURE__ */ function(e) {
157
+ xe(t, e);
158
+ function t(t) {
159
+ var r = e.call(this, t) || this;
160
+ return r._instanceProps = m(r.props, A(r)), r._resetIsScrollingTimeoutId = null, r._outerRef = void 0, r.state = {
161
+ instance: A(r),
162
+ isScrolling: !1,
163
+ horizontalScrollDirection: "forward",
164
+ scrollLeft: typeof r.props.initialScrollLeft == "number" ? r.props.initialScrollLeft : 0,
165
+ scrollTop: typeof r.props.initialScrollTop == "number" ? r.props.initialScrollTop : 0,
166
+ scrollUpdateWasRequested: !1,
167
+ verticalScrollDirection: "forward"
168
+ }, r._callOnItemsRendered = void 0, r._callOnItemsRendered = M(function(e, t, n, i, a, o, s, c) {
169
+ return r.props.onItemsRendered({
170
+ overscanColumnStartIndex: e,
171
+ overscanColumnStopIndex: t,
172
+ overscanRowStartIndex: n,
173
+ overscanRowStopIndex: i,
174
+ visibleColumnStartIndex: a,
175
+ visibleColumnStopIndex: o,
176
+ visibleRowStartIndex: s,
177
+ visibleRowStopIndex: c
178
+ });
179
+ }), r._callOnScroll = void 0, r._callOnScroll = M(function(e, t, n, i, a) {
180
+ return r.props.onScroll({
181
+ horizontalScrollDirection: n,
182
+ scrollLeft: e,
183
+ scrollTop: t,
184
+ verticalScrollDirection: i,
185
+ scrollUpdateWasRequested: a
186
+ });
187
+ }), r._getItemStyle = void 0, r._getItemStyle = function(e, t) {
188
+ var i = r.props, o = i.columnWidth, s = i.direction, c = i.rowHeight, l = r._getItemStyleCache(h && o, h && s, h && c), f = e + ":" + t, p;
189
+ if (l.hasOwnProperty(f)) p = l[f];
190
+ else {
191
+ var m = n(r.props, t, r._instanceProps), g = s === "rtl";
192
+ l[f] = p = {
193
+ position: "absolute",
194
+ left: g ? void 0 : m,
195
+ right: g ? m : void 0,
196
+ top: d(r.props, e, r._instanceProps),
197
+ height: u(r.props, e, r._instanceProps),
198
+ width: a(r.props, t, r._instanceProps)
199
+ };
200
+ }
201
+ return p;
202
+ }, r._getItemStyleCache = void 0, r._getItemStyleCache = M(function(e, t, n) {
203
+ return {};
204
+ }), r._onScroll = function(e) {
205
+ var t = e.currentTarget, n = t.clientHeight, i = t.clientWidth, a = t.scrollLeft, o = t.scrollTop, s = t.scrollHeight, c = t.scrollWidth;
206
+ r.setState(function(e) {
207
+ if (e.scrollLeft === a && e.scrollTop === o) return null;
208
+ var t = r.props.direction, l = a;
209
+ if (t === "rtl") switch (De()) {
210
+ case "negative":
211
+ l = -a;
212
+ break;
213
+ case "positive-descending":
214
+ l = c - i - a;
215
+ break;
216
+ }
217
+ l = Math.max(0, Math.min(l, c - i));
218
+ var u = Math.max(0, Math.min(o, s - n));
219
+ return {
220
+ isScrolling: !0,
221
+ horizontalScrollDirection: e.scrollLeft < a ? "forward" : "backward",
222
+ scrollLeft: l,
223
+ scrollTop: u,
224
+ verticalScrollDirection: e.scrollTop < o ? "forward" : "backward",
225
+ scrollUpdateWasRequested: !1
226
+ };
227
+ }, r._resetIsScrollingDebounced);
228
+ }, r._outerRefSetter = function(e) {
229
+ var t = r.props.outerRef;
230
+ r._outerRef = e, typeof t == "function" ? t(e) : typeof t == "object" && t && t.hasOwnProperty("current") && (t.current = e);
231
+ }, r._resetIsScrollingDebounced = function() {
232
+ r._resetIsScrollingTimeoutId !== null && we(r._resetIsScrollingTimeoutId), r._resetIsScrollingTimeoutId = Te(r._resetIsScrolling, Oe);
233
+ }, r._resetIsScrolling = function() {
234
+ r._resetIsScrollingTimeoutId = null, r.setState({ isScrolling: !1 }, function() {
235
+ r._getItemStyleCache(-1);
236
+ });
237
+ }, r;
238
+ }
239
+ t.getDerivedStateFromProps = function(e, t) {
240
+ return V(e, t), g(e), null;
241
+ };
242
+ var _ = t.prototype;
243
+ return _.scrollTo = function(e) {
244
+ var t = e.scrollLeft, n = e.scrollTop;
245
+ t !== void 0 && (t = Math.max(0, t)), n !== void 0 && (n = Math.max(0, n)), this.setState(function(e) {
246
+ return t === void 0 && (t = e.scrollLeft), n === void 0 && (n = e.scrollTop), e.scrollLeft === t && e.scrollTop === n ? null : {
247
+ horizontalScrollDirection: e.scrollLeft < t ? "forward" : "backward",
248
+ scrollLeft: t,
249
+ scrollTop: n,
250
+ scrollUpdateWasRequested: !0,
251
+ verticalScrollDirection: e.scrollTop < n ? "forward" : "backward"
252
+ };
253
+ }, this._resetIsScrollingDebounced);
254
+ }, _.scrollToItem = function(e) {
255
+ var t = e.align, n = t === void 0 ? "auto" : t, r = e.columnIndex, i = e.rowIndex, a = this.props, u = a.columnCount, d = a.height, f = a.rowCount, p = a.width, m = this.state, h = m.scrollLeft, g = m.scrollTop, _ = Ee();
256
+ r !== void 0 && (r = Math.max(0, Math.min(r, u - 1))), i !== void 0 && (i = Math.max(0, Math.min(i, f - 1)));
257
+ var v = o(this.props, this._instanceProps), ee = s(this.props, this._instanceProps) > p ? _ : 0, y = v > d ? _ : 0;
258
+ this.scrollTo({
259
+ scrollLeft: r === void 0 ? h : c(this.props, r, n, h, this._instanceProps, y),
260
+ scrollTop: i === void 0 ? g : l(this.props, i, n, g, this._instanceProps, ee)
261
+ });
262
+ }, _.componentDidMount = function() {
263
+ var e = this.props, t = e.initialScrollLeft, n = e.initialScrollTop;
264
+ if (this._outerRef != null) {
265
+ var r = this._outerRef;
266
+ typeof t == "number" && (r.scrollLeft = t), typeof n == "number" && (r.scrollTop = n);
267
+ }
268
+ this._callPropsCallbacks();
269
+ }, _.componentDidUpdate = function() {
270
+ var e = this.props.direction, t = this.state, n = t.scrollLeft, r = t.scrollTop;
271
+ if (t.scrollUpdateWasRequested && this._outerRef != null) {
272
+ var i = this._outerRef;
273
+ if (e === "rtl") switch (De()) {
274
+ case "negative":
275
+ i.scrollLeft = -n;
276
+ break;
277
+ case "positive-ascending":
278
+ i.scrollLeft = n;
279
+ break;
280
+ default:
281
+ var a = i.clientWidth;
282
+ i.scrollLeft = i.scrollWidth - a - n;
283
+ break;
284
+ }
285
+ else i.scrollLeft = Math.max(0, n);
286
+ i.scrollTop = Math.max(0, r);
287
+ }
288
+ this._callPropsCallbacks();
289
+ }, _.componentWillUnmount = function() {
290
+ this._resetIsScrollingTimeoutId !== null && we(this._resetIsScrollingTimeoutId);
291
+ }, _.render = function() {
292
+ var e = this.props, t = e.children, n = e.className, r = e.columnCount, i = e.direction, a = e.height, c = e.innerRef, l = e.innerElementType, u = e.innerTagName, d = e.itemData, f = e.itemKey, p = f === void 0 ? L : f, m = e.outerElementType, h = e.outerTagName, g = e.rowCount, _ = e.style, v = e.useIsScrolling, ee = e.width, y = this.state.isScrolling, te = this._getHorizontalRangeToRender(), ne = te[0], re = te[1], ie = this._getVerticalRangeToRender(), ae = ie[0], oe = ie[1], se = [];
293
+ if (r > 0 && g) for (var b = ae; b <= oe; b++) for (var x = ne; x <= re; x++) se.push(C(t, {
294
+ columnIndex: x,
295
+ data: d,
296
+ isScrolling: v ? y : void 0,
297
+ key: p({
298
+ columnIndex: x,
299
+ data: d,
300
+ rowIndex: b
301
+ }),
302
+ rowIndex: b,
303
+ style: this._getItemStyle(b, x)
304
+ }));
305
+ var ce = o(this.props, this._instanceProps), le = s(this.props, this._instanceProps);
306
+ return C(m || h || "div", {
307
+ className: n,
308
+ onScroll: this._onScroll,
309
+ ref: this._outerRefSetter,
310
+ style: k({
311
+ position: "relative",
312
+ height: a,
313
+ width: ee,
314
+ overflow: "auto",
315
+ WebkitOverflowScrolling: "touch",
316
+ willChange: "transform",
317
+ direction: i
318
+ }, _)
319
+ }, C(l || u || "div", {
320
+ children: se,
321
+ ref: c,
322
+ style: {
323
+ height: ce,
324
+ pointerEvents: y ? "none" : void 0,
325
+ width: le
326
+ }
327
+ }));
328
+ }, _._callPropsCallbacks = function() {
329
+ var e = this.props, t = e.columnCount, n = e.onItemsRendered, r = e.onScroll, i = e.rowCount;
330
+ if (typeof n == "function" && t > 0 && i > 0) {
331
+ var a = this._getHorizontalRangeToRender(), o = a[0], s = a[1], c = a[2], l = a[3], u = this._getVerticalRangeToRender(), d = u[0], f = u[1], p = u[2], m = u[3];
332
+ this._callOnItemsRendered(o, s, d, f, c, l, p, m);
333
+ }
334
+ if (typeof r == "function") {
335
+ var h = this.state, g = h.horizontalScrollDirection, _ = h.scrollLeft, v = h.scrollTop, ee = h.scrollUpdateWasRequested, y = h.verticalScrollDirection;
336
+ this._callOnScroll(_, v, g, y, ee);
337
+ }
338
+ }, _._getHorizontalRangeToRender = function() {
339
+ var e = this.props, t = e.columnCount, n = e.overscanColumnCount, a = e.overscanColumnsCount, o = e.overscanCount, s = e.rowCount, c = this.state, l = c.horizontalScrollDirection, u = c.isScrolling, d = c.scrollLeft, f = n || a || o || 1;
340
+ if (t === 0 || s === 0) return [
341
+ 0,
342
+ 0,
343
+ 0,
344
+ 0
345
+ ];
346
+ var p = r(this.props, d, this._instanceProps), m = i(this.props, p, d, this._instanceProps), h = !u || l === "backward" ? Math.max(1, f) : 1, g = !u || l === "forward" ? Math.max(1, f) : 1;
347
+ return [
348
+ Math.max(0, p - h),
349
+ Math.max(0, Math.min(t - 1, m + g)),
350
+ p,
351
+ m
352
+ ];
353
+ }, _._getVerticalRangeToRender = function() {
354
+ var e = this.props, t = e.columnCount, n = e.overscanCount, r = e.overscanRowCount, i = e.overscanRowsCount, a = e.rowCount, o = this.state, s = o.isScrolling, c = o.verticalScrollDirection, l = o.scrollTop, u = r || i || n || 1;
355
+ if (t === 0 || a === 0) return [
356
+ 0,
357
+ 0,
358
+ 0,
359
+ 0
360
+ ];
361
+ var d = f(this.props, l, this._instanceProps), m = p(this.props, d, l, this._instanceProps), h = !s || c === "backward" ? Math.max(1, u) : 1, g = !s || c === "forward" ? Math.max(1, u) : 1;
362
+ return [
363
+ Math.max(0, d - h),
364
+ Math.max(0, Math.min(a - 1, m + g)),
365
+ d,
366
+ m
367
+ ];
368
+ }, t;
369
+ }(S), t.defaultProps = {
370
+ direction: "ltr",
371
+ itemData: void 0,
372
+ useIsScrolling: !1
373
+ }, t;
374
+ }
375
+ var V = function(e, t) {
376
+ var n = e.children, r = e.direction, i = e.height, a = e.innerTagName, o = e.outerTagName, s = e.overscanColumnsCount, c = e.overscanCount, l = e.overscanRowsCount, u = e.width, d = t.instance;
377
+ if (process.env.NODE_ENV !== "production") {
378
+ if (typeof c == "number" && R && !R.has(d) && (R.add(d), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof s == "number" || typeof l == "number") && z && !z.has(d) && (z.add(d), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (a != null || o != null) && B && !B.has(d) && (B.add(d), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), n == null) throw Error("An invalid \"children\" prop has been specified. Value should be a React component. " + ("\"" + (n === null ? "null" : typeof n) + "\" was specified."));
379
+ switch (r) {
380
+ case "ltr":
381
+ case "rtl": break;
382
+ default: throw Error("An invalid \"direction\" prop has been specified. Value should be either \"ltr\" or \"rtl\". " + ("\"" + r + "\" was specified."));
383
+ }
384
+ if (typeof u != "number") throw Error("An invalid \"width\" prop has been specified. Grids must specify a number for width. " + ("\"" + (u === null ? "null" : typeof u) + "\" was specified."));
385
+ if (typeof i != "number") throw Error("An invalid \"height\" prop has been specified. Grids must specify a number for height. " + ("\"" + (i === null ? "null" : typeof i) + "\" was specified."));
386
+ }
387
+ }, Ae = 50, je = function(e, t) {
388
+ var n = e.rowCount, r = t.rowMetadataMap, i = t.estimatedRowHeight, a = t.lastMeasuredRowIndex, o = 0;
389
+ if (a >= n && (a = n - 1), a >= 0) {
390
+ var s = r[a];
391
+ o = s.offset + s.size;
392
+ }
393
+ var c = (n - a - 1) * i;
394
+ return o + c;
395
+ }, H = function(e, t) {
396
+ var n = e.columnCount, r = t.columnMetadataMap, i = t.estimatedColumnWidth, a = t.lastMeasuredColumnIndex, o = 0;
397
+ if (a >= n && (a = n - 1), a >= 0) {
398
+ var s = r[a];
399
+ o = s.offset + s.size;
400
+ }
401
+ var c = (n - a - 1) * i;
402
+ return o + c;
403
+ }, U = function(e, t, n, r) {
404
+ var i, a, o;
405
+ if (e === "column" ? (i = r.columnMetadataMap, a = t.columnWidth, o = r.lastMeasuredColumnIndex) : (i = r.rowMetadataMap, a = t.rowHeight, o = r.lastMeasuredRowIndex), n > o) {
406
+ var s = 0;
407
+ if (o >= 0) {
408
+ var c = i[o];
409
+ s = c.offset + c.size;
410
+ }
411
+ for (var l = o + 1; l <= n; l++) {
412
+ var u = a(l);
413
+ i[l] = {
414
+ offset: s,
415
+ size: u
416
+ }, s += u;
417
+ }
418
+ e === "column" ? r.lastMeasuredColumnIndex = n : r.lastMeasuredRowIndex = n;
419
+ }
420
+ return i[n];
421
+ }, Me = function(e, t, n, r) {
422
+ var i, a;
423
+ return e === "column" ? (i = n.columnMetadataMap, a = n.lastMeasuredColumnIndex) : (i = n.rowMetadataMap, a = n.lastMeasuredRowIndex), (a > 0 ? i[a].offset : 0) >= r ? Ne(e, t, n, a, 0, r) : Pe(e, t, n, Math.max(0, a), r);
424
+ }, Ne = function(e, t, n, r, i, a) {
425
+ for (; i <= r;) {
426
+ var o = i + Math.floor((r - i) / 2), s = U(e, t, o, n).offset;
427
+ if (s === a) return o;
428
+ s < a ? i = o + 1 : s > a && (r = o - 1);
429
+ }
430
+ return i > 0 ? i - 1 : 0;
431
+ }, Pe = function(e, t, n, r, i) {
432
+ for (var a = e === "column" ? t.columnCount : t.rowCount, o = 1; r < a && U(e, t, r, n).offset < i;) r += o, o *= 2;
433
+ return Ne(e, t, n, Math.min(r, a - 1), Math.floor(r / 2), i);
434
+ }, Fe = function(e, t, n, r, i, a, o) {
435
+ var s = e === "column" ? t.width : t.height, c = U(e, t, n, a), l = e === "column" ? H(t, a) : je(t, a), u = Math.max(0, Math.min(l - s, c.offset)), d = Math.max(0, c.offset - s + o + c.size);
436
+ switch (r === "smart" && (r = i >= d - s && i <= u + s ? "auto" : "center"), r) {
437
+ case "start": return u;
438
+ case "end": return d;
439
+ case "center": return Math.round(d + (u - d) / 2);
440
+ default: return i >= d && i <= u ? i : d > u || i < d ? d : u;
441
+ }
442
+ }, Ie = /* @__PURE__ */ ke({
443
+ getColumnOffset: function(e, t, n) {
444
+ return U("column", e, t, n).offset;
445
+ },
446
+ getColumnStartIndexForOffset: function(e, t, n) {
447
+ return Me("column", e, n, t);
448
+ },
449
+ getColumnStopIndexForStartIndex: function(e, t, n, r) {
450
+ for (var i = e.columnCount, a = e.width, o = U("column", e, t, r), s = n + a, c = o.offset + o.size, l = t; l < i - 1 && c < s;) l++, c += U("column", e, l, r).size;
451
+ return l;
452
+ },
453
+ getColumnWidth: function(e, t, n) {
454
+ return n.columnMetadataMap[t].size;
455
+ },
456
+ getEstimatedTotalHeight: je,
457
+ getEstimatedTotalWidth: H,
458
+ getOffsetForColumnAndAlignment: function(e, t, n, r, i, a) {
459
+ return Fe("column", e, t, n, r, i, a);
460
+ },
461
+ getOffsetForRowAndAlignment: function(e, t, n, r, i, a) {
462
+ return Fe("row", e, t, n, r, i, a);
463
+ },
464
+ getRowOffset: function(e, t, n) {
465
+ return U("row", e, t, n).offset;
466
+ },
467
+ getRowHeight: function(e, t, n) {
468
+ return n.rowMetadataMap[t].size;
469
+ },
470
+ getRowStartIndexForOffset: function(e, t, n) {
471
+ return Me("row", e, n, t);
472
+ },
473
+ getRowStopIndexForStartIndex: function(e, t, n, r) {
474
+ for (var i = e.rowCount, a = e.height, o = U("row", e, t, r), s = n + a, c = o.offset + o.size, l = t; l < i - 1 && c < s;) l++, c += U("row", e, l, r).size;
475
+ return l;
476
+ },
477
+ initInstanceProps: function(e, t) {
478
+ var n = e, r = n.estimatedColumnWidth, i = n.estimatedRowHeight, a = {
479
+ columnMetadataMap: {},
480
+ estimatedColumnWidth: r || Ae,
481
+ estimatedRowHeight: i || Ae,
482
+ lastMeasuredColumnIndex: -1,
483
+ lastMeasuredRowIndex: -1,
484
+ rowMetadataMap: {}
485
+ };
486
+ return t.resetAfterColumnIndex = function(e, n) {
487
+ n === void 0 && (n = !0), t.resetAfterIndices({
488
+ columnIndex: e,
489
+ shouldForceUpdate: n
490
+ });
491
+ }, t.resetAfterRowIndex = function(e, n) {
492
+ n === void 0 && (n = !0), t.resetAfterIndices({
493
+ rowIndex: e,
494
+ shouldForceUpdate: n
495
+ });
496
+ }, t.resetAfterIndices = function(e) {
497
+ var n = e.columnIndex, r = e.rowIndex, i = e.shouldForceUpdate, o = i === void 0 ? !0 : i;
498
+ typeof n == "number" && (a.lastMeasuredColumnIndex = Math.min(a.lastMeasuredColumnIndex, n - 1)), typeof r == "number" && (a.lastMeasuredRowIndex = Math.min(a.lastMeasuredRowIndex, r - 1)), t._getItemStyleCache(-1), o && t.forceUpdate();
499
+ }, a;
500
+ },
501
+ shouldResetStyleCacheOnItemSizeChange: !1,
502
+ validateProps: function(e) {
503
+ var t = e.columnWidth, n = e.rowHeight;
504
+ if (process.env.NODE_ENV !== "production") {
505
+ if (typeof t != "function") throw Error("An invalid \"columnWidth\" prop has been specified. Value should be a function. " + ("\"" + (t === null ? "null" : typeof t) + "\" was specified."));
506
+ if (typeof n != "function") throw Error("An invalid \"rowHeight\" prop has been specified. Value should be a function. " + ("\"" + (n === null ? "null" : typeof n) + "\" was specified."));
507
+ }
508
+ }
509
+ });
510
+ process.env.NODE_ENV !== "production" && typeof window < "u" && window.WeakSet;
511
+ function W(e, t) {
512
+ for (var n in e) if (!(n in t)) return !0;
513
+ for (var r in t) if (e[r] !== t[r]) return !0;
514
+ return !1;
515
+ }
516
+ var G = ["style"], K = ["style"];
517
+ function q(e, t) {
518
+ var n = e.style, r = N(e, G), i = t.style, a = N(t, K);
519
+ return !W(n, i) && !W(r, a);
520
+ }
521
+ //#endregion
522
+ //#region node_modules/.pnpm/react-virtualized-auto-sizer@1.0.26_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-virtualized-auto-sizer/dist/react-virtualized-auto-sizer.esm.js
523
+ var J = typeof window < "u" ? window : typeof self < "u" ? self : global, Y = null, X = null, Le = 20, Z = J.clearTimeout, Re = J.setTimeout, Q = J.cancelAnimationFrame || J.mozCancelAnimationFrame || J.webkitCancelAnimationFrame, $ = J.requestAnimationFrame || J.mozRequestAnimationFrame || J.webkitRequestAnimationFrame;
524
+ Q == null || $ == null ? (Y = Z, X = function(e) {
525
+ return Re(e, Le);
526
+ }) : (Y = function([e, t]) {
527
+ Q(e), Z(t);
528
+ }, X = function(e) {
529
+ let t = $(function() {
530
+ Z(n), e();
531
+ }), n = Re(function() {
532
+ Q(t), e();
533
+ }, Le);
534
+ return [t, n];
535
+ });
536
+ function ze(e) {
537
+ let t, n, r, i, a, o, s, c = typeof document < "u" && document.attachEvent;
538
+ if (!c) {
539
+ o = function(e) {
540
+ let t = e.__resizeTriggers__, n = t.firstElementChild, r = t.lastElementChild, i = n.firstElementChild;
541
+ r.scrollLeft = r.scrollWidth, r.scrollTop = r.scrollHeight, i.style.width = n.offsetWidth + 1 + "px", i.style.height = n.offsetHeight + 1 + "px", n.scrollLeft = n.scrollWidth, n.scrollTop = n.scrollHeight;
542
+ }, a = function(e) {
543
+ return e.offsetWidth !== e.__resizeLast__.width || e.offsetHeight !== e.__resizeLast__.height;
544
+ }, s = function(e) {
545
+ if (e.target.className && typeof e.target.className.indexOf == "function" && e.target.className.indexOf("contract-trigger") < 0 && e.target.className.indexOf("expand-trigger") < 0) return;
546
+ let t = this;
547
+ o(this), this.__resizeRAF__ && Y(this.__resizeRAF__), this.__resizeRAF__ = X(function() {
548
+ a(t) && (t.__resizeLast__.width = t.offsetWidth, t.__resizeLast__.height = t.offsetHeight, t.__resizeListeners__.forEach(function(n) {
549
+ n.call(t, e);
550
+ }));
551
+ });
552
+ };
553
+ let e = !1, c = "";
554
+ r = "animationstart";
555
+ let l = "Webkit Moz O ms".split(" "), u = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), d = "";
556
+ {
557
+ let t = document.createElement("fakeelement");
558
+ if (t.style.animationName !== void 0 && (e = !0), e === !1) {
559
+ for (let n = 0; n < l.length; n++) if (t.style[l[n] + "AnimationName"] !== void 0) {
560
+ d = l[n], c = "-" + d.toLowerCase() + "-", r = u[n], e = !0;
561
+ break;
562
+ }
563
+ }
564
+ }
565
+ n = "resizeanim", t = "@" + c + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", i = c + "animation: 1ms " + n + "; ";
566
+ }
567
+ let l = function(n) {
568
+ if (!n.getElementById("detectElementResize")) {
569
+ let r = (t || "") + ".resize-triggers { " + (i || "") + "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%; }", a = n.head || n.getElementsByTagName("head")[0], o = n.createElement("style");
570
+ o.id = "detectElementResize", o.type = "text/css", e != null && o.setAttribute("nonce", e), o.styleSheet ? o.styleSheet.cssText = r : o.appendChild(n.createTextNode(r)), a.appendChild(o);
571
+ }
572
+ };
573
+ return {
574
+ addResizeListener: function(e, t) {
575
+ if (c) e.attachEvent("onresize", t);
576
+ else {
577
+ if (!e.__resizeTriggers__) {
578
+ let t = e.ownerDocument, i = J.getComputedStyle(e);
579
+ i && i.position === "static" && (e.style.position = "relative"), l(t), e.__resizeLast__ = {}, e.__resizeListeners__ = [], (e.__resizeTriggers__ = t.createElement("div")).className = "resize-triggers";
580
+ let a = t.createElement("div");
581
+ a.className = "expand-trigger", a.appendChild(t.createElement("div"));
582
+ let c = t.createElement("div");
583
+ c.className = "contract-trigger", e.__resizeTriggers__.appendChild(a), e.__resizeTriggers__.appendChild(c), e.appendChild(e.__resizeTriggers__), o(e), e.addEventListener("scroll", s, !0), r && (e.__resizeTriggers__.__animationListener__ = function(t) {
584
+ t.animationName === n && o(e);
585
+ }, e.__resizeTriggers__.addEventListener(r, e.__resizeTriggers__.__animationListener__));
586
+ }
587
+ e.__resizeListeners__.push(t);
588
+ }
589
+ },
590
+ removeResizeListener: function(e, t) {
591
+ if (c) e.detachEvent("onresize", t);
592
+ else if (e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t), 1), !e.__resizeListeners__.length) {
593
+ e.removeEventListener("scroll", s, !0), e.__resizeTriggers__.__animationListener__ && (e.__resizeTriggers__.removeEventListener(r, e.__resizeTriggers__.__animationListener__), e.__resizeTriggers__.__animationListener__ = null);
594
+ try {
595
+ e.__resizeTriggers__ = !e.removeChild(e.__resizeTriggers__);
596
+ } catch {}
597
+ }
598
+ }
599
+ };
600
+ }
601
+ var Be = class extends pe {
602
+ constructor(...e) {
603
+ super(...e), this.state = {
604
+ height: this.props.defaultHeight || 0,
605
+ width: this.props.defaultWidth || 0
606
+ }, this._autoSizer = null, this._detectElementResize = null, this._didLogDeprecationWarning = !1, this._parentNode = null, this._resizeObserver = null, this._timeoutId = null, this._onResize = () => {
607
+ this._timeoutId = null;
608
+ let { disableHeight: e, disableWidth: t, onResize: n } = this.props;
609
+ if (this._parentNode) {
610
+ let r = window.getComputedStyle(this._parentNode) || {}, i = parseFloat(r.paddingLeft || "0"), a = parseFloat(r.paddingRight || "0"), o = parseFloat(r.paddingTop || "0"), s = parseFloat(r.paddingBottom || "0"), c = this._parentNode.getBoundingClientRect(), l = c.height - o - s, u = c.width - i - a;
611
+ if (!e && this.state.height !== l || !t && this.state.width !== u) {
612
+ this.setState({
613
+ height: l,
614
+ width: u
615
+ });
616
+ let e = () => {
617
+ this._didLogDeprecationWarning || (this._didLogDeprecationWarning = !0, console.warn("scaledWidth and scaledHeight parameters have been deprecated; use width and height instead"));
618
+ };
619
+ typeof n == "function" && n({
620
+ height: l,
621
+ width: u,
622
+ get scaledHeight() {
623
+ return e(), l;
624
+ },
625
+ get scaledWidth() {
626
+ return e(), u;
627
+ }
628
+ });
629
+ }
630
+ }
631
+ }, this._setRef = (e) => {
632
+ this._autoSizer = e;
633
+ };
634
+ }
635
+ componentDidMount() {
636
+ let { nonce: e } = this.props, t = this._autoSizer ? this._autoSizer.parentNode : null;
637
+ if (t != null && t.ownerDocument && t.ownerDocument.defaultView && t instanceof t.ownerDocument.defaultView.HTMLElement) {
638
+ this._parentNode = t;
639
+ let n = t.ownerDocument.defaultView.ResizeObserver;
640
+ n == null ? (this._detectElementResize = ze(e), this._detectElementResize.addResizeListener(t, this._onResize)) : (this._resizeObserver = new n(() => {
641
+ this._timeoutId = setTimeout(this._onResize, 0);
642
+ }), this._resizeObserver.observe(t)), this._onResize();
643
+ }
644
+ }
645
+ componentWillUnmount() {
646
+ this._parentNode && (this._detectElementResize && this._detectElementResize.removeResizeListener(this._parentNode, this._onResize), this._timeoutId !== null && clearTimeout(this._timeoutId), this._resizeObserver && this._resizeObserver.disconnect());
647
+ }
648
+ render() {
649
+ let { children: e, defaultHeight: t, defaultWidth: n, disableHeight: r = !1, disableWidth: i = !1, doNotBailOutOnEmptyChildren: a = !1, nonce: o, onResize: s, style: c = {}, tagName: l = "div", ...u } = this.props, { height: d, width: f } = this.state, p = { overflow: "visible" }, m = {}, h = !1;
650
+ return r || (d === 0 && (h = !0), p.height = 0, m.height = d, m.scaledHeight = d), i || (f === 0 && (h = !0), p.width = 0, m.width = f, m.scaledWidth = f), a && (h = !1), C(l, {
651
+ ref: this._setRef,
652
+ style: {
653
+ ...p,
654
+ ...c
655
+ },
656
+ ...u
657
+ }, !h && e(m));
658
+ }
659
+ }, Ve = me(({ columnIndex: e, rowIndex: t, data: n, style: r }) => {
660
+ let i = p(t, e, n.columnCount, n.isDualPageWithCover);
661
+ if (i <= 0) return null;
662
+ if (n.isDualPageWithCover) {
663
+ let a = i === n.totalPages && n.totalPages % 2 == 0;
664
+ if (t === 0 && i === 1 || a && e === 0) {
665
+ let e = n.columnWidths.reduce((e, t) => e + t, 0);
666
+ return /* @__PURE__ */ D("div", {
667
+ style: {
668
+ ...r,
669
+ width: e,
670
+ display: "flex",
671
+ justifyContent: "center",
672
+ alignItems: "flex-start"
673
+ },
674
+ children: /* @__PURE__ */ D(y, {
675
+ style: { position: "relative" },
676
+ pageNumber: i
677
+ }, i)
678
+ });
679
+ }
680
+ }
681
+ return n.columnCount === 2 ? /* @__PURE__ */ D("div", {
682
+ style: {
683
+ ...r,
684
+ display: "flex",
685
+ justifyContent: e === 0 ? "flex-end" : "flex-start",
686
+ alignItems: "flex-start"
687
+ },
688
+ children: /* @__PURE__ */ D(y, {
689
+ style: { position: "relative" },
690
+ pageNumber: i
691
+ }, i)
692
+ }) : /* @__PURE__ */ D(y, {
693
+ style: r,
694
+ pageNumber: i
695
+ }, i);
696
+ }, q), He = () => {
697
+ let p = E(new _e()), { initialPage: y = 1, initialScrollMode: pe } = o(), { pagesRef: S, setPagesRef: C, setContentRef: me } = u(), { scrollToPage: k } = m();
698
+ ue(S);
699
+ let { virtualScrollRef: A, getVirtualScrollRef: be, getPageScrollElementRef: xe, getVirtualScrollableElementRef: Se, setTotalInnerDimensions: Ce, virtualScrollableElementRef: j, totalInnerDimensions: M, pageScrollElementRef: N } = l(), P = E(y > 1), [we, Te] = ge(y > 1), { nextPage: F, prevPage: Ee, setFocusedPage: I, focusedPage: De, totalPages: Oe } = h(), { scrollMode: L } = s(), { viewMode: R } = c(), z = E(null), B = E(null), { loading: ke, error: V } = a(), { passwordRequired: Ae } = i(), { LoaderImageComponent: je } = ee(), H = E(M), U = E({
700
+ viewMode: R,
701
+ scrollMode: L
702
+ }), Me = E(!1), Ne = E(), { isFullScreen: Pe } = _(), { pageDimension: Fe, rowCount: W, rowHeight: G, columnCount: K, columnWidth: q, estimatedColumnWidth: J, estimatedRowHeight: Y, totalDimension: X } = te(), Le = f(M, 100), { onScroll: Z, onTextSelect: Re } = d();
703
+ de({
704
+ onTextSelect: Re,
705
+ pagesRef: S
706
+ });
707
+ let Q = E();
708
+ x(K, W, j, R);
709
+ let $ = E({
710
+ scrollTop: 0,
711
+ scrollLeft: 0
712
+ });
713
+ se(S);
714
+ let { isPressed: ze } = ae(), { selectionMode: He } = g(), { initializeGrabScroll: Ue, resetGrabState: We } = oe({ isPressed: ze }), Ge = he(() => He === n.HAND, [He]), Ke = he(() => {
715
+ let e = Array.from({ length: K }, (e, t) => q(t));
716
+ return {
717
+ columnCount: K,
718
+ isDualPageWithCover: R === r.DUAL_PAGE_WITH_COVER,
719
+ columnWidths: e,
720
+ totalPages: Oe
721
+ };
722
+ }, [
723
+ K,
724
+ R,
725
+ q,
726
+ Oe
727
+ ]), qe = w((e) => {
728
+ let t = document.activeElement !== S;
729
+ !Pe && t || (["ArrowUp", "ArrowLeft"].includes(e.key) ? (e.preventDefault(), Ee()) : ["ArrowDown", "ArrowRight"].includes(e.key) && (e.preventDefault(), F()));
730
+ }, [
731
+ F,
732
+ Ee,
733
+ Pe,
734
+ L
735
+ ]);
736
+ T(() => (window.addEventListener("keydown", qe), () => {
737
+ window.removeEventListener("keydown", qe);
738
+ }), [qe]), T(() => {
739
+ if (z.current && (z.current.style.position = "relative"), A) for (let e = 0; e < W; e++) for (let t = 0; t < K; t++) A.resetAfterIndices({
740
+ columnIndex: t,
741
+ rowIndex: e,
742
+ shouldForceUpdate: !0
743
+ });
744
+ }, [
745
+ W,
746
+ K,
747
+ Fe,
748
+ A
749
+ ]);
750
+ let Je = w((e, t) => {
751
+ if (!j) return {
752
+ scrollTop: 0,
753
+ scrollLeft: 0
754
+ };
755
+ let n = $.current.scrollTop > t, r = $.current.scrollLeft > e;
756
+ return n || r ? $.current : {
757
+ scrollTop: j.scrollTop,
758
+ scrollLeft: j.scrollLeft
759
+ };
760
+ }, [j]), Ye = w((e, t) => {
761
+ if (U.current.viewMode !== R || U.current.scrollMode !== L) {
762
+ Q.current && clearTimeout(Q.current), Me.current = !0, k(De, "auto"), Q.current = setTimeout(() => {
763
+ requestAnimationFrame(() => {
764
+ U.current = {
765
+ viewMode: R,
766
+ scrollMode: L
767
+ };
768
+ });
769
+ }, 100);
770
+ return;
771
+ }
772
+ let n = e.scrollTop, r = e.scrollLeft;
773
+ if (!t.height || !t.width) return;
774
+ Me.current = !0;
775
+ let { height: i, width: a } = t, { height: o, width: s } = H.current;
776
+ if (o === i && s === a) return;
777
+ if (P.current && y > 1) {
778
+ H.current = {
779
+ height: t.height,
780
+ width: t.width
781
+ };
782
+ return;
783
+ }
784
+ if (!o || !s) {
785
+ H.current = {
786
+ height: t.height,
787
+ width: t.width
788
+ };
789
+ return;
790
+ }
791
+ if (n === 0 && r === 0) {
792
+ H.current = {
793
+ height: t.height,
794
+ width: t.width
795
+ };
796
+ return;
797
+ }
798
+ let c = n / o * i, l = r / s * a, u = Math.round(Math.min(c, i)) || 0, d = Math.round(Math.min(l, a)) || 0;
799
+ Ne.current = setTimeout(() => {
800
+ requestAnimationFrame(() => {
801
+ j?.scrollTo({
802
+ top: u,
803
+ left: d,
804
+ behavior: "auto"
805
+ });
806
+ });
807
+ }, 0), H.current = {
808
+ height: t.height,
809
+ width: t.width
810
+ };
811
+ }, [
812
+ j,
813
+ R,
814
+ L,
815
+ k,
816
+ y
817
+ ]);
818
+ T(() => {
819
+ clearTimeout(Ne.current);
820
+ let e = Array.from({ length: W }).reduce((e, t, n) => e + G(n), 0), t = Array.from({ length: K }).reduce((e, t, n) => e + q(n), 0), n = Je(t, e);
821
+ $.current = n, Ye(n, {
822
+ height: e,
823
+ width: t
824
+ }), Ce({
825
+ height: e,
826
+ width: t
827
+ });
828
+ }, [
829
+ Fe,
830
+ W,
831
+ K,
832
+ Ye
833
+ ]);
834
+ let Xe = w((e) => {
835
+ $.current = {
836
+ scrollTop: e.scrollTop,
837
+ scrollLeft: e.scrollLeft
838
+ };
839
+ }, [j]);
840
+ T(() => {
841
+ if (Z) return N && N.addEventListener("scroll", Z), j && j.addEventListener("scroll", Z), () => {
842
+ N?.removeEventListener("scroll", Z), j?.removeEventListener("scroll", Z);
843
+ };
844
+ }, [
845
+ j,
846
+ N,
847
+ Z
848
+ ]), T(() => () => {
849
+ Q.current && clearTimeout(Q.current);
850
+ }, []);
851
+ let Ze = he(() => v(O["rp-pages-container"], {
852
+ [O["rp-cursor-grab"]]: Ge && !ze,
853
+ [O["rp-cursor-grabbing"]]: Ge && ze
854
+ }), [Ge, ze]), Qe = w((e) => {
855
+ if (Ge && e) {
856
+ let e = v(O["rp-pages"]);
857
+ Ue(document.querySelector(`.${e}`));
858
+ }
859
+ }, [
860
+ Ge,
861
+ Ue,
862
+ O
863
+ ]);
864
+ return T(() => {
865
+ ke && We();
866
+ }, [ke]), T(() => {
867
+ if (V !== e.INVALID_OR_CORRUPTED_PDF) return;
868
+ let t = requestAnimationFrame(() => {
869
+ B.current?.focus();
870
+ });
871
+ return () => {
872
+ cancelAnimationFrame(t);
873
+ };
874
+ }, [V]), T(() => {
875
+ if (!(Le.height === 0 || !P.current)) {
876
+ if (pe === t.PAGE_SCROLLING) {
877
+ y !== De && N && I(y), P.current = !1, Te(!1);
878
+ return;
879
+ }
880
+ j && (k(y, "auto"), (j.scrollLeft > 0 || j.scrollTop > 0) && (I(y), P.current = !1, Te(!1)));
881
+ }
882
+ }, [
883
+ k,
884
+ pe,
885
+ N,
886
+ I,
887
+ Le,
888
+ j
889
+ ]), /* @__PURE__ */ ye(ve, { children: [/* @__PURE__ */ D(le, {
890
+ ref: me,
891
+ children: /* @__PURE__ */ D(ce, {
892
+ ref: C,
893
+ tabIndex: -1,
894
+ className: Ze,
895
+ style: {
896
+ "--scale-round-x": `${fe(p.current.sx)[1]}px`,
897
+ "--scale-round-y": `${fe(p.current.sy)[1]}px`
898
+ },
899
+ children: /* @__PURE__ */ D(Be, {
900
+ style: { minHeight: "50px" },
901
+ children: ({ width: n, height: i }) => /* @__PURE__ */ D("div", {
902
+ "data-rp": "pages",
903
+ ref: Qe,
904
+ style: {
905
+ width: n,
906
+ height: i,
907
+ ...we && { visibility: "hidden" }
908
+ },
909
+ children: L === t.PAGE_SCROLLING ? V === e.INVALID_OR_CORRUPTED_PDF ? /* @__PURE__ */ D("div", {
910
+ ref: B,
911
+ className: O["rp-load-error"],
912
+ style: {
913
+ width: n,
914
+ height: i
915
+ },
916
+ tabIndex: -1,
917
+ role: "alert",
918
+ "aria-live": "assertive",
919
+ "aria-atomic": "true",
920
+ children: /* @__PURE__ */ D("div", {
921
+ className: O["rp-load-error-message"],
922
+ children: "Invalid or corrupted PDF file."
923
+ })
924
+ }) : /* @__PURE__ */ D("div", {
925
+ ref: xe,
926
+ style: {
927
+ width: n,
928
+ height: i
929
+ },
930
+ className: v(O["rp-pages"], O["rp-page-scrolling-wrapper"]),
931
+ children: R === r.DUAL_PAGE ? /* @__PURE__ */ D(ne, {
932
+ widths: q,
933
+ heights: G
934
+ }) : R === r.DUAL_PAGE_WITH_COVER ? /* @__PURE__ */ D(re, {
935
+ widths: q,
936
+ heights: G
937
+ }) : /* @__PURE__ */ D(ie, {
938
+ widths: q,
939
+ heights: G
940
+ })
941
+ }) : Y ? /* @__PURE__ */ D(Ie, {
942
+ ref: be,
943
+ itemData: Ke,
944
+ outerRef: Se,
945
+ innerRef: z,
946
+ onScroll: Xe,
947
+ columnCount: K,
948
+ columnWidth: q,
949
+ rowHeight: G,
950
+ height: i,
951
+ width: n,
952
+ estimatedColumnWidth: J,
953
+ estimatedRowHeight: Y,
954
+ rowCount: W,
955
+ className: v(O["rp-pages"], L === t.HORIZONTAL_SCROLLING ? O["rp-pages-horizontal-scroll"] : ""),
956
+ style: {
957
+ "--rp-pages-height": `${X.height}px`,
958
+ "--rp-pages-width": `${X.width}px`,
959
+ "--rp-row-count": `${W}`,
960
+ "--rp-column-count": `${K}`
961
+ },
962
+ children: Ve
963
+ }) : !ke && !V ? /* @__PURE__ */ D("div", {
964
+ className: O["rp-loader"],
965
+ style: {
966
+ display: "flex",
967
+ justifyContent: "center",
968
+ alignItems: "center",
969
+ height: "100%",
970
+ width: "100%"
971
+ },
972
+ children: je && /* @__PURE__ */ D(je, {})
973
+ }) : V === e.NOT_SUPPORTED ? /* @__PURE__ */ D("div", {
974
+ className: O["rp-not-supported"],
975
+ children: /* @__PURE__ */ ye("div", {
976
+ className: O["rp-not-supported-content"],
977
+ children: ["React PDF Kit is unable to render on this browser. Please use the supported browsers from the list below:", /* @__PURE__ */ D("div", { children: /* @__PURE__ */ ye("ul", {
978
+ className: O["rp-not-supported-list"],
979
+ children: [
980
+ /* @__PURE__ */ D("li", { children: "Chrome 126+" }),
981
+ /* @__PURE__ */ D("li", { children: "Edge 126+" }),
982
+ /* @__PURE__ */ D("li", { children: "Firefox 126+" }),
983
+ /* @__PURE__ */ D("li", { children: "Safari 18.4+" }),
984
+ /* @__PURE__ */ D("li", { children: "Safari iOS 18.4+" }),
985
+ /* @__PURE__ */ D("li", { children: "Chrome Android 126+" })
986
+ ]
987
+ }) })]
988
+ })
989
+ }) : V === e.INVALID_OR_CORRUPTED_PDF ? /* @__PURE__ */ D("div", {
990
+ ref: B,
991
+ className: O["rp-load-error"],
992
+ tabIndex: -1,
993
+ role: "alert",
994
+ "aria-live": "assertive",
995
+ "aria-atomic": "true",
996
+ children: /* @__PURE__ */ D("div", {
997
+ className: O["rp-load-error-message"],
998
+ children: "Invalid or corrupted PDF file."
999
+ })
1000
+ }) : null
1001
+ })
1002
+ })
1003
+ })
1004
+ }), Ae && /* @__PURE__ */ D(b, {})] });
1005
+ };
1006
+ //#endregion
1007
+ export { He as t };