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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/PaginationContext-15f88187.js +222 -0
  2. package/dist/components/RPController.js +1 -1
  3. package/dist/components/RPPages.js +523 -511
  4. package/dist/components/RPProvider.js +1 -1
  5. package/dist/components/layout/RPDefaultLayout.js +1 -1
  6. package/dist/components/layout/RPLayout.js +1 -1
  7. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  8. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  9. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  10. package/dist/components/layout/toolbar/MostPageTool.js +1 -1
  11. package/dist/components/layout/toolbar/OtherTool.js +1 -1
  12. package/dist/components/layout/toolbar/Paginate.js +1 -1
  13. package/dist/components/layout/toolbar/RPMoreOptions.js +1 -1
  14. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  15. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  16. package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
  17. package/dist/components/layout/toolbar/SearchTool.js +1 -1
  18. package/dist/components/layout/toolbar/ToolbarCustom.js +1 -1
  19. package/dist/components/layout/toolbar/ToolbarDefault.js +1 -1
  20. package/dist/components/layout/toolbar/ToolbarLayout.js +1 -1
  21. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +1 -1
  22. package/dist/components/layout/toolbar/tools/FirstPageTool.js +1 -1
  23. package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
  24. package/dist/components/layout/toolbar/tools/LastPageTool.js +1 -1
  25. package/dist/components/layout/toolbar/tools/NextPageTool.js +1 -1
  26. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
  27. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +1 -1
  28. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +1 -1
  29. package/dist/components/page/AnnotationLayer.js +1 -1
  30. package/dist/components/page/CanvasLayer.js +1 -1
  31. package/dist/components/page/DualPage.js +1 -1
  32. package/dist/components/page/DualPageWithCover.js +1 -1
  33. package/dist/components/page/RPPage.js +1 -1
  34. package/dist/components/page/SinglePage.js +1 -1
  35. package/dist/components/page/TextLayer.js +1 -1
  36. package/dist/contexts/PaginationContext.js +1 -1
  37. package/dist/contexts/RenderQueueProvider.js +1 -1
  38. package/dist/contexts/SearchContext.js +1 -1
  39. package/dist/main.js +1 -1
  40. package/dist/utils/hooks/useLicense.js +1 -1
  41. package/dist/utils/hooks/useLoadPdf.js +28 -28
  42. package/dist/utils/hooks/usePaginate.js +1 -1
  43. package/dist/utils/hooks/usePresentPage.js +34 -32
  44. package/dist/utils/hooks/useScrollToPage.js +1 -1
  45. package/dist/utils/hooks/useSearch.js +1 -1
  46. package/package.json +1 -1
  47. package/dist/PaginationContext-a3021a65.js +0 -218
@@ -1,36 +1,36 @@
1
- import { jsx as b, jsxs as Ce, Fragment as st } from "react/jsx-runtime";
2
- import { createElement as ue, PureComponent as at, Component as lt, memo as ct, useRef as G, useMemo as Se, useCallback as ae, useEffect as ne } from "react";
3
- import { RPPage as Ie } from "./page/RPPage.js";
4
- import { useVirtualReactWindow as ut } from "../utils/hooks/useVirtualReactWindow.js";
5
- import { useVirtualScrollContext as dt } from "../contexts/VirtualScrollContext.js";
6
- import { a as ft, u as mt } from "../PaginationContext-a3021a65.js";
7
- import { useDocumentContext as pt } from "../contexts/RPDocumentContext.js";
8
- import { useViewModeContext as ht } from "../contexts/ViewModeContext.js";
9
- import { useScrollModeContext as gt } from "../contexts/ScrollModeContext.js";
10
- import { SelectionMode as vt, ViewMode as Te, ScrollMode as xe, ErrorType as _t } from "../utils/types.js";
11
- import { useFullScreenContext as wt } from "../contexts/FullScreenContext.js";
12
- import { c as ce } from "../clsx-0c6e471a.js";
13
- import { DualPage as Ct } from "./page/DualPage.js";
14
- import { DualPageWithCover as St } from "./page/DualPageWithCover.js";
15
- import { SinglePage as It } from "./page/SinglePage.js";
16
- import { useMousePressed as Tt } from "../utils/hooks/useMousePressed.js";
17
- import { useSelectionModeContext as xt } from "../contexts/SelectionModeContext.js";
18
- import { useGrabScroll as Rt } from "../utils/hooks/useGrabScroll.js";
19
- import { usePinch as yt } from "../utils/hooks/usePinch.js";
20
- import { useInitialStateContext as bt } from "../contexts/InitialStateContext.js";
21
- import { useLayoutContainer as Lt } from "../contexts/LayoutContainerContext.js";
22
- import { useDebounce as zt } from "../utils/hooks/useDebounce.js";
23
- import { useLoaderContext as Mt } from "../contexts/LoaderContext.js";
24
- import Et from "./ui/PasswordModal.js";
25
- import { usePresentPage as Ot } from "../utils/hooks/usePresentPage.js";
26
- import { getPageFromPosition as Wt } from "../utils/calculatePage.js";
27
- import { useDocumentPasswordContext as At } from "../contexts/DocumentPasswordContext.js";
28
- import { LayoutContainer as Nt } from "./layout/LayoutContainer.js";
29
- import { LayoutWrapper as Pt } from "./layout/LayoutWrapper.js";
30
- import { useEventCallbackContext as Ft } from "../contexts/EventCallbackContext.js";
31
- import { useCopyText as Dt } from "../utils/hooks/useCopyText.js";
32
- import { useTextSelection as Ht } from "../utils/hooks/useTextSelection.js";
33
- import { OutputScale as kt } from "pdfjs-dist";
1
+ import { jsx as L, jsxs as Se, Fragment as lt } from "react/jsx-runtime";
2
+ import { createElement as de, PureComponent as ct, Component as ut, memo as dt, useRef as K, useState as ft, useMemo as Ie, useCallback as se, useEffect as ee } from "react";
3
+ import { RPPage as Te } from "./page/RPPage.js";
4
+ import { useVirtualReactWindow as mt } from "../utils/hooks/useVirtualReactWindow.js";
5
+ import { useVirtualScrollContext as pt } from "../contexts/VirtualScrollContext.js";
6
+ import { a as ht, u as gt } from "../PaginationContext-15f88187.js";
7
+ import { useDocumentContext as vt } from "../contexts/RPDocumentContext.js";
8
+ import { useViewModeContext as _t } from "../contexts/ViewModeContext.js";
9
+ import { useScrollModeContext as wt } from "../contexts/ScrollModeContext.js";
10
+ import { SelectionMode as Ct, ViewMode as xe, ScrollMode as Re, ErrorType as St } from "../utils/types.js";
11
+ import { useFullScreenContext as It } from "../contexts/FullScreenContext.js";
12
+ import { c as ue } from "../clsx-0c6e471a.js";
13
+ import { DualPage as Tt } from "./page/DualPage.js";
14
+ import { DualPageWithCover as xt } from "./page/DualPageWithCover.js";
15
+ import { SinglePage as Rt } from "./page/SinglePage.js";
16
+ import { useMousePressed as yt } from "../utils/hooks/useMousePressed.js";
17
+ import { useSelectionModeContext as bt } from "../contexts/SelectionModeContext.js";
18
+ import { useGrabScroll as Lt } from "../utils/hooks/useGrabScroll.js";
19
+ import { usePinch as zt } from "../utils/hooks/usePinch.js";
20
+ import { useInitialStateContext as Mt } from "../contexts/InitialStateContext.js";
21
+ import { useLayoutContainer as Et } from "../contexts/LayoutContainerContext.js";
22
+ import { useDebounce as Ot } from "../utils/hooks/useDebounce.js";
23
+ import { useLoaderContext as Wt } from "../contexts/LoaderContext.js";
24
+ import Pt from "./ui/PasswordModal.js";
25
+ import { usePresentPage as At } from "../utils/hooks/usePresentPage.js";
26
+ import { getPageFromPosition as Nt } from "../utils/calculatePage.js";
27
+ import { useDocumentPasswordContext as Ft } from "../contexts/DocumentPasswordContext.js";
28
+ import { LayoutContainer as Dt } from "./layout/LayoutContainer.js";
29
+ import { LayoutWrapper as Ht } from "./layout/LayoutWrapper.js";
30
+ import { useEventCallbackContext as kt } from "../contexts/EventCallbackContext.js";
31
+ import { useCopyText as Ut } from "../utils/hooks/useCopyText.js";
32
+ import { useTextSelection as Vt } from "../utils/hooks/useTextSelection.js";
33
+ import { OutputScale as qt } from "pdfjs-dist";
34
34
  import { approximateFraction as Ae } from "../utils/approximateFragtion.js";
35
35
  import "./page/CanvasLayer.js";
36
36
  import "../contexts/ZoomContext.js";
@@ -90,7 +90,7 @@ import "../RPLayout.module-b4b23e29.js";
90
90
  import "../contexts/ThemeContext.js";
91
91
  import "../contexts/DarkModeContext.js";
92
92
  import "../utils/hooks/useDarkMode.js";
93
- const U = {
93
+ const k = {
94
94
  "rp-pages": "_rp-pages_1muxf_1",
95
95
  "rp-page-scrolling-wrapper": "_rp-page-scrolling-wrapper_1muxf_6",
96
96
  "rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_1muxf_11",
@@ -103,54 +103,54 @@ const U = {
103
103
  "rp-not-supported": "_rp-not-supported_1muxf_15",
104
104
  "rp-not-supported-content": "_rp-not-supported-content_1muxf_102"
105
105
  };
106
- function ze() {
107
- return ze = Object.assign ? Object.assign.bind() : function(n) {
106
+ function Me() {
107
+ return Me = Object.assign ? Object.assign.bind() : function(n) {
108
108
  for (var e = 1; e < arguments.length; e++) {
109
109
  var t = arguments[e];
110
110
  for (var r in t)
111
111
  ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
112
112
  }
113
113
  return n;
114
- }, ze.apply(null, arguments);
114
+ }, Me.apply(null, arguments);
115
115
  }
116
116
  function Ne(n) {
117
117
  if (n === void 0)
118
118
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
119
119
  return n;
120
120
  }
121
- function Me(n, e) {
122
- return Me = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, r) {
121
+ function Ee(n, e) {
122
+ return Ee = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, r) {
123
123
  return t.__proto__ = r, t;
124
- }, Me(n, e);
124
+ }, Ee(n, e);
125
125
  }
126
- function Ut(n, e) {
127
- n.prototype = Object.create(e.prototype), n.prototype.constructor = n, Me(n, e);
126
+ function Gt(n, e) {
127
+ n.prototype = Object.create(e.prototype), n.prototype.constructor = n, Ee(n, e);
128
128
  }
129
- var Pe = Number.isNaN || function(e) {
129
+ var Fe = Number.isNaN || function(e) {
130
130
  return typeof e == "number" && e !== e;
131
131
  };
132
- function Vt(n, e) {
133
- return !!(n === e || Pe(n) && Pe(e));
132
+ function $t(n, e) {
133
+ return !!(n === e || Fe(n) && Fe(e));
134
134
  }
135
- function qt(n, e) {
135
+ function jt(n, e) {
136
136
  if (n.length !== e.length)
137
137
  return !1;
138
138
  for (var t = 0; t < n.length; t++)
139
- if (!Vt(n[t], e[t]))
139
+ if (!$t(n[t], e[t]))
140
140
  return !1;
141
141
  return !0;
142
142
  }
143
- function Re(n, e) {
144
- e === void 0 && (e = qt);
143
+ function ye(n, e) {
144
+ e === void 0 && (e = jt);
145
145
  var t, r = [], s, l = !1;
146
146
  function a() {
147
- for (var c = [], f = 0; f < arguments.length; f++)
148
- c[f] = arguments[f];
147
+ for (var c = [], d = 0; d < arguments.length; d++)
148
+ c[d] = arguments[d];
149
149
  return l && t === this && e(c, r) || (s = n.apply(this, c), l = !0, t = this, r = c), s;
150
150
  }
151
151
  return a;
152
152
  }
153
- function Fe(n, e) {
153
+ function De(n, e) {
154
154
  if (n == null)
155
155
  return {};
156
156
  var t = {};
@@ -162,56 +162,56 @@ function Fe(n, e) {
162
162
  }
163
163
  return t;
164
164
  }
165
- var Gt = typeof performance == "object" && typeof performance.now == "function", De = Gt ? function() {
165
+ var Bt = typeof performance == "object" && typeof performance.now == "function", He = Bt ? function() {
166
166
  return performance.now();
167
167
  } : function() {
168
168
  return Date.now();
169
169
  };
170
- function He(n) {
170
+ function ke(n) {
171
171
  cancelAnimationFrame(n.id);
172
172
  }
173
- function $t(n, e) {
174
- var t = De();
173
+ function Kt(n, e) {
174
+ var t = He();
175
175
  function r() {
176
- De() - t >= e ? n.call(null) : s.id = requestAnimationFrame(r);
176
+ He() - t >= e ? n.call(null) : s.id = requestAnimationFrame(r);
177
177
  }
178
178
  var s = {
179
179
  id: requestAnimationFrame(r)
180
180
  };
181
181
  return s;
182
182
  }
183
- var ye = -1;
184
- function jt(n) {
185
- if (n === void 0 && (n = !1), ye === -1 || n) {
183
+ var be = -1;
184
+ function Zt(n) {
185
+ if (n === void 0 && (n = !1), be === -1 || n) {
186
186
  var e = document.createElement("div"), t = e.style;
187
- t.width = "50px", t.height = "50px", t.overflow = "scroll", document.body.appendChild(e), ye = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
187
+ t.width = "50px", t.height = "50px", t.overflow = "scroll", document.body.appendChild(e), be = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
188
188
  }
189
- return ye;
189
+ return be;
190
190
  }
191
- var se = null;
192
- function ke(n) {
193
- if (n === void 0 && (n = !1), se === null || n) {
191
+ var oe = null;
192
+ function Ue(n) {
193
+ if (n === void 0 && (n = !1), oe === null || n) {
194
194
  var e = document.createElement("div"), t = e.style;
195
195
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
196
196
  var r = document.createElement("div"), s = r.style;
197
- return s.width = "100px", s.height = "100px", e.appendChild(r), document.body.appendChild(e), e.scrollLeft > 0 ? se = "positive-descending" : (e.scrollLeft = 1, e.scrollLeft === 0 ? se = "negative" : se = "positive-ascending"), document.body.removeChild(e), se;
197
+ return s.width = "100px", s.height = "100px", e.appendChild(r), document.body.appendChild(e), e.scrollLeft > 0 ? oe = "positive-descending" : (e.scrollLeft = 1, e.scrollLeft === 0 ? oe = "negative" : oe = "positive-ascending"), document.body.removeChild(e), oe;
198
198
  }
199
- return se;
199
+ return oe;
200
200
  }
201
- var Bt = 150, Kt = function(e) {
201
+ var Jt = 150, Qt = function(e) {
202
202
  var t = e.columnIndex;
203
203
  e.data;
204
204
  var r = e.rowIndex;
205
205
  return r + ":" + t;
206
- }, de = null, fe = null, me = null;
207
- process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (de = /* @__PURE__ */ new WeakSet(), fe = /* @__PURE__ */ new WeakSet(), me = /* @__PURE__ */ new WeakSet());
208
- function Zt(n) {
209
- var e, t = n.getColumnOffset, r = n.getColumnStartIndexForOffset, s = n.getColumnStopIndexForStartIndex, l = n.getColumnWidth, a = n.getEstimatedTotalHeight, c = n.getEstimatedTotalWidth, f = n.getOffsetForColumnAndAlignment, g = n.getOffsetForRowAndAlignment, h = n.getRowHeight, w = n.getRowOffset, i = n.getRowStartIndexForOffset, L = n.getRowStopIndexForStartIndex, C = n.initInstanceProps, S = n.shouldResetStyleCacheOnItemSizeChange, D = n.validateProps;
210
- return e = /* @__PURE__ */ function(z) {
211
- Ut(T, z);
212
- function T(A) {
206
+ }, fe = null, me = null, pe = null;
207
+ process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (fe = /* @__PURE__ */ new WeakSet(), me = /* @__PURE__ */ new WeakSet(), pe = /* @__PURE__ */ new WeakSet());
208
+ function Xt(n) {
209
+ var e, t = n.getColumnOffset, r = n.getColumnStartIndexForOffset, s = n.getColumnStopIndexForStartIndex, l = n.getColumnWidth, a = n.getEstimatedTotalHeight, c = n.getEstimatedTotalWidth, d = n.getOffsetForColumnAndAlignment, g = n.getOffsetForRowAndAlignment, h = n.getRowHeight, C = n.getRowOffset, i = n.getRowStartIndexForOffset, z = n.getRowStopIndexForStartIndex, S = n.initInstanceProps, I = n.shouldResetStyleCacheOnItemSizeChange, D = n.validateProps;
210
+ return e = /* @__PURE__ */ function(M) {
211
+ Gt(y, M);
212
+ function y(P) {
213
213
  var o;
214
- return o = z.call(this, A) || this, o._instanceProps = C(o.props, Ne(o)), o._resetIsScrollingTimeoutId = null, o._outerRef = void 0, o.state = {
214
+ return o = M.call(this, P) || this, o._instanceProps = S(o.props, Ne(o)), o._resetIsScrollingTimeoutId = null, o._outerRef = void 0, o.state = {
215
215
  instance: Ne(o),
216
216
  isScrolling: !1,
217
217
  horizontalScrollDirection: "forward",
@@ -219,74 +219,74 @@ function Zt(n) {
219
219
  scrollTop: typeof o.props.initialScrollTop == "number" ? o.props.initialScrollTop : 0,
220
220
  scrollUpdateWasRequested: !1,
221
221
  verticalScrollDirection: "forward"
222
- }, o._callOnItemsRendered = void 0, o._callOnItemsRendered = Re(function(u, d, m, I, p, x, R, E) {
222
+ }, o._callOnItemsRendered = void 0, o._callOnItemsRendered = ye(function(f, u, m, _, p, T, O, W) {
223
223
  return o.props.onItemsRendered({
224
- overscanColumnStartIndex: u,
225
- overscanColumnStopIndex: d,
224
+ overscanColumnStartIndex: f,
225
+ overscanColumnStopIndex: u,
226
226
  overscanRowStartIndex: m,
227
- overscanRowStopIndex: I,
227
+ overscanRowStopIndex: _,
228
228
  visibleColumnStartIndex: p,
229
- visibleColumnStopIndex: x,
230
- visibleRowStartIndex: R,
231
- visibleRowStopIndex: E
229
+ visibleColumnStopIndex: T,
230
+ visibleRowStartIndex: O,
231
+ visibleRowStopIndex: W
232
232
  });
233
- }), o._callOnScroll = void 0, o._callOnScroll = Re(function(u, d, m, I, p) {
233
+ }), o._callOnScroll = void 0, o._callOnScroll = ye(function(f, u, m, _, p) {
234
234
  return o.props.onScroll({
235
235
  horizontalScrollDirection: m,
236
- scrollLeft: u,
237
- scrollTop: d,
238
- verticalScrollDirection: I,
236
+ scrollLeft: f,
237
+ scrollTop: u,
238
+ verticalScrollDirection: _,
239
239
  scrollUpdateWasRequested: p
240
240
  });
241
- }), o._getItemStyle = void 0, o._getItemStyle = function(u, d) {
242
- var m = o.props, I = m.columnWidth, p = m.direction, x = m.rowHeight, R = o._getItemStyleCache(S && I, S && p, S && x), E = u + ":" + d, O;
243
- if (R.hasOwnProperty(E))
244
- O = R[E];
241
+ }), o._getItemStyle = void 0, o._getItemStyle = function(f, u) {
242
+ var m = o.props, _ = m.columnWidth, p = m.direction, T = m.rowHeight, O = o._getItemStyleCache(I && _, I && p, I && T), W = f + ":" + u, x;
243
+ if (O.hasOwnProperty(W))
244
+ x = O[W];
245
245
  else {
246
- var W = t(o.props, d, o._instanceProps), y = p === "rtl";
247
- R[E] = O = {
246
+ var b = t(o.props, u, o._instanceProps), R = p === "rtl";
247
+ O[W] = x = {
248
248
  position: "absolute",
249
- left: y ? void 0 : W,
250
- right: y ? W : void 0,
251
- top: w(o.props, u, o._instanceProps),
252
- height: h(o.props, u, o._instanceProps),
253
- width: l(o.props, d, o._instanceProps)
249
+ left: R ? void 0 : b,
250
+ right: R ? b : void 0,
251
+ top: C(o.props, f, o._instanceProps),
252
+ height: h(o.props, f, o._instanceProps),
253
+ width: l(o.props, u, o._instanceProps)
254
254
  };
255
255
  }
256
- return O;
257
- }, o._getItemStyleCache = void 0, o._getItemStyleCache = Re(function(u, d, m) {
256
+ return x;
257
+ }, o._getItemStyleCache = void 0, o._getItemStyleCache = ye(function(f, u, m) {
258
258
  return {};
259
- }), o._onScroll = function(u) {
260
- var d = u.currentTarget, m = d.clientHeight, I = d.clientWidth, p = d.scrollLeft, x = d.scrollTop, R = d.scrollHeight, E = d.scrollWidth;
261
- o.setState(function(O) {
262
- if (O.scrollLeft === p && O.scrollTop === x)
259
+ }), o._onScroll = function(f) {
260
+ var u = f.currentTarget, m = u.clientHeight, _ = u.clientWidth, p = u.scrollLeft, T = u.scrollTop, O = u.scrollHeight, W = u.scrollWidth;
261
+ o.setState(function(x) {
262
+ if (x.scrollLeft === p && x.scrollTop === T)
263
263
  return null;
264
- var W = o.props.direction, y = p;
265
- if (W === "rtl")
266
- switch (ke()) {
264
+ var b = o.props.direction, R = p;
265
+ if (b === "rtl")
266
+ switch (Ue()) {
267
267
  case "negative":
268
- y = -p;
268
+ R = -p;
269
269
  break;
270
270
  case "positive-descending":
271
- y = E - I - p;
271
+ R = W - _ - p;
272
272
  break;
273
273
  }
274
- y = Math.max(0, Math.min(y, E - I));
275
- var F = Math.max(0, Math.min(x, R - m));
274
+ R = Math.max(0, Math.min(R, W - _));
275
+ var A = Math.max(0, Math.min(T, O - m));
276
276
  return {
277
277
  isScrolling: !0,
278
- horizontalScrollDirection: O.scrollLeft < p ? "forward" : "backward",
279
- scrollLeft: y,
280
- scrollTop: F,
281
- verticalScrollDirection: O.scrollTop < x ? "forward" : "backward",
278
+ horizontalScrollDirection: x.scrollLeft < p ? "forward" : "backward",
279
+ scrollLeft: R,
280
+ scrollTop: A,
281
+ verticalScrollDirection: x.scrollTop < T ? "forward" : "backward",
282
282
  scrollUpdateWasRequested: !1
283
283
  };
284
284
  }, o._resetIsScrollingDebounced);
285
- }, o._outerRefSetter = function(u) {
286
- var d = o.props.outerRef;
287
- o._outerRef = u, typeof d == "function" ? d(u) : d != null && typeof d == "object" && d.hasOwnProperty("current") && (d.current = u);
285
+ }, o._outerRefSetter = function(f) {
286
+ var u = o.props.outerRef;
287
+ o._outerRef = f, typeof u == "function" ? u(f) : u != null && typeof u == "object" && u.hasOwnProperty("current") && (u.current = f);
288
288
  }, o._resetIsScrollingDebounced = function() {
289
- o._resetIsScrollingTimeoutId !== null && He(o._resetIsScrollingTimeoutId), o._resetIsScrollingTimeoutId = $t(o._resetIsScrolling, Bt);
289
+ o._resetIsScrollingTimeoutId !== null && ke(o._resetIsScrollingTimeoutId), o._resetIsScrollingTimeoutId = Kt(o._resetIsScrolling, Jt);
290
290
  }, o._resetIsScrolling = function() {
291
291
  o._resetIsScrollingTimeoutId = null, o.setState({
292
292
  isScrolling: !1
@@ -295,133 +295,133 @@ function Zt(n) {
295
295
  });
296
296
  }, o;
297
297
  }
298
- T.getDerivedStateFromProps = function(o, u) {
299
- return Jt(o, u), D(o), null;
298
+ y.getDerivedStateFromProps = function(o, f) {
299
+ return Yt(o, f), D(o), null;
300
300
  };
301
- var M = T.prototype;
302
- return M.scrollTo = function(o) {
303
- var u = o.scrollLeft, d = o.scrollTop;
304
- u !== void 0 && (u = Math.max(0, u)), d !== void 0 && (d = Math.max(0, d)), this.setState(function(m) {
305
- return u === void 0 && (u = m.scrollLeft), d === void 0 && (d = m.scrollTop), m.scrollLeft === u && m.scrollTop === d ? null : {
306
- horizontalScrollDirection: m.scrollLeft < u ? "forward" : "backward",
307
- scrollLeft: u,
308
- scrollTop: d,
301
+ var E = y.prototype;
302
+ return E.scrollTo = function(o) {
303
+ var f = o.scrollLeft, u = o.scrollTop;
304
+ f !== void 0 && (f = Math.max(0, f)), u !== void 0 && (u = Math.max(0, u)), this.setState(function(m) {
305
+ return f === void 0 && (f = m.scrollLeft), u === void 0 && (u = m.scrollTop), m.scrollLeft === f && m.scrollTop === u ? null : {
306
+ horizontalScrollDirection: m.scrollLeft < f ? "forward" : "backward",
307
+ scrollLeft: f,
308
+ scrollTop: u,
309
309
  scrollUpdateWasRequested: !0,
310
- verticalScrollDirection: m.scrollTop < d ? "forward" : "backward"
310
+ verticalScrollDirection: m.scrollTop < u ? "forward" : "backward"
311
311
  };
312
312
  }, this._resetIsScrollingDebounced);
313
- }, M.scrollToItem = function(o) {
314
- var u = o.align, d = u === void 0 ? "auto" : u, m = o.columnIndex, I = o.rowIndex, p = this.props, x = p.columnCount, R = p.height, E = p.rowCount, O = p.width, W = this.state, y = W.scrollLeft, F = W.scrollTop, P = jt();
315
- m !== void 0 && (m = Math.max(0, Math.min(m, x - 1))), I !== void 0 && (I = Math.max(0, Math.min(I, E - 1)));
316
- var H = a(this.props, this._instanceProps), N = c(this.props, this._instanceProps), k = N > O ? P : 0, Z = H > R ? P : 0;
313
+ }, E.scrollToItem = function(o) {
314
+ var f = o.align, u = f === void 0 ? "auto" : f, m = o.columnIndex, _ = o.rowIndex, p = this.props, T = p.columnCount, O = p.height, W = p.rowCount, x = p.width, b = this.state, R = b.scrollLeft, A = b.scrollTop, H = Zt();
315
+ m !== void 0 && (m = Math.max(0, Math.min(m, T - 1))), _ !== void 0 && (_ = Math.max(0, Math.min(_, W - 1)));
316
+ var U = a(this.props, this._instanceProps), N = c(this.props, this._instanceProps), G = N > x ? H : 0, F = U > O ? H : 0;
317
317
  this.scrollTo({
318
- scrollLeft: m !== void 0 ? f(this.props, m, d, y, this._instanceProps, Z) : y,
319
- scrollTop: I !== void 0 ? g(this.props, I, d, F, this._instanceProps, k) : F
318
+ scrollLeft: m !== void 0 ? d(this.props, m, u, R, this._instanceProps, F) : R,
319
+ scrollTop: _ !== void 0 ? g(this.props, _, u, A, this._instanceProps, G) : A
320
320
  });
321
- }, M.componentDidMount = function() {
322
- var o = this.props, u = o.initialScrollLeft, d = o.initialScrollTop;
321
+ }, E.componentDidMount = function() {
322
+ var o = this.props, f = o.initialScrollLeft, u = o.initialScrollTop;
323
323
  if (this._outerRef != null) {
324
324
  var m = this._outerRef;
325
- typeof u == "number" && (m.scrollLeft = u), typeof d == "number" && (m.scrollTop = d);
325
+ typeof f == "number" && (m.scrollLeft = f), typeof u == "number" && (m.scrollTop = u);
326
326
  }
327
327
  this._callPropsCallbacks();
328
- }, M.componentDidUpdate = function() {
329
- var o = this.props.direction, u = this.state, d = u.scrollLeft, m = u.scrollTop, I = u.scrollUpdateWasRequested;
330
- if (I && this._outerRef != null) {
328
+ }, E.componentDidUpdate = function() {
329
+ var o = this.props.direction, f = this.state, u = f.scrollLeft, m = f.scrollTop, _ = f.scrollUpdateWasRequested;
330
+ if (_ && this._outerRef != null) {
331
331
  var p = this._outerRef;
332
332
  if (o === "rtl")
333
- switch (ke()) {
333
+ switch (Ue()) {
334
334
  case "negative":
335
- p.scrollLeft = -d;
335
+ p.scrollLeft = -u;
336
336
  break;
337
337
  case "positive-ascending":
338
- p.scrollLeft = d;
338
+ p.scrollLeft = u;
339
339
  break;
340
340
  default:
341
- var x = p.clientWidth, R = p.scrollWidth;
342
- p.scrollLeft = R - x - d;
341
+ var T = p.clientWidth, O = p.scrollWidth;
342
+ p.scrollLeft = O - T - u;
343
343
  break;
344
344
  }
345
345
  else
346
- p.scrollLeft = Math.max(0, d);
346
+ p.scrollLeft = Math.max(0, u);
347
347
  p.scrollTop = Math.max(0, m);
348
348
  }
349
349
  this._callPropsCallbacks();
350
- }, M.componentWillUnmount = function() {
351
- this._resetIsScrollingTimeoutId !== null && He(this._resetIsScrollingTimeoutId);
352
- }, M.render = function() {
353
- var o = this.props, u = o.children, d = o.className, m = o.columnCount, I = o.direction, p = o.height, x = o.innerRef, R = o.innerElementType, E = o.innerTagName, O = o.itemData, W = o.itemKey, y = W === void 0 ? Kt : W, F = o.outerElementType, P = o.outerTagName, H = o.rowCount, N = o.style, k = o.useIsScrolling, Z = o.width, J = this.state.isScrolling, Q = this._getHorizontalRangeToRender(), ie = Q[0], j = Q[1], le = this._getVerticalRangeToRender(), X = le[0], Y = le[1], ee = [];
354
- if (m > 0 && H)
355
- for (var B = X; B <= Y; B++)
356
- for (var K = ie; K <= j; K++)
357
- ee.push(ue(u, {
358
- columnIndex: K,
359
- data: O,
360
- isScrolling: k ? J : void 0,
361
- key: y({
362
- columnIndex: K,
363
- data: O,
364
- rowIndex: B
350
+ }, E.componentWillUnmount = function() {
351
+ this._resetIsScrollingTimeoutId !== null && ke(this._resetIsScrollingTimeoutId);
352
+ }, E.render = function() {
353
+ var o = this.props, f = o.children, u = o.className, m = o.columnCount, _ = o.direction, p = o.height, T = o.innerRef, O = o.innerElementType, W = o.innerTagName, x = o.itemData, b = o.itemKey, R = b === void 0 ? Qt : b, A = o.outerElementType, H = o.outerTagName, U = o.rowCount, N = o.style, G = o.useIsScrolling, F = o.width, V = this.state.isScrolling, te = this._getHorizontalRangeToRender(), re = te[0], ae = te[1], ne = this._getVerticalRangeToRender(), J = ne[0], he = ne[1], Q = [];
354
+ if (m > 0 && U)
355
+ for (var $ = J; $ <= he; $++)
356
+ for (var j = re; j <= ae; j++)
357
+ Q.push(de(f, {
358
+ columnIndex: j,
359
+ data: x,
360
+ isScrolling: G ? V : void 0,
361
+ key: R({
362
+ columnIndex: j,
363
+ data: x,
364
+ rowIndex: $
365
365
  }),
366
- rowIndex: B,
367
- style: this._getItemStyle(B, K)
366
+ rowIndex: $,
367
+ style: this._getItemStyle($, j)
368
368
  }));
369
- var pe = a(this.props, this._instanceProps), te = c(this.props, this._instanceProps);
370
- return ue(F || P || "div", {
371
- className: d,
369
+ var le = a(this.props, this._instanceProps), ce = c(this.props, this._instanceProps);
370
+ return de(A || H || "div", {
371
+ className: u,
372
372
  onScroll: this._onScroll,
373
373
  ref: this._outerRefSetter,
374
- style: ze({
374
+ style: Me({
375
375
  position: "relative",
376
376
  height: p,
377
- width: Z,
377
+ width: F,
378
378
  overflow: "auto",
379
379
  WebkitOverflowScrolling: "touch",
380
380
  willChange: "transform",
381
- direction: I
381
+ direction: _
382
382
  }, N)
383
- }, ue(R || E || "div", {
384
- children: ee,
385
- ref: x,
383
+ }, de(O || W || "div", {
384
+ children: Q,
385
+ ref: T,
386
386
  style: {
387
- height: pe,
388
- pointerEvents: J ? "none" : void 0,
389
- width: te
387
+ height: le,
388
+ pointerEvents: V ? "none" : void 0,
389
+ width: ce
390
390
  }
391
391
  }));
392
- }, M._callPropsCallbacks = function() {
393
- var o = this.props, u = o.columnCount, d = o.onItemsRendered, m = o.onScroll, I = o.rowCount;
394
- if (typeof d == "function" && u > 0 && I > 0) {
395
- var p = this._getHorizontalRangeToRender(), x = p[0], R = p[1], E = p[2], O = p[3], W = this._getVerticalRangeToRender(), y = W[0], F = W[1], P = W[2], H = W[3];
396
- this._callOnItemsRendered(x, R, y, F, E, O, P, H);
392
+ }, E._callPropsCallbacks = function() {
393
+ var o = this.props, f = o.columnCount, u = o.onItemsRendered, m = o.onScroll, _ = o.rowCount;
394
+ if (typeof u == "function" && f > 0 && _ > 0) {
395
+ var p = this._getHorizontalRangeToRender(), T = p[0], O = p[1], W = p[2], x = p[3], b = this._getVerticalRangeToRender(), R = b[0], A = b[1], H = b[2], U = b[3];
396
+ this._callOnItemsRendered(T, O, R, A, W, x, H, U);
397
397
  }
398
398
  if (typeof m == "function") {
399
- var N = this.state, k = N.horizontalScrollDirection, Z = N.scrollLeft, J = N.scrollTop, Q = N.scrollUpdateWasRequested, ie = N.verticalScrollDirection;
400
- this._callOnScroll(Z, J, k, ie, Q);
399
+ var N = this.state, G = N.horizontalScrollDirection, F = N.scrollLeft, V = N.scrollTop, te = N.scrollUpdateWasRequested, re = N.verticalScrollDirection;
400
+ this._callOnScroll(F, V, G, re, te);
401
401
  }
402
- }, M._getHorizontalRangeToRender = function() {
403
- var o = this.props, u = o.columnCount, d = o.overscanColumnCount, m = o.overscanColumnsCount, I = o.overscanCount, p = o.rowCount, x = this.state, R = x.horizontalScrollDirection, E = x.isScrolling, O = x.scrollLeft, W = d || m || I || 1;
404
- if (u === 0 || p === 0)
402
+ }, E._getHorizontalRangeToRender = function() {
403
+ var o = this.props, f = o.columnCount, u = o.overscanColumnCount, m = o.overscanColumnsCount, _ = o.overscanCount, p = o.rowCount, T = this.state, O = T.horizontalScrollDirection, W = T.isScrolling, x = T.scrollLeft, b = u || m || _ || 1;
404
+ if (f === 0 || p === 0)
405
405
  return [0, 0, 0, 0];
406
- var y = r(this.props, O, this._instanceProps), F = s(this.props, y, O, this._instanceProps), P = !E || R === "backward" ? Math.max(1, W) : 1, H = !E || R === "forward" ? Math.max(1, W) : 1;
407
- return [Math.max(0, y - P), Math.max(0, Math.min(u - 1, F + H)), y, F];
408
- }, M._getVerticalRangeToRender = function() {
409
- var o = this.props, u = o.columnCount, d = o.overscanCount, m = o.overscanRowCount, I = o.overscanRowsCount, p = o.rowCount, x = this.state, R = x.isScrolling, E = x.verticalScrollDirection, O = x.scrollTop, W = m || I || d || 1;
410
- if (u === 0 || p === 0)
406
+ var R = r(this.props, x, this._instanceProps), A = s(this.props, R, x, this._instanceProps), H = !W || O === "backward" ? Math.max(1, b) : 1, U = !W || O === "forward" ? Math.max(1, b) : 1;
407
+ return [Math.max(0, R - H), Math.max(0, Math.min(f - 1, A + U)), R, A];
408
+ }, E._getVerticalRangeToRender = function() {
409
+ var o = this.props, f = o.columnCount, u = o.overscanCount, m = o.overscanRowCount, _ = o.overscanRowsCount, p = o.rowCount, T = this.state, O = T.isScrolling, W = T.verticalScrollDirection, x = T.scrollTop, b = m || _ || u || 1;
410
+ if (f === 0 || p === 0)
411
411
  return [0, 0, 0, 0];
412
- var y = i(this.props, O, this._instanceProps), F = L(this.props, y, O, this._instanceProps), P = !R || E === "backward" ? Math.max(1, W) : 1, H = !R || E === "forward" ? Math.max(1, W) : 1;
413
- return [Math.max(0, y - P), Math.max(0, Math.min(p - 1, F + H)), y, F];
414
- }, T;
415
- }(at), e.defaultProps = {
412
+ var R = i(this.props, x, this._instanceProps), A = z(this.props, R, x, this._instanceProps), H = !O || W === "backward" ? Math.max(1, b) : 1, U = !O || W === "forward" ? Math.max(1, b) : 1;
413
+ return [Math.max(0, R - H), Math.max(0, Math.min(p - 1, A + U)), R, A];
414
+ }, y;
415
+ }(ct), e.defaultProps = {
416
416
  direction: "ltr",
417
417
  itemData: void 0,
418
418
  useIsScrolling: !1
419
419
  }, e;
420
420
  }
421
- var Jt = function(e, t) {
422
- var r = e.children, s = e.direction, l = e.height, a = e.innerTagName, c = e.outerTagName, f = e.overscanColumnsCount, g = e.overscanCount, h = e.overscanRowsCount, w = e.width, i = t.instance;
421
+ var Yt = function(e, t) {
422
+ var r = e.children, s = e.direction, l = e.height, a = e.innerTagName, c = e.outerTagName, d = e.overscanColumnsCount, g = e.overscanCount, h = e.overscanRowsCount, C = e.width, i = t.instance;
423
423
  if (process.env.NODE_ENV !== "production") {
424
- if (typeof g == "number" && de && !de.has(i) && (de.add(i), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof f == "number" || typeof h == "number") && fe && !fe.has(i) && (fe.add(i), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (a != null || c != null) && me && !me.has(i) && (me.add(i), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
424
+ if (typeof g == "number" && fe && !fe.has(i) && (fe.add(i), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof d == "number" || typeof h == "number") && me && !me.has(i) && (me.add(i), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (a != null || c != null) && pe && !pe.has(i) && (pe.add(i), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
425
425
  throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
426
426
  switch (s) {
427
427
  case "ltr":
@@ -430,134 +430,134 @@ var Jt = function(e, t) {
430
430
  default:
431
431
  throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + s + '" was specified.'));
432
432
  }
433
- if (typeof w != "number")
434
- throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (w === null ? "null" : typeof w) + '" was specified.'));
433
+ if (typeof C != "number")
434
+ throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (C === null ? "null" : typeof C) + '" was specified.'));
435
435
  if (typeof l != "number")
436
436
  throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (l === null ? "null" : typeof l) + '" was specified.'));
437
437
  }
438
- }, Ue = 50, Ke = function(e, t) {
438
+ }, Ve = 50, Ze = function(e, t) {
439
439
  var r = e.rowCount, s = t.rowMetadataMap, l = t.estimatedRowHeight, a = t.lastMeasuredRowIndex, c = 0;
440
440
  if (a >= r && (a = r - 1), a >= 0) {
441
- var f = s[a];
442
- c = f.offset + f.size;
441
+ var d = s[a];
442
+ c = d.offset + d.size;
443
443
  }
444
444
  var g = r - a - 1, h = g * l;
445
445
  return c + h;
446
- }, Ze = function(e, t) {
446
+ }, Je = function(e, t) {
447
447
  var r = e.columnCount, s = t.columnMetadataMap, l = t.estimatedColumnWidth, a = t.lastMeasuredColumnIndex, c = 0;
448
448
  if (a >= r && (a = r - 1), a >= 0) {
449
- var f = s[a];
450
- c = f.offset + f.size;
449
+ var d = s[a];
450
+ c = d.offset + d.size;
451
451
  }
452
452
  var g = r - a - 1, h = g * l;
453
453
  return c + h;
454
- }, $ = function(e, t, r, s) {
454
+ }, Z = function(e, t, r, s) {
455
455
  var l, a, c;
456
456
  if (e === "column" ? (l = s.columnMetadataMap, a = t.columnWidth, c = s.lastMeasuredColumnIndex) : (l = s.rowMetadataMap, a = t.rowHeight, c = s.lastMeasuredRowIndex), r > c) {
457
- var f = 0;
457
+ var d = 0;
458
458
  if (c >= 0) {
459
459
  var g = l[c];
460
- f = g.offset + g.size;
460
+ d = g.offset + g.size;
461
461
  }
462
462
  for (var h = c + 1; h <= r; h++) {
463
- var w = a(h);
463
+ var C = a(h);
464
464
  l[h] = {
465
- offset: f,
466
- size: w
467
- }, f += w;
465
+ offset: d,
466
+ size: C
467
+ }, d += C;
468
468
  }
469
469
  e === "column" ? s.lastMeasuredColumnIndex = r : s.lastMeasuredRowIndex = r;
470
470
  }
471
471
  return l[r];
472
- }, Ve = function(e, t, r, s) {
472
+ }, qe = function(e, t, r, s) {
473
473
  var l, a;
474
474
  e === "column" ? (l = r.columnMetadataMap, a = r.lastMeasuredColumnIndex) : (l = r.rowMetadataMap, a = r.lastMeasuredRowIndex);
475
475
  var c = a > 0 ? l[a].offset : 0;
476
- return c >= s ? Je(e, t, r, a, 0, s) : Qt(e, t, r, Math.max(0, a), s);
477
- }, Je = function(e, t, r, s, l, a) {
476
+ return c >= s ? Qe(e, t, r, a, 0, s) : er(e, t, r, Math.max(0, a), s);
477
+ }, Qe = function(e, t, r, s, l, a) {
478
478
  for (; l <= s; ) {
479
- var c = l + Math.floor((s - l) / 2), f = $(e, t, c, r).offset;
480
- if (f === a)
479
+ var c = l + Math.floor((s - l) / 2), d = Z(e, t, c, r).offset;
480
+ if (d === a)
481
481
  return c;
482
- f < a ? l = c + 1 : f > a && (s = c - 1);
482
+ d < a ? l = c + 1 : d > a && (s = c - 1);
483
483
  }
484
484
  return l > 0 ? l - 1 : 0;
485
- }, Qt = function(e, t, r, s, l) {
486
- for (var a = e === "column" ? t.columnCount : t.rowCount, c = 1; s < a && $(e, t, s, r).offset < l; )
485
+ }, er = function(e, t, r, s, l) {
486
+ for (var a = e === "column" ? t.columnCount : t.rowCount, c = 1; s < a && Z(e, t, s, r).offset < l; )
487
487
  s += c, c *= 2;
488
- return Je(e, t, r, Math.min(s, a - 1), Math.floor(s / 2), l);
489
- }, qe = function(e, t, r, s, l, a, c) {
490
- var f = e === "column" ? t.width : t.height, g = $(e, t, r, a), h = e === "column" ? Ze(t, a) : Ke(t, a), w = Math.max(0, Math.min(h - f, g.offset)), i = Math.max(0, g.offset - f + c + g.size);
491
- switch (s === "smart" && (l >= i - f && l <= w + f ? s = "auto" : s = "center"), s) {
488
+ return Qe(e, t, r, Math.min(s, a - 1), Math.floor(s / 2), l);
489
+ }, Ge = function(e, t, r, s, l, a, c) {
490
+ var d = e === "column" ? t.width : t.height, g = Z(e, t, r, a), h = e === "column" ? Je(t, a) : Ze(t, a), C = Math.max(0, Math.min(h - d, g.offset)), i = Math.max(0, g.offset - d + c + g.size);
491
+ switch (s === "smart" && (l >= i - d && l <= C + d ? s = "auto" : s = "center"), s) {
492
492
  case "start":
493
- return w;
493
+ return C;
494
494
  case "end":
495
495
  return i;
496
496
  case "center":
497
- return Math.round(i + (w - i) / 2);
497
+ return Math.round(i + (C - i) / 2);
498
498
  case "auto":
499
499
  default:
500
- return l >= i && l <= w ? l : i > w || l < i ? i : w;
500
+ return l >= i && l <= C ? l : i > C || l < i ? i : C;
501
501
  }
502
- }, Xt = /* @__PURE__ */ Zt({
502
+ }, tr = /* @__PURE__ */ Xt({
503
503
  getColumnOffset: function(e, t, r) {
504
- return $("column", e, t, r).offset;
504
+ return Z("column", e, t, r).offset;
505
505
  },
506
506
  getColumnStartIndexForOffset: function(e, t, r) {
507
- return Ve("column", e, r, t);
507
+ return qe("column", e, r, t);
508
508
  },
509
509
  getColumnStopIndexForStartIndex: function(e, t, r, s) {
510
- for (var l = e.columnCount, a = e.width, c = $("column", e, t, s), f = r + a, g = c.offset + c.size, h = t; h < l - 1 && g < f; )
511
- h++, g += $("column", e, h, s).size;
510
+ for (var l = e.columnCount, a = e.width, c = Z("column", e, t, s), d = r + a, g = c.offset + c.size, h = t; h < l - 1 && g < d; )
511
+ h++, g += Z("column", e, h, s).size;
512
512
  return h;
513
513
  },
514
514
  getColumnWidth: function(e, t, r) {
515
515
  return r.columnMetadataMap[t].size;
516
516
  },
517
- getEstimatedTotalHeight: Ke,
518
- getEstimatedTotalWidth: Ze,
517
+ getEstimatedTotalHeight: Ze,
518
+ getEstimatedTotalWidth: Je,
519
519
  getOffsetForColumnAndAlignment: function(e, t, r, s, l, a) {
520
- return qe("column", e, t, r, s, l, a);
520
+ return Ge("column", e, t, r, s, l, a);
521
521
  },
522
522
  getOffsetForRowAndAlignment: function(e, t, r, s, l, a) {
523
- return qe("row", e, t, r, s, l, a);
523
+ return Ge("row", e, t, r, s, l, a);
524
524
  },
525
525
  getRowOffset: function(e, t, r) {
526
- return $("row", e, t, r).offset;
526
+ return Z("row", e, t, r).offset;
527
527
  },
528
528
  getRowHeight: function(e, t, r) {
529
529
  return r.rowMetadataMap[t].size;
530
530
  },
531
531
  getRowStartIndexForOffset: function(e, t, r) {
532
- return Ve("row", e, r, t);
532
+ return qe("row", e, r, t);
533
533
  },
534
534
  getRowStopIndexForStartIndex: function(e, t, r, s) {
535
- for (var l = e.rowCount, a = e.height, c = $("row", e, t, s), f = r + a, g = c.offset + c.size, h = t; h < l - 1 && g < f; )
536
- h++, g += $("row", e, h, s).size;
535
+ for (var l = e.rowCount, a = e.height, c = Z("row", e, t, s), d = r + a, g = c.offset + c.size, h = t; h < l - 1 && g < d; )
536
+ h++, g += Z("row", e, h, s).size;
537
537
  return h;
538
538
  },
539
539
  initInstanceProps: function(e, t) {
540
540
  var r = e, s = r.estimatedColumnWidth, l = r.estimatedRowHeight, a = {
541
541
  columnMetadataMap: {},
542
- estimatedColumnWidth: s || Ue,
543
- estimatedRowHeight: l || Ue,
542
+ estimatedColumnWidth: s || Ve,
543
+ estimatedRowHeight: l || Ve,
544
544
  lastMeasuredColumnIndex: -1,
545
545
  lastMeasuredRowIndex: -1,
546
546
  rowMetadataMap: {}
547
547
  };
548
- return t.resetAfterColumnIndex = function(c, f) {
549
- f === void 0 && (f = !0), t.resetAfterIndices({
548
+ return t.resetAfterColumnIndex = function(c, d) {
549
+ d === void 0 && (d = !0), t.resetAfterIndices({
550
550
  columnIndex: c,
551
- shouldForceUpdate: f
551
+ shouldForceUpdate: d
552
552
  });
553
- }, t.resetAfterRowIndex = function(c, f) {
554
- f === void 0 && (f = !0), t.resetAfterIndices({
553
+ }, t.resetAfterRowIndex = function(c, d) {
554
+ d === void 0 && (d = !0), t.resetAfterIndices({
555
555
  rowIndex: c,
556
- shouldForceUpdate: f
556
+ shouldForceUpdate: d
557
557
  });
558
558
  }, t.resetAfterIndices = function(c) {
559
- var f = c.columnIndex, g = c.rowIndex, h = c.shouldForceUpdate, w = h === void 0 ? !0 : h;
560
- typeof f == "number" && (a.lastMeasuredColumnIndex = Math.min(a.lastMeasuredColumnIndex, f - 1)), typeof g == "number" && (a.lastMeasuredRowIndex = Math.min(a.lastMeasuredRowIndex, g - 1)), t._getItemStyleCache(-1), w && t.forceUpdate();
559
+ var d = c.columnIndex, g = c.rowIndex, h = c.shouldForceUpdate, C = h === void 0 ? !0 : h;
560
+ typeof d == "number" && (a.lastMeasuredColumnIndex = Math.min(a.lastMeasuredColumnIndex, d - 1)), typeof g == "number" && (a.lastMeasuredRowIndex = Math.min(a.lastMeasuredRowIndex, g - 1)), t._getItemStyleCache(-1), C && t.forceUpdate();
561
561
  }, a;
562
562
  },
563
563
  shouldResetStyleCacheOnItemSizeChange: !1,
@@ -572,7 +572,7 @@ var Jt = function(e, t) {
572
572
  }
573
573
  });
574
574
  process.env.NODE_ENV;
575
- function Ge(n, e) {
575
+ function $e(n, e) {
576
576
  for (var t in n)
577
577
  if (!(t in e))
578
578
  return !0;
@@ -581,90 +581,90 @@ function Ge(n, e) {
581
581
  return !0;
582
582
  return !1;
583
583
  }
584
- var Yt = ["style"], er = ["style"];
585
- function tr(n, e) {
586
- var t = n.style, r = Fe(n, Yt), s = e.style, l = Fe(e, er);
587
- return !Ge(t, s) && !Ge(r, l);
584
+ var rr = ["style"], or = ["style"];
585
+ function nr(n, e) {
586
+ var t = n.style, r = De(n, rr), s = e.style, l = De(e, or);
587
+ return !$e(t, s) && !$e(r, l);
588
588
  }
589
- let V;
590
- typeof window < "u" ? V = window : typeof self < "u" ? V = self : V = global;
591
- let Ee = null, Oe = null;
592
- const $e = 20, be = V.clearTimeout, je = V.setTimeout, Le = V.cancelAnimationFrame || V.mozCancelAnimationFrame || V.webkitCancelAnimationFrame, Be = V.requestAnimationFrame || V.mozRequestAnimationFrame || V.webkitRequestAnimationFrame;
593
- Le == null || Be == null ? (Ee = be, Oe = function(e) {
594
- return je(e, $e);
595
- }) : (Ee = function([e, t]) {
596
- Le(e), be(t);
597
- }, Oe = function(e) {
598
- const t = Be(function() {
599
- be(r), e();
600
- }), r = je(function() {
601
- Le(t), e();
602
- }, $e);
589
+ let q;
590
+ typeof window < "u" ? q = window : typeof self < "u" ? q = self : q = global;
591
+ let Oe = null, We = null;
592
+ const je = 20, Le = q.clearTimeout, Be = q.setTimeout, ze = q.cancelAnimationFrame || q.mozCancelAnimationFrame || q.webkitCancelAnimationFrame, Ke = q.requestAnimationFrame || q.mozRequestAnimationFrame || q.webkitRequestAnimationFrame;
593
+ ze == null || Ke == null ? (Oe = Le, We = function(e) {
594
+ return Be(e, je);
595
+ }) : (Oe = function([e, t]) {
596
+ ze(e), Le(t);
597
+ }, We = function(e) {
598
+ const t = Ke(function() {
599
+ Le(r), e();
600
+ }), r = Be(function() {
601
+ ze(t), e();
602
+ }, je);
603
603
  return [t, r];
604
604
  });
605
- function rr(n) {
605
+ function ir(n) {
606
606
  let e, t, r, s, l, a, c;
607
- const f = typeof document < "u" && document.attachEvent;
608
- if (!f) {
609
- a = function(z) {
610
- const T = z.__resizeTriggers__, M = T.firstElementChild, A = T.lastElementChild, o = M.firstElementChild;
611
- A.scrollLeft = A.scrollWidth, A.scrollTop = A.scrollHeight, o.style.width = M.offsetWidth + 1 + "px", o.style.height = M.offsetHeight + 1 + "px", M.scrollLeft = M.scrollWidth, M.scrollTop = M.scrollHeight;
612
- }, l = function(z) {
613
- return z.offsetWidth !== z.__resizeLast__.width || z.offsetHeight !== z.__resizeLast__.height;
614
- }, c = function(z) {
615
- if (z.target.className && typeof z.target.className.indexOf == "function" && z.target.className.indexOf("contract-trigger") < 0 && z.target.className.indexOf("expand-trigger") < 0)
607
+ const d = typeof document < "u" && document.attachEvent;
608
+ if (!d) {
609
+ a = function(M) {
610
+ const y = M.__resizeTriggers__, E = y.firstElementChild, P = y.lastElementChild, o = E.firstElementChild;
611
+ P.scrollLeft = P.scrollWidth, P.scrollTop = P.scrollHeight, o.style.width = E.offsetWidth + 1 + "px", o.style.height = E.offsetHeight + 1 + "px", E.scrollLeft = E.scrollWidth, E.scrollTop = E.scrollHeight;
612
+ }, l = function(M) {
613
+ return M.offsetWidth !== M.__resizeLast__.width || M.offsetHeight !== M.__resizeLast__.height;
614
+ }, c = function(M) {
615
+ if (M.target.className && typeof M.target.className.indexOf == "function" && M.target.className.indexOf("contract-trigger") < 0 && M.target.className.indexOf("expand-trigger") < 0)
616
616
  return;
617
- const T = this;
618
- a(this), this.__resizeRAF__ && Ee(this.__resizeRAF__), this.__resizeRAF__ = Oe(function() {
619
- l(T) && (T.__resizeLast__.width = T.offsetWidth, T.__resizeLast__.height = T.offsetHeight, T.__resizeListeners__.forEach(function(o) {
620
- o.call(T, z);
617
+ const y = this;
618
+ a(this), this.__resizeRAF__ && Oe(this.__resizeRAF__), this.__resizeRAF__ = We(function() {
619
+ l(y) && (y.__resizeLast__.width = y.offsetWidth, y.__resizeLast__.height = y.offsetHeight, y.__resizeListeners__.forEach(function(o) {
620
+ o.call(y, M);
621
621
  }));
622
622
  });
623
623
  };
624
- let i = !1, L = "";
624
+ let i = !1, z = "";
625
625
  r = "animationstart";
626
- const C = "Webkit Moz O ms".split(" ");
627
- let S = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), D = "";
626
+ const S = "Webkit Moz O ms".split(" ");
627
+ let I = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), D = "";
628
628
  {
629
- const z = document.createElement("fakeelement");
630
- if (z.style.animationName !== void 0 && (i = !0), i === !1) {
631
- for (let T = 0; T < C.length; T++)
632
- if (z.style[C[T] + "AnimationName"] !== void 0) {
633
- D = C[T], L = "-" + D.toLowerCase() + "-", r = S[T], i = !0;
629
+ const M = document.createElement("fakeelement");
630
+ if (M.style.animationName !== void 0 && (i = !0), i === !1) {
631
+ for (let y = 0; y < S.length; y++)
632
+ if (M.style[S[y] + "AnimationName"] !== void 0) {
633
+ D = S[y], z = "-" + D.toLowerCase() + "-", r = I[y], i = !0;
634
634
  break;
635
635
  }
636
636
  }
637
637
  }
638
- t = "resizeanim", e = "@" + L + "keyframes " + t + " { from { opacity: 0; } to { opacity: 0; } } ", s = L + "animation: 1ms " + t + "; ";
638
+ t = "resizeanim", e = "@" + z + "keyframes " + t + " { from { opacity: 0; } to { opacity: 0; } } ", s = z + "animation: 1ms " + t + "; ";
639
639
  }
640
640
  const g = function(i) {
641
641
  if (!i.getElementById("detectElementResize")) {
642
- const L = (e || "") + ".resize-triggers { " + (s || "") + '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 = i.head || i.getElementsByTagName("head")[0], S = i.createElement("style");
643
- S.id = "detectElementResize", S.type = "text/css", n != null && S.setAttribute("nonce", n), S.styleSheet ? S.styleSheet.cssText = L : S.appendChild(i.createTextNode(L)), C.appendChild(S);
642
+ const z = (e || "") + ".resize-triggers { " + (s || "") + '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%; }', S = i.head || i.getElementsByTagName("head")[0], I = i.createElement("style");
643
+ I.id = "detectElementResize", I.type = "text/css", n != null && I.setAttribute("nonce", n), I.styleSheet ? I.styleSheet.cssText = z : I.appendChild(i.createTextNode(z)), S.appendChild(I);
644
644
  }
645
645
  };
646
646
  return {
647
- addResizeListener: function(i, L) {
648
- if (f)
649
- i.attachEvent("onresize", L);
647
+ addResizeListener: function(i, z) {
648
+ if (d)
649
+ i.attachEvent("onresize", z);
650
650
  else {
651
651
  if (!i.__resizeTriggers__) {
652
- const C = i.ownerDocument, S = V.getComputedStyle(i);
653
- S && S.position === "static" && (i.style.position = "relative"), g(C), i.__resizeLast__ = {}, i.__resizeListeners__ = [], (i.__resizeTriggers__ = C.createElement("div")).className = "resize-triggers";
654
- const D = C.createElement("div");
655
- D.className = "expand-trigger", D.appendChild(C.createElement("div"));
656
- const z = C.createElement("div");
657
- z.className = "contract-trigger", i.__resizeTriggers__.appendChild(D), i.__resizeTriggers__.appendChild(z), i.appendChild(i.__resizeTriggers__), a(i), i.addEventListener("scroll", c, !0), r && (i.__resizeTriggers__.__animationListener__ = function(M) {
658
- M.animationName === t && a(i);
652
+ const S = i.ownerDocument, I = q.getComputedStyle(i);
653
+ I && I.position === "static" && (i.style.position = "relative"), g(S), i.__resizeLast__ = {}, i.__resizeListeners__ = [], (i.__resizeTriggers__ = S.createElement("div")).className = "resize-triggers";
654
+ const D = S.createElement("div");
655
+ D.className = "expand-trigger", D.appendChild(S.createElement("div"));
656
+ const M = S.createElement("div");
657
+ M.className = "contract-trigger", i.__resizeTriggers__.appendChild(D), i.__resizeTriggers__.appendChild(M), i.appendChild(i.__resizeTriggers__), a(i), i.addEventListener("scroll", c, !0), r && (i.__resizeTriggers__.__animationListener__ = function(E) {
658
+ E.animationName === t && a(i);
659
659
  }, i.__resizeTriggers__.addEventListener(r, i.__resizeTriggers__.__animationListener__));
660
660
  }
661
- i.__resizeListeners__.push(L);
661
+ i.__resizeListeners__.push(z);
662
662
  }
663
663
  },
664
- removeResizeListener: function(i, L) {
665
- if (f)
666
- i.detachEvent("onresize", L);
667
- else if (i.__resizeListeners__.splice(i.__resizeListeners__.indexOf(L), 1), !i.__resizeListeners__.length) {
664
+ removeResizeListener: function(i, z) {
665
+ if (d)
666
+ i.detachEvent("onresize", z);
667
+ else if (i.__resizeListeners__.splice(i.__resizeListeners__.indexOf(z), 1), !i.__resizeListeners__.length) {
668
668
  i.removeEventListener("scroll", c, !0), i.__resizeTriggers__.__animationListener__ && (i.__resizeTriggers__.removeEventListener(r, i.__resizeTriggers__.__animationListener__), i.__resizeTriggers__.__animationListener__ = null);
669
669
  try {
670
670
  i.__resizeTriggers__ = !i.removeChild(i.__resizeTriggers__);
@@ -674,7 +674,7 @@ function rr(n) {
674
674
  }
675
675
  };
676
676
  }
677
- class or extends lt {
677
+ class sr extends ut {
678
678
  constructor(...e) {
679
679
  super(...e), this.state = {
680
680
  height: this.props.defaultHeight || 0,
@@ -687,24 +687,24 @@ class or extends lt {
687
687
  onResize: s
688
688
  } = this.props;
689
689
  if (this._parentNode) {
690
- const l = window.getComputedStyle(this._parentNode) || {}, a = parseFloat(l.paddingLeft || "0"), c = parseFloat(l.paddingRight || "0"), f = parseFloat(l.paddingTop || "0"), g = parseFloat(l.paddingBottom || "0"), h = this._parentNode.getBoundingClientRect(), w = h.height - f - g, i = h.width - a - c;
691
- if (!t && this.state.height !== w || !r && this.state.width !== i) {
690
+ const l = window.getComputedStyle(this._parentNode) || {}, a = parseFloat(l.paddingLeft || "0"), c = parseFloat(l.paddingRight || "0"), d = parseFloat(l.paddingTop || "0"), g = parseFloat(l.paddingBottom || "0"), h = this._parentNode.getBoundingClientRect(), C = h.height - d - g, i = h.width - a - c;
691
+ if (!t && this.state.height !== C || !r && this.state.width !== i) {
692
692
  this.setState({
693
- height: w,
693
+ height: C,
694
694
  width: i
695
695
  });
696
- const L = () => {
696
+ const z = () => {
697
697
  this._didLogDeprecationWarning || (this._didLogDeprecationWarning = !0, console.warn("scaledWidth and scaledHeight parameters have been deprecated; use width and height instead"));
698
698
  };
699
699
  typeof s == "function" && s({
700
- height: w,
700
+ height: C,
701
701
  width: i,
702
702
  // TODO Remove these params in the next major release
703
703
  get scaledHeight() {
704
- return L(), w;
704
+ return z(), C;
705
705
  },
706
706
  get scaledWidth() {
707
- return L(), i;
707
+ return z(), i;
708
708
  }
709
709
  });
710
710
  }
@@ -722,7 +722,7 @@ class or extends lt {
722
722
  const r = t.ownerDocument.defaultView.ResizeObserver;
723
723
  r != null ? (this._resizeObserver = new r(() => {
724
724
  this._timeoutId = setTimeout(this._onResize, 0);
725
- }), this._resizeObserver.observe(t)) : (this._detectElementResize = rr(e), this._detectElementResize.addResizeListener(t, this._onResize)), this._onResize();
725
+ }), this._resizeObserver.observe(t)) : (this._detectElementResize = ir(e), this._detectElementResize.addResizeListener(t, this._onResize)), this._onResize();
726
726
  }
727
727
  }
728
728
  componentWillUnmount() {
@@ -737,29 +737,29 @@ class or extends lt {
737
737
  disableWidth: l = !1,
738
738
  doNotBailOutOnEmptyChildren: a = !1,
739
739
  nonce: c,
740
- onResize: f,
740
+ onResize: d,
741
741
  style: g = {},
742
742
  tagName: h = "div",
743
- ...w
743
+ ...C
744
744
  } = this.props, {
745
745
  height: i,
746
- width: L
747
- } = this.state, C = {
746
+ width: z
747
+ } = this.state, S = {
748
748
  overflow: "visible"
749
- }, S = {};
749
+ }, I = {};
750
750
  let D = !1;
751
- return s || (i === 0 && (D = !0), C.height = 0, S.height = i, S.scaledHeight = i), l || (L === 0 && (D = !0), C.width = 0, S.width = L, S.scaledWidth = L), a && (D = !1), ue(h, {
751
+ return s || (i === 0 && (D = !0), S.height = 0, I.height = i, I.scaledHeight = i), l || (z === 0 && (D = !0), S.width = 0, I.width = z, I.scaledWidth = z), a && (D = !1), de(h, {
752
752
  ref: this._setRef,
753
753
  style: {
754
- ...C,
754
+ ...S,
755
755
  ...g
756
756
  },
757
- ...w
758
- }, !D && e(S));
757
+ ...C
758
+ }, !D && e(I));
759
759
  }
760
760
  }
761
- const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
762
- const s = Wt(
761
+ const ar = dt(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
762
+ const s = Nt(
763
763
  e,
764
764
  n,
765
765
  t.columnCount,
@@ -770,23 +770,23 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
770
770
  if (t.isDualPageWithCover) {
771
771
  const a = s === t.totalPages && t.totalPages % 2 === 0;
772
772
  if (e === 0 && s === 1 || a && n === 0) {
773
- const f = t.columnWidths.reduce((g, h) => g + h, 0);
774
- return /* @__PURE__ */ b(
773
+ const d = t.columnWidths.reduce((g, h) => g + h, 0);
774
+ return /* @__PURE__ */ L(
775
775
  "div",
776
776
  {
777
777
  style: {
778
778
  ...r,
779
- width: f,
779
+ width: d,
780
780
  display: "flex",
781
781
  justifyContent: "center",
782
782
  alignItems: "flex-start"
783
783
  },
784
- children: /* @__PURE__ */ b(Ie, { style: { position: "relative" }, pageNumber: s }, s)
784
+ children: /* @__PURE__ */ L(Te, { style: { position: "relative" }, pageNumber: s }, s)
785
785
  }
786
786
  );
787
787
  }
788
788
  }
789
- return t.columnCount === 2 ? /* @__PURE__ */ b(
789
+ return t.columnCount === 2 ? /* @__PURE__ */ L(
790
790
  "div",
791
791
  {
792
792
  style: {
@@ -795,267 +795,279 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
795
795
  justifyContent: n === 0 ? "flex-end" : "flex-start",
796
796
  alignItems: "flex-start"
797
797
  },
798
- children: /* @__PURE__ */ b(Ie, { style: { position: "relative" }, pageNumber: s }, s)
798
+ children: /* @__PURE__ */ L(Te, { style: { position: "relative" }, pageNumber: s }, s)
799
799
  }
800
- ) : /* @__PURE__ */ b(Ie, { style: r, pageNumber: s }, s);
801
- }, tr), $o = () => {
802
- const n = G(new kt()), { initialPage: e = 1, initialScrollMode: t } = bt(), { pagesRef: r, setPagesRef: s, setContentRef: l } = Lt(), { scrollToPage: a } = ft();
803
- Dt(r);
800
+ ) : /* @__PURE__ */ L(Te, { style: r, pageNumber: s }, s);
801
+ }, nr), Ko = () => {
802
+ const n = K(new qt()), { initialPage: e = 1, initialScrollMode: t } = Mt(), { pagesRef: r, setPagesRef: s, setContentRef: l } = Et(), { scrollToPage: a } = ht();
803
+ Ut(r);
804
804
  const {
805
805
  virtualScrollRef: c,
806
- getVirtualScrollRef: f,
806
+ getVirtualScrollRef: d,
807
807
  getPageScrollElementRef: g,
808
808
  getVirtualScrollableElementRef: h,
809
- setTotalInnerDimensions: w,
809
+ setTotalInnerDimensions: C,
810
810
  virtualScrollableElementRef: i,
811
- totalInnerDimensions: L,
812
- pageScrollElementRef: C
813
- } = dt(), S = G(!0), { nextPage: D, prevPage: z, setFocusedPage: T, focusedPage: M, totalPages: A } = mt(), { scrollMode: o } = gt(), { viewMode: u } = ht(), d = G(null), { loading: m, error: I } = pt(), { passwordRequired: p } = At(), { LoaderImageComponent: x } = Mt(), R = G(
814
- L
815
- ), E = G({
816
- viewMode: u,
817
- scrollMode: o
818
- }), O = G(!1), W = G(), { isFullScreen: y } = wt(), {
819
- pageDimension: F,
820
- rowCount: P,
821
- rowHeight: H,
822
- columnCount: N,
823
- columnWidth: k,
824
- estimatedColumnWidth: Z,
825
- estimatedRowHeight: J,
826
- totalDimension: Q
827
- } = ut(), ie = zt(L, 100), { onScroll: j, onTextSelect: le } = Ft();
828
- Ht({ onTextSelect: le, pagesRef: r });
829
- const X = G();
830
- Ot(N, P, i, u);
831
- const Y = G({
811
+ totalInnerDimensions: z,
812
+ pageScrollElementRef: S
813
+ } = pt(), I = K(!0), [D, M] = ft(e > 1), { nextPage: y, prevPage: E, setFocusedPage: P, focusedPage: o, totalPages: f } = gt(), { scrollMode: u } = wt(), { viewMode: m } = _t(), _ = K(null), { loading: p, error: T } = vt(), { passwordRequired: O } = Ft(), { LoaderImageComponent: W } = Wt(), x = K(
814
+ z
815
+ ), b = K({
816
+ viewMode: m,
817
+ scrollMode: u
818
+ }), R = K(!1), A = K(), { isFullScreen: H } = It(), {
819
+ pageDimension: U,
820
+ rowCount: N,
821
+ rowHeight: G,
822
+ columnCount: F,
823
+ columnWidth: V,
824
+ estimatedColumnWidth: te,
825
+ estimatedRowHeight: re,
826
+ totalDimension: ae
827
+ } = mt(), ne = Ot(z, 100), { onScroll: J, onTextSelect: he } = kt();
828
+ Vt({ onTextSelect: he, pagesRef: r });
829
+ const Q = K();
830
+ At(F, N, i, m);
831
+ const $ = K({
832
832
  scrollTop: 0,
833
833
  scrollLeft: 0
834
834
  });
835
- yt(r);
836
- const { isPressed: ee } = Tt(), { selectionMode: B } = xt(), { initializeGrabScroll: K, resetGrabState: pe } = Rt({
837
- isPressed: ee
838
- }), te = Se(() => B === vt.HAND, [B]), Qe = Se(() => {
839
- const v = Array.from({ length: N }, (_, q) => k(q));
835
+ zt(r);
836
+ const { isPressed: j } = yt(), { selectionMode: le } = bt(), { initializeGrabScroll: ce, resetGrabState: Xe } = Lt({
837
+ isPressed: j
838
+ }), ie = Ie(() => le === Ct.HAND, [le]), Ye = Ie(() => {
839
+ const v = Array.from({ length: F }, (w, B) => V(B));
840
840
  return {
841
- columnCount: N,
842
- isDualPageWithCover: u === Te.DUAL_PAGE_WITH_COVER,
841
+ columnCount: F,
842
+ isDualPageWithCover: m === xe.DUAL_PAGE_WITH_COVER,
843
843
  columnWidths: v,
844
- totalPages: A
844
+ totalPages: f
845
845
  };
846
- }, [N, u, k, A]), he = ae(
846
+ }, [F, m, V, f]), ge = se(
847
847
  (v) => {
848
- const _ = document.activeElement !== r;
849
- !y && _ || (["ArrowUp", "ArrowLeft"].includes(v.key) ? (v.preventDefault(), z()) : ["ArrowDown", "ArrowRight"].includes(v.key) && (v.preventDefault(), D()));
848
+ const w = document.activeElement !== r;
849
+ !H && w || (["ArrowUp", "ArrowLeft"].includes(v.key) ? (v.preventDefault(), E()) : ["ArrowDown", "ArrowRight"].includes(v.key) && (v.preventDefault(), y()));
850
850
  },
851
- [D, z, y, o]
851
+ [y, E, H, u]
852
852
  );
853
- ne(() => (window.addEventListener("keydown", he), () => {
854
- window.removeEventListener("keydown", he);
855
- }), [he]), ne(() => {
856
- if (d.current && (d.current.style.position = "relative"), !!c)
857
- for (let v = 0; v < P; v++)
858
- for (let _ = 0; _ < N; _++)
853
+ ee(() => (window.addEventListener("keydown", ge), () => {
854
+ window.removeEventListener("keydown", ge);
855
+ }), [ge]), ee(() => {
856
+ if (_.current && (_.current.style.position = "relative"), !!c)
857
+ for (let v = 0; v < N; v++)
858
+ for (let w = 0; w < F; w++)
859
859
  c.resetAfterIndices({
860
- columnIndex: _,
860
+ columnIndex: w,
861
861
  rowIndex: v,
862
862
  shouldForceUpdate: !0
863
863
  });
864
- }, [P, N, F, c]);
865
- const Xe = ae(
866
- (v, _) => {
864
+ }, [N, F, U, c]);
865
+ const et = se(
866
+ (v, w) => {
867
867
  if (!i)
868
868
  return { scrollTop: 0, scrollLeft: 0 };
869
- const q = Y.current.scrollTop > _, re = Y.current.scrollLeft > v;
870
- return q || re ? Y.current : {
869
+ const B = $.current.scrollTop > w, X = $.current.scrollLeft > v;
870
+ return B || X ? $.current : {
871
871
  scrollTop: i.scrollTop,
872
872
  scrollLeft: i.scrollLeft
873
873
  };
874
874
  },
875
875
  [i]
876
- ), We = ae(
877
- (v, _) => {
878
- if (E.current.viewMode !== u || E.current.scrollMode !== o) {
879
- X.current && clearTimeout(X.current), O.current = !0, a(M, "auto"), X.current = setTimeout(() => {
876
+ ), Pe = se(
877
+ (v, w) => {
878
+ if (b.current.viewMode !== m || b.current.scrollMode !== u) {
879
+ Q.current && clearTimeout(Q.current), R.current = !0, a(o, "auto"), Q.current = setTimeout(() => {
880
880
  requestAnimationFrame(() => {
881
- E.current = { viewMode: u, scrollMode: o };
881
+ b.current = { viewMode: m, scrollMode: u };
882
882
  });
883
883
  }, 100);
884
884
  return;
885
885
  }
886
- const re = v.scrollTop, ge = v.scrollLeft;
887
- if (!_.height || !_.width)
886
+ const X = v.scrollTop, ve = v.scrollLeft;
887
+ if (!w.height || !w.width)
888
888
  return;
889
- O.current = !0;
890
- const { height: oe, width: ve } = _, { height: _e, width: we } = R.current;
891
- if (_e === oe && we === ve)
889
+ R.current = !0;
890
+ const { height: Y, width: _e } = w, { height: we, width: Ce } = x.current;
891
+ if (we === Y && Ce === _e)
892
892
  return;
893
- if (S.current && e > 1) {
894
- R.current = {
895
- height: _.height,
896
- width: _.width
893
+ if (I.current && e > 1) {
894
+ x.current = {
895
+ height: w.height,
896
+ width: w.width
897
897
  };
898
898
  return;
899
899
  }
900
- if (!_e || !we) {
901
- R.current = {
902
- height: _.height,
903
- width: _.width
900
+ if (!we || !Ce) {
901
+ x.current = {
902
+ height: w.height,
903
+ width: w.width
904
904
  };
905
905
  return;
906
906
  }
907
- const rt = re / _e * oe, ot = ge / we * ve, nt = Math.round(Math.min(rt, oe)) || 0, it = Math.round(Math.min(ot, ve)) || 0;
908
- W.current = setTimeout(() => {
907
+ const nt = X / we * Y, it = ve / Ce * _e, st = Math.round(Math.min(nt, Y)) || 0, at = Math.round(Math.min(it, _e)) || 0;
908
+ A.current = setTimeout(() => {
909
909
  requestAnimationFrame(() => {
910
910
  i == null || i.scrollTo({
911
- top: nt,
912
- left: it,
911
+ top: st,
912
+ left: at,
913
913
  behavior: "auto"
914
914
  });
915
915
  });
916
- }, 0), R.current = {
917
- height: _.height,
918
- width: _.width
916
+ }, 0), x.current = {
917
+ height: w.height,
918
+ width: w.width
919
919
  };
920
920
  },
921
- [i, u, o, a, e, M]
921
+ [i, m, u, a, e]
922
922
  );
923
- ne(() => {
924
- clearTimeout(W.current);
925
- const v = Array.from({ length: P }).reduce(
926
- (re, ge, oe) => re + H(oe),
923
+ ee(() => {
924
+ clearTimeout(A.current);
925
+ const v = Array.from({ length: N }).reduce(
926
+ (X, ve, Y) => X + G(Y),
927
927
  0
928
- ), _ = Array.from({ length: N }).reduce(
929
- (re, ge, oe) => re + k(oe),
928
+ ), w = Array.from({ length: F }).reduce(
929
+ (X, ve, Y) => X + V(Y),
930
930
  0
931
- ), q = Xe(_, v);
932
- Y.current = q, We(q, { height: v, width: _ }), w({
931
+ ), B = et(w, v);
932
+ $.current = B, Pe(B, { height: v, width: w }), C({
933
933
  height: v,
934
- width: _
934
+ width: w
935
935
  });
936
- }, [F, P, N, We]);
937
- const Ye = ae(
936
+ }, [U, N, F, Pe]);
937
+ const tt = se(
938
938
  (v) => {
939
- Y.current = {
939
+ $.current = {
940
940
  scrollTop: v.scrollTop,
941
941
  scrollLeft: v.scrollLeft
942
942
  };
943
943
  },
944
944
  [i]
945
945
  );
946
- ne(() => {
947
- if (j)
948
- return C && C.addEventListener("scroll", j), i && i.addEventListener("scroll", j), () => {
949
- C == null || C.removeEventListener("scroll", j), i == null || i.removeEventListener("scroll", j);
946
+ ee(() => {
947
+ if (J)
948
+ return S && S.addEventListener("scroll", J), i && i.addEventListener("scroll", J), () => {
949
+ S == null || S.removeEventListener("scroll", J), i == null || i.removeEventListener("scroll", J);
950
950
  };
951
- }, [i, C, j]), ne(() => () => {
952
- X.current && clearTimeout(X.current);
951
+ }, [i, S, J]), ee(() => () => {
952
+ Q.current && clearTimeout(Q.current);
953
953
  }, []);
954
- const et = Se(() => ce(U["rp-pages-container"], {
955
- [U["rp-cursor-grab"]]: te && !ee,
956
- [U["rp-cursor-grabbing"]]: te && ee
957
- }), [te, ee]), tt = ae(
954
+ const rt = Ie(() => ue(k["rp-pages-container"], {
955
+ [k["rp-cursor-grab"]]: ie && !j,
956
+ [k["rp-cursor-grabbing"]]: ie && j
957
+ }), [ie, j]), ot = se(
958
958
  (v) => {
959
- if (te && v) {
960
- const _ = ce(U["rp-pages"]), q = document.querySelector(`.${_}`);
961
- K(q);
959
+ if (ie && v) {
960
+ const w = ue(k["rp-pages"]), B = document.querySelector(`.${w}`);
961
+ ce(B);
962
962
  }
963
963
  },
964
- [te, K, U]
964
+ [ie, ce, k]
965
965
  );
966
- return ne(() => {
967
- m && pe();
968
- }, [m]), ne(() => {
969
- if (ie.height === 0 || !S.current)
966
+ return ee(() => {
967
+ p && Xe();
968
+ }, [p]), ee(() => {
969
+ if (ne.height === 0 || !I.current)
970
970
  return;
971
- if (t === xe.PAGE_SCROLLING) {
972
- e !== M && C && T(e), S.current = !1;
971
+ if (t === Re.PAGE_SCROLLING) {
972
+ e !== o && S && P(e), I.current = !1, M(!1);
973
973
  return;
974
974
  }
975
- !i || (a(e, "auto"), !(i.scrollLeft > 0 || i.scrollTop > 0)) || (T(e), S.current = !1);
975
+ !i || (a(e, "auto"), !(i.scrollLeft > 0 || i.scrollTop > 0)) || (P(e), I.current = !1, M(!1));
976
976
  }, [
977
977
  a,
978
978
  t,
979
- C,
980
- T,
981
- ie,
979
+ S,
980
+ P,
981
+ ne,
982
982
  i
983
- ]), /* @__PURE__ */ Ce(st, { children: [
984
- /* @__PURE__ */ b(Pt, { ref: l, children: /* @__PURE__ */ b(
985
- Nt,
983
+ ]), /* @__PURE__ */ Se(lt, { children: [
984
+ /* @__PURE__ */ L(Ht, { ref: l, children: /* @__PURE__ */ L(
985
+ Dt,
986
986
  {
987
987
  ref: s,
988
988
  tabIndex: -1,
989
- className: et,
989
+ className: rt,
990
990
  style: {
991
991
  "--scale-round-x": `${Ae(n.current.sx)[1]}px`,
992
992
  "--scale-round-y": `${Ae(n.current.sy)[1]}px`
993
993
  },
994
- children: /* @__PURE__ */ b(or, { style: { minHeight: "50px" }, children: ({ width: v, height: _ }) => /* @__PURE__ */ b("div", { "data-rp": "pages", ref: tt, style: { width: v, height: _ }, children: o === xe.PAGE_SCROLLING ? /* @__PURE__ */ b(
995
- "div",
996
- {
997
- ref: g,
998
- style: { width: v, height: _ },
999
- className: ce(U["rp-pages"], U["rp-page-scrolling-wrapper"]),
1000
- children: u === Te.DUAL_PAGE ? /* @__PURE__ */ b(Ct, { widths: k, heights: H }) : u === Te.DUAL_PAGE_WITH_COVER ? /* @__PURE__ */ b(St, { widths: k, heights: H }) : /* @__PURE__ */ b(It, { widths: k, heights: H })
1001
- }
1002
- ) : J ? /* @__PURE__ */ b(
1003
- Xt,
1004
- {
1005
- ref: f,
1006
- itemData: Qe,
1007
- outerRef: h,
1008
- innerRef: d,
1009
- onScroll: Ye,
1010
- columnCount: N,
1011
- columnWidth: k,
1012
- rowHeight: H,
1013
- height: _,
1014
- width: v,
1015
- estimatedColumnWidth: Z,
1016
- estimatedRowHeight: J,
1017
- rowCount: P,
1018
- className: ce(
1019
- U["rp-pages"],
1020
- o === xe.HORIZONTAL_SCROLLING ? U["rp-pages-horizontal-scroll"] : ""
1021
- ),
1022
- style: {
1023
- "--rp-pages-height": `${Q.height}px`,
1024
- "--rp-pages-width": `${Q.width}px`,
1025
- "--rp-row-count": `${P}`,
1026
- "--rp-column-count": `${N}`
1027
- },
1028
- children: nr
1029
- }
1030
- ) : !m && !I ? /* @__PURE__ */ b(
994
+ children: /* @__PURE__ */ L(sr, { style: { minHeight: "50px" }, children: ({ width: v, height: w }) => /* @__PURE__ */ L(
1031
995
  "div",
1032
996
  {
1033
- className: U["rp-loader"],
997
+ "data-rp": "pages",
998
+ ref: ot,
1034
999
  style: {
1035
- display: "flex",
1036
- justifyContent: "center",
1037
- alignItems: "center",
1038
- height: "100%",
1039
- width: "100%"
1000
+ width: v,
1001
+ height: w,
1002
+ ...D && { visibility: "hidden" }
1040
1003
  },
1041
- children: x && /* @__PURE__ */ b(x, {})
1004
+ children: u === Re.PAGE_SCROLLING ? /* @__PURE__ */ L(
1005
+ "div",
1006
+ {
1007
+ ref: g,
1008
+ style: { width: v, height: w },
1009
+ className: ue(k["rp-pages"], k["rp-page-scrolling-wrapper"]),
1010
+ children: m === xe.DUAL_PAGE ? /* @__PURE__ */ L(Tt, { widths: V, heights: G }) : m === xe.DUAL_PAGE_WITH_COVER ? /* @__PURE__ */ L(xt, { widths: V, heights: G }) : /* @__PURE__ */ L(Rt, { widths: V, heights: G })
1011
+ }
1012
+ ) : re ? /* @__PURE__ */ L(
1013
+ tr,
1014
+ {
1015
+ ref: d,
1016
+ itemData: Ye,
1017
+ outerRef: h,
1018
+ innerRef: _,
1019
+ onScroll: tt,
1020
+ columnCount: F,
1021
+ columnWidth: V,
1022
+ rowHeight: G,
1023
+ height: w,
1024
+ width: v,
1025
+ estimatedColumnWidth: te,
1026
+ estimatedRowHeight: re,
1027
+ rowCount: N,
1028
+ className: ue(
1029
+ k["rp-pages"],
1030
+ u === Re.HORIZONTAL_SCROLLING ? k["rp-pages-horizontal-scroll"] : ""
1031
+ ),
1032
+ style: {
1033
+ "--rp-pages-height": `${ae.height}px`,
1034
+ "--rp-pages-width": `${ae.width}px`,
1035
+ "--rp-row-count": `${N}`,
1036
+ "--rp-column-count": `${F}`
1037
+ },
1038
+ children: ar
1039
+ }
1040
+ ) : !p && !T ? /* @__PURE__ */ L(
1041
+ "div",
1042
+ {
1043
+ className: k["rp-loader"],
1044
+ style: {
1045
+ display: "flex",
1046
+ justifyContent: "center",
1047
+ alignItems: "center",
1048
+ height: "100%",
1049
+ width: "100%"
1050
+ },
1051
+ children: W && /* @__PURE__ */ L(W, {})
1052
+ }
1053
+ ) : T === St.NOT_SUPPORTED ? /* @__PURE__ */ L("div", { className: k["rp-not-supported"], children: /* @__PURE__ */ Se("div", { className: k["rp-not-supported-content"], children: [
1054
+ "React PDF Kit is unable to render on this browser. Please use the supported browsers from the list below:",
1055
+ /* @__PURE__ */ L("div", { children: /* @__PURE__ */ Se("ul", { className: k["rp-not-supported-list"], children: [
1056
+ /* @__PURE__ */ L("li", { children: "Chrome 126+" }),
1057
+ /* @__PURE__ */ L("li", { children: "Edge 126+" }),
1058
+ /* @__PURE__ */ L("li", { children: "Firefox 126+" }),
1059
+ /* @__PURE__ */ L("li", { children: "Safari 18.4+" }),
1060
+ /* @__PURE__ */ L("li", { children: "Safari iOS 18.4+" }),
1061
+ /* @__PURE__ */ L("li", { children: "Chrome Android 126+" })
1062
+ ] }) })
1063
+ ] }) }) : null
1042
1064
  }
1043
- ) : I === _t.NOT_SUPPORTED ? /* @__PURE__ */ b("div", { className: U["rp-not-supported"], children: /* @__PURE__ */ Ce("div", { className: U["rp-not-supported-content"], children: [
1044
- "React PDF Kit is unable to render on this browser. Please use the supported browsers from the list below:",
1045
- /* @__PURE__ */ b("div", { children: /* @__PURE__ */ Ce("ul", { className: U["rp-not-supported-list"], children: [
1046
- /* @__PURE__ */ b("li", { children: "Chrome 126+" }),
1047
- /* @__PURE__ */ b("li", { children: "Edge 126+" }),
1048
- /* @__PURE__ */ b("li", { children: "Firefox 126+" }),
1049
- /* @__PURE__ */ b("li", { children: "Safari 18.4+" }),
1050
- /* @__PURE__ */ b("li", { children: "Safari iOS 18.4+" }),
1051
- /* @__PURE__ */ b("li", { children: "Chrome Android 126+" })
1052
- ] }) })
1053
- ] }) }) : null }) })
1065
+ ) })
1054
1066
  }
1055
1067
  ) }),
1056
- p && /* @__PURE__ */ b(Et, {})
1068
+ O && /* @__PURE__ */ L(Pt, {})
1057
1069
  ] });
1058
1070
  };
1059
1071
  export {
1060
- $o as RPPages
1072
+ Ko as RPPages
1061
1073
  };