@react-pdf-kit/viewer 2.2.0-rc.3 → 2.2.1-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 (48) hide show
  1. package/dist/PaginationContext-a3021a65.js +218 -0
  2. package/dist/components/RPController.js +1 -1
  3. package/dist/components/RPPages.js +253 -238
  4. package/dist/components/RPProvider.js +50 -48
  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 +2 -2
  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/types/utils/hooks/usePaginate.d.ts +2 -2
  41. package/dist/types/utils/types.d.ts +3 -0
  42. package/dist/utils/hooks/useLicense.js +1 -1
  43. package/dist/utils/hooks/usePaginate.js +1 -1
  44. package/dist/utils/hooks/usePresentPage.js +1 -1
  45. package/dist/utils/hooks/useScrollToPage.js +1 -1
  46. package/dist/utils/hooks/useSearch.js +1 -1
  47. package/package.json +1 -1
  48. package/dist/PaginationContext-9217cab4.js +0 -201
@@ -1,13 +1,13 @@
1
- import { jsx as R, jsxs as _e, 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 we, useCallback as ae, useEffect as ne } from "react";
3
- import { RPPage as Ce } from "./page/RPPage.js";
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
4
  import { useVirtualReactWindow as ut } from "../utils/hooks/useVirtualReactWindow.js";
5
5
  import { useVirtualScrollContext as dt } from "../contexts/VirtualScrollContext.js";
6
- import { a as ft, u as mt } from "../PaginationContext-9217cab4.js";
6
+ import { a as ft, u as mt } from "../PaginationContext-a3021a65.js";
7
7
  import { useDocumentContext as pt } from "../contexts/RPDocumentContext.js";
8
8
  import { useViewModeContext as ht } from "../contexts/ViewModeContext.js";
9
9
  import { useScrollModeContext as gt } from "../contexts/ScrollModeContext.js";
10
- import { SelectionMode as vt, ViewMode as Se, ScrollMode as Ie, ErrorType as _t } from "../utils/types.js";
10
+ import { SelectionMode as vt, ViewMode as Te, ScrollMode as xe, ErrorType as _t } from "../utils/types.js";
11
11
  import { useFullScreenContext as wt } from "../contexts/FullScreenContext.js";
12
12
  import { c as ce } from "../clsx-0c6e471a.js";
13
13
  import { DualPage as Ct } from "./page/DualPage.js";
@@ -18,8 +18,8 @@ import { useSelectionModeContext as xt } from "../contexts/SelectionModeContext.
18
18
  import { useGrabScroll as Rt } from "../utils/hooks/useGrabScroll.js";
19
19
  import { usePinch as yt } from "../utils/hooks/usePinch.js";
20
20
  import { useInitialStateContext as bt } from "../contexts/InitialStateContext.js";
21
- import { useLayoutContainer as zt } from "../contexts/LayoutContainerContext.js";
22
- import { useDebounce as Lt } from "../utils/hooks/useDebounce.js";
21
+ import { useLayoutContainer as Lt } from "../contexts/LayoutContainerContext.js";
22
+ import { useDebounce as zt } from "../utils/hooks/useDebounce.js";
23
23
  import { useLoaderContext as Mt } from "../contexts/LoaderContext.js";
24
24
  import Et from "./ui/PasswordModal.js";
25
25
  import { usePresentPage as Ot } from "../utils/hooks/usePresentPage.js";
@@ -103,28 +103,28 @@ 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 be() {
107
- return be = Object.assign ? Object.assign.bind() : function(n) {
106
+ function ze() {
107
+ return ze = 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
- }, be.apply(null, arguments);
114
+ }, ze.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 ze(n, e) {
122
- return ze = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, r) {
121
+ function Me(n, e) {
122
+ return Me = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, r) {
123
123
  return t.__proto__ = r, t;
124
- }, ze(n, e);
124
+ }, Me(n, e);
125
125
  }
126
126
  function Ut(n, e) {
127
- n.prototype = Object.create(e.prototype), n.prototype.constructor = n, ze(n, e);
127
+ n.prototype = Object.create(e.prototype), n.prototype.constructor = n, Me(n, e);
128
128
  }
129
129
  var Pe = Number.isNaN || function(e) {
130
130
  return typeof e == "number" && e !== e;
@@ -140,7 +140,7 @@ function qt(n, e) {
140
140
  return !1;
141
141
  return !0;
142
142
  }
143
- function Te(n, e) {
143
+ function Re(n, e) {
144
144
  e === void 0 && (e = qt);
145
145
  var t, r = [], s, l = !1;
146
146
  function a() {
@@ -180,13 +180,13 @@ function $t(n, e) {
180
180
  };
181
181
  return s;
182
182
  }
183
- var xe = -1;
183
+ var ye = -1;
184
184
  function jt(n) {
185
- if (n === void 0 && (n = !1), xe === -1 || n) {
185
+ if (n === void 0 && (n = !1), ye === -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), xe = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
187
+ t.width = "50px", t.height = "50px", t.overflow = "scroll", document.body.appendChild(e), ye = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
188
188
  }
189
- return xe;
189
+ return ye;
190
190
  }
191
191
  var se = null;
192
192
  function ke(n) {
@@ -206,12 +206,12 @@ var Bt = 150, Kt = function(e) {
206
206
  }, de = null, fe = null, me = null;
207
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
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, _ = n.getRowOffset, i = n.getRowStartIndexForOffset, y = n.getRowStopIndexForStartIndex, w = n.initInstanceProps, S = n.shouldResetStyleCacheOnItemSizeChange, D = n.validateProps;
210
- return e = /* @__PURE__ */ function(b) {
211
- Ut(I, b);
212
- function I(A) {
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) {
213
213
  var o;
214
- return o = b.call(this, A) || this, o._instanceProps = w(o.props, Ne(o)), o._resetIsScrollingTimeoutId = null, o._outerRef = void 0, o.state = {
214
+ return o = z.call(this, A) || this, o._instanceProps = C(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,66 +219,66 @@ 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 = Te(function(u, d, m, C, p, T, z, L) {
222
+ }, o._callOnItemsRendered = void 0, o._callOnItemsRendered = Re(function(u, d, m, I, p, x, R, E) {
223
223
  return o.props.onItemsRendered({
224
224
  overscanColumnStartIndex: u,
225
225
  overscanColumnStopIndex: d,
226
226
  overscanRowStartIndex: m,
227
- overscanRowStopIndex: C,
227
+ overscanRowStopIndex: I,
228
228
  visibleColumnStartIndex: p,
229
- visibleColumnStopIndex: T,
230
- visibleRowStartIndex: z,
231
- visibleRowStopIndex: L
229
+ visibleColumnStopIndex: x,
230
+ visibleRowStartIndex: R,
231
+ visibleRowStopIndex: E
232
232
  });
233
- }), o._callOnScroll = void 0, o._callOnScroll = Te(function(u, d, m, C, p) {
233
+ }), o._callOnScroll = void 0, o._callOnScroll = Re(function(u, d, m, I, p) {
234
234
  return o.props.onScroll({
235
235
  horizontalScrollDirection: m,
236
236
  scrollLeft: u,
237
237
  scrollTop: d,
238
- verticalScrollDirection: C,
238
+ verticalScrollDirection: I,
239
239
  scrollUpdateWasRequested: p
240
240
  });
241
241
  }), o._getItemStyle = void 0, o._getItemStyle = function(u, d) {
242
- var m = o.props, C = m.columnWidth, p = m.direction, T = m.rowHeight, z = o._getItemStyleCache(S && C, S && p, S && T), L = u + ":" + d, M;
243
- if (z.hasOwnProperty(L))
244
- M = z[L];
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];
245
245
  else {
246
- var E = t(o.props, d, o._instanceProps), x = p === "rtl";
247
- z[L] = M = {
246
+ var W = t(o.props, d, o._instanceProps), y = p === "rtl";
247
+ R[E] = O = {
248
248
  position: "absolute",
249
- left: x ? void 0 : E,
250
- right: x ? E : void 0,
251
- top: _(o.props, u, o._instanceProps),
249
+ left: y ? void 0 : W,
250
+ right: y ? W : void 0,
251
+ top: w(o.props, u, o._instanceProps),
252
252
  height: h(o.props, u, o._instanceProps),
253
253
  width: l(o.props, d, o._instanceProps)
254
254
  };
255
255
  }
256
- return M;
257
- }, o._getItemStyleCache = void 0, o._getItemStyleCache = Te(function(u, d, m) {
256
+ return O;
257
+ }, o._getItemStyleCache = void 0, o._getItemStyleCache = Re(function(u, d, m) {
258
258
  return {};
259
259
  }), o._onScroll = function(u) {
260
- var d = u.currentTarget, m = d.clientHeight, C = d.clientWidth, p = d.scrollLeft, T = d.scrollTop, z = d.scrollHeight, L = d.scrollWidth;
261
- o.setState(function(M) {
262
- if (M.scrollLeft === p && M.scrollTop === T)
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)
263
263
  return null;
264
- var E = o.props.direction, x = p;
265
- if (E === "rtl")
264
+ var W = o.props.direction, y = p;
265
+ if (W === "rtl")
266
266
  switch (ke()) {
267
267
  case "negative":
268
- x = -p;
268
+ y = -p;
269
269
  break;
270
270
  case "positive-descending":
271
- x = L - C - p;
271
+ y = E - I - p;
272
272
  break;
273
273
  }
274
- x = Math.max(0, Math.min(x, L - C));
275
- var F = Math.max(0, Math.min(T, z - m));
274
+ y = Math.max(0, Math.min(y, E - I));
275
+ var F = Math.max(0, Math.min(x, R - m));
276
276
  return {
277
277
  isScrolling: !0,
278
- horizontalScrollDirection: M.scrollLeft < p ? "forward" : "backward",
279
- scrollLeft: x,
278
+ horizontalScrollDirection: O.scrollLeft < p ? "forward" : "backward",
279
+ scrollLeft: y,
280
280
  scrollTop: F,
281
- verticalScrollDirection: M.scrollTop < T ? "forward" : "backward",
281
+ verticalScrollDirection: O.scrollTop < x ? "forward" : "backward",
282
282
  scrollUpdateWasRequested: !1
283
283
  };
284
284
  }, o._resetIsScrollingDebounced);
@@ -295,11 +295,11 @@ function Zt(n) {
295
295
  });
296
296
  }, o;
297
297
  }
298
- I.getDerivedStateFromProps = function(o, u) {
298
+ T.getDerivedStateFromProps = function(o, u) {
299
299
  return Jt(o, u), D(o), null;
300
300
  };
301
- var W = I.prototype;
302
- return W.scrollTo = function(o) {
301
+ var M = T.prototype;
302
+ return M.scrollTo = function(o) {
303
303
  var u = o.scrollLeft, d = o.scrollTop;
304
304
  u !== void 0 && (u = Math.max(0, u)), d !== void 0 && (d = Math.max(0, d)), this.setState(function(m) {
305
305
  return u === void 0 && (u = m.scrollLeft), d === void 0 && (d = m.scrollTop), m.scrollLeft === u && m.scrollTop === d ? null : {
@@ -310,24 +310,24 @@ function Zt(n) {
310
310
  verticalScrollDirection: m.scrollTop < d ? "forward" : "backward"
311
311
  };
312
312
  }, this._resetIsScrollingDebounced);
313
- }, W.scrollToItem = function(o) {
314
- var u = o.align, d = u === void 0 ? "auto" : u, m = o.columnIndex, C = o.rowIndex, p = this.props, T = p.columnCount, z = p.height, L = p.rowCount, M = p.width, E = this.state, x = E.scrollLeft, F = E.scrollTop, P = jt();
315
- m !== void 0 && (m = Math.max(0, Math.min(m, T - 1))), C !== void 0 && (C = Math.max(0, Math.min(C, L - 1)));
316
- var H = a(this.props, this._instanceProps), N = c(this.props, this._instanceProps), k = N > M ? P : 0, Z = H > z ? P : 0;
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;
317
317
  this.scrollTo({
318
- scrollLeft: m !== void 0 ? f(this.props, m, d, x, this._instanceProps, Z) : x,
319
- scrollTop: C !== void 0 ? g(this.props, C, d, F, this._instanceProps, k) : F
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
320
320
  });
321
- }, W.componentDidMount = function() {
321
+ }, M.componentDidMount = function() {
322
322
  var o = this.props, u = o.initialScrollLeft, d = o.initialScrollTop;
323
323
  if (this._outerRef != null) {
324
324
  var m = this._outerRef;
325
325
  typeof u == "number" && (m.scrollLeft = u), typeof d == "number" && (m.scrollTop = d);
326
326
  }
327
327
  this._callPropsCallbacks();
328
- }, W.componentDidUpdate = function() {
329
- var o = this.props.direction, u = this.state, d = u.scrollLeft, m = u.scrollTop, C = u.scrollUpdateWasRequested;
330
- if (C && this._outerRef != null) {
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) {
331
331
  var p = this._outerRef;
332
332
  if (o === "rtl")
333
333
  switch (ke()) {
@@ -338,8 +338,8 @@ function Zt(n) {
338
338
  p.scrollLeft = d;
339
339
  break;
340
340
  default:
341
- var T = p.clientWidth, z = p.scrollWidth;
342
- p.scrollLeft = z - T - d;
341
+ var x = p.clientWidth, R = p.scrollWidth;
342
+ p.scrollLeft = R - x - d;
343
343
  break;
344
344
  }
345
345
  else
@@ -347,20 +347,20 @@ function Zt(n) {
347
347
  p.scrollTop = Math.max(0, m);
348
348
  }
349
349
  this._callPropsCallbacks();
350
- }, W.componentWillUnmount = function() {
350
+ }, M.componentWillUnmount = function() {
351
351
  this._resetIsScrollingTimeoutId !== null && He(this._resetIsScrollingTimeoutId);
352
- }, W.render = function() {
353
- var o = this.props, u = o.children, d = o.className, m = o.columnCount, C = o.direction, p = o.height, T = o.innerRef, z = o.innerElementType, L = o.innerTagName, M = o.itemData, E = o.itemKey, x = E === void 0 ? Kt : E, 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 = [];
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
354
  if (m > 0 && H)
355
355
  for (var B = X; B <= Y; B++)
356
356
  for (var K = ie; K <= j; K++)
357
357
  ee.push(ue(u, {
358
358
  columnIndex: K,
359
- data: M,
359
+ data: O,
360
360
  isScrolling: k ? J : void 0,
361
- key: x({
361
+ key: y({
362
362
  columnIndex: K,
363
- data: M,
363
+ data: O,
364
364
  rowIndex: B
365
365
  }),
366
366
  rowIndex: B,
@@ -371,47 +371,47 @@ function Zt(n) {
371
371
  className: d,
372
372
  onScroll: this._onScroll,
373
373
  ref: this._outerRefSetter,
374
- style: be({
374
+ style: ze({
375
375
  position: "relative",
376
376
  height: p,
377
377
  width: Z,
378
378
  overflow: "auto",
379
379
  WebkitOverflowScrolling: "touch",
380
380
  willChange: "transform",
381
- direction: C
381
+ direction: I
382
382
  }, N)
383
- }, ue(z || L || "div", {
383
+ }, ue(R || E || "div", {
384
384
  children: ee,
385
- ref: T,
385
+ ref: x,
386
386
  style: {
387
387
  height: pe,
388
388
  pointerEvents: J ? "none" : void 0,
389
389
  width: te
390
390
  }
391
391
  }));
392
- }, W._callPropsCallbacks = function() {
393
- var o = this.props, u = o.columnCount, d = o.onItemsRendered, m = o.onScroll, C = o.rowCount;
394
- if (typeof d == "function" && u > 0 && C > 0) {
395
- var p = this._getHorizontalRangeToRender(), T = p[0], z = p[1], L = p[2], M = p[3], E = this._getVerticalRangeToRender(), x = E[0], F = E[1], P = E[2], H = E[3];
396
- this._callOnItemsRendered(T, z, x, F, L, M, P, H);
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);
397
397
  }
398
398
  if (typeof m == "function") {
399
399
  var N = this.state, k = N.horizontalScrollDirection, Z = N.scrollLeft, J = N.scrollTop, Q = N.scrollUpdateWasRequested, ie = N.verticalScrollDirection;
400
400
  this._callOnScroll(Z, J, k, ie, Q);
401
401
  }
402
- }, W._getHorizontalRangeToRender = function() {
403
- var o = this.props, u = o.columnCount, d = o.overscanColumnCount, m = o.overscanColumnsCount, C = o.overscanCount, p = o.rowCount, T = this.state, z = T.horizontalScrollDirection, L = T.isScrolling, M = T.scrollLeft, E = d || m || C || 1;
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
404
  if (u === 0 || p === 0)
405
405
  return [0, 0, 0, 0];
406
- var x = r(this.props, M, this._instanceProps), F = s(this.props, x, M, this._instanceProps), P = !L || z === "backward" ? Math.max(1, E) : 1, H = !L || z === "forward" ? Math.max(1, E) : 1;
407
- return [Math.max(0, x - P), Math.max(0, Math.min(u - 1, F + H)), x, F];
408
- }, W._getVerticalRangeToRender = function() {
409
- var o = this.props, u = o.columnCount, d = o.overscanCount, m = o.overscanRowCount, C = o.overscanRowsCount, p = o.rowCount, T = this.state, z = T.isScrolling, L = T.verticalScrollDirection, M = T.scrollTop, E = m || C || d || 1;
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
410
  if (u === 0 || p === 0)
411
411
  return [0, 0, 0, 0];
412
- var x = i(this.props, M, this._instanceProps), F = y(this.props, x, M, this._instanceProps), P = !z || L === "backward" ? Math.max(1, E) : 1, H = !z || L === "forward" ? Math.max(1, E) : 1;
413
- return [Math.max(0, x - P), Math.max(0, Math.min(p - 1, F + H)), x, F];
414
- }, I;
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
415
  }(at), e.defaultProps = {
416
416
  direction: "ltr",
417
417
  itemData: void 0,
@@ -419,7 +419,7 @@ function Zt(n) {
419
419
  }, e;
420
420
  }
421
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, _ = e.width, i = t.instance;
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;
423
423
  if (process.env.NODE_ENV !== "production") {
424
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)
425
425
  throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
@@ -430,8 +430,8 @@ 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 _ != "number")
434
- throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (_ === null ? "null" : typeof _) + '" was specified.'));
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.'));
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
  }
@@ -460,11 +460,11 @@ var Jt = function(e, t) {
460
460
  f = g.offset + g.size;
461
461
  }
462
462
  for (var h = c + 1; h <= r; h++) {
463
- var _ = a(h);
463
+ var w = a(h);
464
464
  l[h] = {
465
465
  offset: f,
466
- size: _
467
- }, f += _;
466
+ size: w
467
+ }, f += w;
468
468
  }
469
469
  e === "column" ? s.lastMeasuredColumnIndex = r : s.lastMeasuredRowIndex = r;
470
470
  }
@@ -487,17 +487,17 @@ var Jt = function(e, t) {
487
487
  s += c, c *= 2;
488
488
  return Je(e, t, r, Math.min(s, a - 1), Math.floor(s / 2), l);
489
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), _ = 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 <= _ + f ? s = "auto" : s = "center"), s) {
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) {
492
492
  case "start":
493
- return _;
493
+ return w;
494
494
  case "end":
495
495
  return i;
496
496
  case "center":
497
- return Math.round(i + (_ - i) / 2);
497
+ return Math.round(i + (w - i) / 2);
498
498
  case "auto":
499
499
  default:
500
- return l >= i && l <= _ ? l : i > _ || l < i ? i : _;
500
+ return l >= i && l <= w ? l : i > w || l < i ? i : w;
501
501
  }
502
502
  }, Xt = /* @__PURE__ */ Zt({
503
503
  getColumnOffset: function(e, t, r) {
@@ -556,8 +556,8 @@ var Jt = function(e, t) {
556
556
  shouldForceUpdate: f
557
557
  });
558
558
  }, t.resetAfterIndices = function(c) {
559
- var f = c.columnIndex, g = c.rowIndex, h = c.shouldForceUpdate, _ = 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), _ && t.forceUpdate();
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();
561
561
  }, a;
562
562
  },
563
563
  shouldResetStyleCacheOnItemSizeChange: !1,
@@ -588,17 +588,17 @@ function tr(n, e) {
588
588
  }
589
589
  let V;
590
590
  typeof window < "u" ? V = window : typeof self < "u" ? V = self : V = global;
591
- let Le = null, Me = null;
592
- const $e = 20, Re = V.clearTimeout, je = V.setTimeout, ye = V.cancelAnimationFrame || V.mozCancelAnimationFrame || V.webkitCancelAnimationFrame, Be = V.requestAnimationFrame || V.mozRequestAnimationFrame || V.webkitRequestAnimationFrame;
593
- ye == null || Be == null ? (Le = Re, Me = function(e) {
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
594
  return je(e, $e);
595
- }) : (Le = function([e, t]) {
596
- ye(e), Re(t);
597
- }, Me = function(e) {
595
+ }) : (Ee = function([e, t]) {
596
+ Le(e), be(t);
597
+ }, Oe = function(e) {
598
598
  const t = Be(function() {
599
- Re(r), e();
599
+ be(r), e();
600
600
  }), r = je(function() {
601
- ye(t), e();
601
+ Le(t), e();
602
602
  }, $e);
603
603
  return [t, r];
604
604
  });
@@ -606,65 +606,65 @@ function rr(n) {
606
606
  let e, t, r, s, l, a, c;
607
607
  const f = typeof document < "u" && document.attachEvent;
608
608
  if (!f) {
609
- a = function(b) {
610
- const I = b.__resizeTriggers__, W = I.firstElementChild, A = I.lastElementChild, o = W.firstElementChild;
611
- A.scrollLeft = A.scrollWidth, A.scrollTop = A.scrollHeight, o.style.width = W.offsetWidth + 1 + "px", o.style.height = W.offsetHeight + 1 + "px", W.scrollLeft = W.scrollWidth, W.scrollTop = W.scrollHeight;
612
- }, l = function(b) {
613
- return b.offsetWidth !== b.__resizeLast__.width || b.offsetHeight !== b.__resizeLast__.height;
614
- }, c = function(b) {
615
- if (b.target.className && typeof b.target.className.indexOf == "function" && b.target.className.indexOf("contract-trigger") < 0 && b.target.className.indexOf("expand-trigger") < 0)
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)
616
616
  return;
617
- const I = this;
618
- a(this), this.__resizeRAF__ && Le(this.__resizeRAF__), this.__resizeRAF__ = Me(function() {
619
- l(I) && (I.__resizeLast__.width = I.offsetWidth, I.__resizeLast__.height = I.offsetHeight, I.__resizeListeners__.forEach(function(o) {
620
- o.call(I, b);
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);
621
621
  }));
622
622
  });
623
623
  };
624
- let i = !1, y = "";
624
+ let i = !1, L = "";
625
625
  r = "animationstart";
626
- const w = "Webkit Moz O ms".split(" ");
626
+ const C = "Webkit Moz O ms".split(" ");
627
627
  let S = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), D = "";
628
628
  {
629
- const b = document.createElement("fakeelement");
630
- if (b.style.animationName !== void 0 && (i = !0), i === !1) {
631
- for (let I = 0; I < w.length; I++)
632
- if (b.style[w[I] + "AnimationName"] !== void 0) {
633
- D = w[I], y = "-" + D.toLowerCase() + "-", r = S[I], i = !0;
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;
634
634
  break;
635
635
  }
636
636
  }
637
637
  }
638
- t = "resizeanim", e = "@" + y + "keyframes " + t + " { from { opacity: 0; } to { opacity: 0; } } ", s = y + "animation: 1ms " + t + "; ";
638
+ t = "resizeanim", e = "@" + L + "keyframes " + t + " { from { opacity: 0; } to { opacity: 0; } } ", s = L + "animation: 1ms " + t + "; ";
639
639
  }
640
640
  const g = function(i) {
641
641
  if (!i.getElementById("detectElementResize")) {
642
- const y = (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%; }', w = 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 = y : S.appendChild(i.createTextNode(y)), w.appendChild(S);
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);
644
644
  }
645
645
  };
646
646
  return {
647
- addResizeListener: function(i, y) {
647
+ addResizeListener: function(i, L) {
648
648
  if (f)
649
- i.attachEvent("onresize", y);
649
+ i.attachEvent("onresize", L);
650
650
  else {
651
651
  if (!i.__resizeTriggers__) {
652
- const w = i.ownerDocument, S = V.getComputedStyle(i);
653
- S && S.position === "static" && (i.style.position = "relative"), g(w), i.__resizeLast__ = {}, i.__resizeListeners__ = [], (i.__resizeTriggers__ = w.createElement("div")).className = "resize-triggers";
654
- const D = w.createElement("div");
655
- D.className = "expand-trigger", D.appendChild(w.createElement("div"));
656
- const b = w.createElement("div");
657
- b.className = "contract-trigger", i.__resizeTriggers__.appendChild(D), i.__resizeTriggers__.appendChild(b), i.appendChild(i.__resizeTriggers__), a(i), i.addEventListener("scroll", c, !0), r && (i.__resizeTriggers__.__animationListener__ = function(W) {
658
- W.animationName === t && a(i);
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);
659
659
  }, i.__resizeTriggers__.addEventListener(r, i.__resizeTriggers__.__animationListener__));
660
660
  }
661
- i.__resizeListeners__.push(y);
661
+ i.__resizeListeners__.push(L);
662
662
  }
663
663
  },
664
- removeResizeListener: function(i, y) {
664
+ removeResizeListener: function(i, L) {
665
665
  if (f)
666
- i.detachEvent("onresize", y);
667
- else if (i.__resizeListeners__.splice(i.__resizeListeners__.indexOf(y), 1), !i.__resizeListeners__.length) {
666
+ i.detachEvent("onresize", L);
667
+ else if (i.__resizeListeners__.splice(i.__resizeListeners__.indexOf(L), 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__);
@@ -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(), _ = h.height - f - g, i = h.width - a - c;
691
- if (!t && this.state.height !== _ || !r && this.state.width !== i) {
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) {
692
692
  this.setState({
693
- height: _,
693
+ height: w,
694
694
  width: i
695
695
  });
696
- const y = () => {
696
+ const L = () => {
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: _,
700
+ height: w,
701
701
  width: i,
702
702
  // TODO Remove these params in the next major release
703
703
  get scaledHeight() {
704
- return y(), _;
704
+ return L(), w;
705
705
  },
706
706
  get scaledWidth() {
707
- return y(), i;
707
+ return L(), i;
708
708
  }
709
709
  });
710
710
  }
@@ -740,21 +740,21 @@ class or extends lt {
740
740
  onResize: f,
741
741
  style: g = {},
742
742
  tagName: h = "div",
743
- ..._
743
+ ...w
744
744
  } = this.props, {
745
745
  height: i,
746
- width: y
747
- } = this.state, w = {
746
+ width: L
747
+ } = this.state, C = {
748
748
  overflow: "visible"
749
749
  }, S = {};
750
750
  let D = !1;
751
- return s || (i === 0 && (D = !0), w.height = 0, S.height = i, S.scaledHeight = i), l || (y === 0 && (D = !0), w.width = 0, S.width = y, S.scaledWidth = y), a && (D = !1), ue(h, {
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, {
752
752
  ref: this._setRef,
753
753
  style: {
754
- ...w,
754
+ ...C,
755
755
  ...g
756
756
  },
757
- ..._
757
+ ...w
758
758
  }, !D && e(S));
759
759
  }
760
760
  }
@@ -771,7 +771,7 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
771
771
  const a = s === t.totalPages && t.totalPages % 2 === 0;
772
772
  if (e === 0 && s === 1 || a && n === 0) {
773
773
  const f = t.columnWidths.reduce((g, h) => g + h, 0);
774
- return /* @__PURE__ */ R(
774
+ return /* @__PURE__ */ b(
775
775
  "div",
776
776
  {
777
777
  style: {
@@ -781,12 +781,12 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
781
781
  justifyContent: "center",
782
782
  alignItems: "flex-start"
783
783
  },
784
- children: /* @__PURE__ */ R(Ce, { style: { position: "relative" }, pageNumber: s }, s)
784
+ children: /* @__PURE__ */ b(Ie, { style: { position: "relative" }, pageNumber: s }, s)
785
785
  }
786
786
  );
787
787
  }
788
788
  }
789
- return t.columnCount === 2 ? /* @__PURE__ */ R(
789
+ return t.columnCount === 2 ? /* @__PURE__ */ b(
790
790
  "div",
791
791
  {
792
792
  style: {
@@ -795,27 +795,27 @@ 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__ */ R(Ce, { style: { position: "relative" }, pageNumber: s }, s)
798
+ children: /* @__PURE__ */ b(Ie, { style: { position: "relative" }, pageNumber: s }, s)
799
799
  }
800
- ) : /* @__PURE__ */ R(Ce, { style: r, pageNumber: s }, s);
800
+ ) : /* @__PURE__ */ b(Ie, { style: r, pageNumber: s }, s);
801
801
  }, tr), $o = () => {
802
- const n = G(new kt()), { initialPage: e = 1, initialScrollMode: t } = bt(), { pagesRef: r, setPagesRef: s, setContentRef: l } = zt(), { scrollToPage: a } = ft();
802
+ const n = G(new kt()), { initialPage: e = 1, initialScrollMode: t } = bt(), { pagesRef: r, setPagesRef: s, setContentRef: l } = Lt(), { scrollToPage: a } = ft();
803
803
  Dt(r);
804
804
  const {
805
805
  virtualScrollRef: c,
806
806
  getVirtualScrollRef: f,
807
807
  getPageScrollElementRef: g,
808
808
  getVirtualScrollableElementRef: h,
809
- setTotalInnerDimensions: _,
809
+ setTotalInnerDimensions: w,
810
810
  virtualScrollableElementRef: i,
811
- totalInnerDimensions: y,
812
- pageScrollElementRef: w
813
- } = dt(), S = G(!0), { nextPage: D, prevPage: b, setFocusedPage: I, focusedPage: W, totalPages: A } = mt(), { scrollMode: o } = gt(), { viewMode: u } = ht(), d = G(null), { loading: m, error: C } = pt(), { passwordRequired: p } = At(), { LoaderImageComponent: T } = Mt(), z = G(
814
- y
815
- ), L = G({
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
816
  viewMode: u,
817
817
  scrollMode: o
818
- }), M = G(!1), E = G(), { isFullScreen: x } = wt(), {
818
+ }), O = G(!1), W = G(), { isFullScreen: y } = wt(), {
819
819
  pageDimension: F,
820
820
  rowCount: P,
821
821
  rowHeight: H,
@@ -824,7 +824,7 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
824
824
  estimatedColumnWidth: Z,
825
825
  estimatedRowHeight: J,
826
826
  totalDimension: Q
827
- } = ut(), ie = Lt(y, 100), { onScroll: j, onTextSelect: le } = Ft();
827
+ } = ut(), ie = zt(L, 100), { onScroll: j, onTextSelect: le } = Ft();
828
828
  Ht({ onTextSelect: le, pagesRef: r });
829
829
  const X = G();
830
830
  Ot(N, P, i, u);
@@ -835,63 +835,77 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
835
835
  yt(r);
836
836
  const { isPressed: ee } = Tt(), { selectionMode: B } = xt(), { initializeGrabScroll: K, resetGrabState: pe } = Rt({
837
837
  isPressed: ee
838
- }), te = we(() => B === vt.HAND, [B]), Qe = we(() => {
839
- const v = Array.from({ length: N }, (O, q) => k(q));
838
+ }), te = Se(() => B === vt.HAND, [B]), Qe = Se(() => {
839
+ const v = Array.from({ length: N }, (_, q) => k(q));
840
840
  return {
841
841
  columnCount: N,
842
- isDualPageWithCover: u === Se.DUAL_PAGE_WITH_COVER,
842
+ isDualPageWithCover: u === Te.DUAL_PAGE_WITH_COVER,
843
843
  columnWidths: v,
844
844
  totalPages: A
845
845
  };
846
846
  }, [N, u, k, A]), he = ae(
847
847
  (v) => {
848
- const O = document.activeElement !== r;
849
- !x && O || (["ArrowUp", "ArrowLeft"].includes(v.key) ? (v.preventDefault(), b()) : ["ArrowDown", "ArrowRight"].includes(v.key) && (v.preventDefault(), D()));
848
+ const _ = document.activeElement !== r;
849
+ !y && _ || (["ArrowUp", "ArrowLeft"].includes(v.key) ? (v.preventDefault(), z()) : ["ArrowDown", "ArrowRight"].includes(v.key) && (v.preventDefault(), D()));
850
850
  },
851
- [D, b, x, o]
851
+ [D, z, y, o]
852
852
  );
853
853
  ne(() => (window.addEventListener("keydown", he), () => {
854
854
  window.removeEventListener("keydown", he);
855
855
  }), [he]), ne(() => {
856
856
  if (d.current && (d.current.style.position = "relative"), !!c)
857
857
  for (let v = 0; v < P; v++)
858
- for (let O = 0; O < N; O++)
858
+ for (let _ = 0; _ < N; _++)
859
859
  c.resetAfterIndices({
860
- columnIndex: O,
860
+ columnIndex: _,
861
861
  rowIndex: v,
862
862
  shouldForceUpdate: !0
863
863
  });
864
864
  }, [P, N, F, c]);
865
865
  const Xe = ae(
866
- (v, O) => {
866
+ (v, _) => {
867
867
  if (!i)
868
868
  return { scrollTop: 0, scrollLeft: 0 };
869
- const q = Y.current.scrollTop > O, re = Y.current.scrollLeft > v;
869
+ const q = Y.current.scrollTop > _, re = Y.current.scrollLeft > v;
870
870
  return q || re ? Y.current : {
871
871
  scrollTop: i.scrollTop,
872
872
  scrollLeft: i.scrollLeft
873
873
  };
874
874
  },
875
875
  [i]
876
- ), Ee = ae(
877
- (v, O) => {
878
- if (L.current.viewMode !== u || L.current.scrollMode !== o) {
879
- X.current && clearTimeout(X.current), M.current = !0, a(W, "auto"), X.current = setTimeout(() => {
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(() => {
880
880
  requestAnimationFrame(() => {
881
- L.current = { viewMode: u, scrollMode: o };
881
+ E.current = { viewMode: u, scrollMode: o };
882
882
  });
883
883
  }, 100);
884
884
  return;
885
885
  }
886
886
  const re = v.scrollTop, ge = v.scrollLeft;
887
- if (!O.height || !O.width)
887
+ if (!_.height || !_.width)
888
+ return;
889
+ O.current = !0;
890
+ const { height: oe, width: ve } = _, { height: _e, width: we } = R.current;
891
+ if (_e === oe && we === ve)
888
892
  return;
889
- M.current = !0;
890
- const { height: oe, width: ve } = O, { height: Oe, width: We } = z.current;
891
- if (Oe === oe && We === ve)
893
+ if (S.current && e > 1) {
894
+ R.current = {
895
+ height: _.height,
896
+ width: _.width
897
+ };
892
898
  return;
893
- const rt = re / Oe * oe, ot = ge / We * ve, nt = Math.round(Math.min(rt, oe)) || 0, it = Math.round(Math.min(ot, ve)) || 0;
894
- E.current = setTimeout(() => {
899
+ }
900
+ if (!_e || !we) {
901
+ R.current = {
902
+ height: _.height,
903
+ width: _.width
904
+ };
905
+ return;
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(() => {
895
909
  requestAnimationFrame(() => {
896
910
  i == null || i.scrollTo({
897
911
  top: nt,
@@ -899,27 +913,27 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
899
913
  behavior: "auto"
900
914
  });
901
915
  });
902
- }, 0), z.current = {
903
- height: O.height,
904
- width: O.width
916
+ }, 0), R.current = {
917
+ height: _.height,
918
+ width: _.width
905
919
  };
906
920
  },
907
- [i, u, o, a]
921
+ [i, u, o, a, e, M]
908
922
  );
909
923
  ne(() => {
910
- clearTimeout(E.current);
924
+ clearTimeout(W.current);
911
925
  const v = Array.from({ length: P }).reduce(
912
926
  (re, ge, oe) => re + H(oe),
913
927
  0
914
- ), O = Array.from({ length: N }).reduce(
928
+ ), _ = Array.from({ length: N }).reduce(
915
929
  (re, ge, oe) => re + k(oe),
916
930
  0
917
- ), q = Xe(O, v);
918
- Y.current = q, Ee(q, { height: v, width: O }), _({
931
+ ), q = Xe(_, v);
932
+ Y.current = q, We(q, { height: v, width: _ }), w({
919
933
  height: v,
920
- width: O
934
+ width: _
921
935
  });
922
- }, [F, P, N, Ee]);
936
+ }, [F, P, N, We]);
923
937
  const Ye = ae(
924
938
  (v) => {
925
939
  Y.current = {
@@ -931,19 +945,19 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
931
945
  );
932
946
  ne(() => {
933
947
  if (j)
934
- return w && w.addEventListener("scroll", j), i && i.addEventListener("scroll", j), () => {
935
- w == null || w.removeEventListener("scroll", j), i == null || i.removeEventListener("scroll", 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);
936
950
  };
937
- }, [i, w, j]), ne(() => () => {
951
+ }, [i, C, j]), ne(() => () => {
938
952
  X.current && clearTimeout(X.current);
939
953
  }, []);
940
- const et = we(() => ce(U["rp-pages-container"], {
954
+ const et = Se(() => ce(U["rp-pages-container"], {
941
955
  [U["rp-cursor-grab"]]: te && !ee,
942
956
  [U["rp-cursor-grabbing"]]: te && ee
943
957
  }), [te, ee]), tt = ae(
944
958
  (v) => {
945
959
  if (te && v) {
946
- const O = ce(U["rp-pages"]), q = document.querySelector(`.${O}`);
960
+ const _ = ce(U["rp-pages"]), q = document.querySelector(`.${_}`);
947
961
  K(q);
948
962
  }
949
963
  },
@@ -952,21 +966,22 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
952
966
  return ne(() => {
953
967
  m && pe();
954
968
  }, [m]), ne(() => {
955
- if (!(ie.height === 0 || !S.current)) {
956
- if (t === Ie.PAGE_SCROLLING) {
957
- e !== W && w && I(e), S.current = !1;
958
- return;
959
- }
960
- a(e, "auto"), I(e), S.current = !1;
969
+ if (ie.height === 0 || !S.current)
970
+ return;
971
+ if (t === xe.PAGE_SCROLLING) {
972
+ e !== M && C && T(e), S.current = !1;
973
+ return;
961
974
  }
975
+ !i || (a(e, "auto"), !(i.scrollLeft > 0 || i.scrollTop > 0)) || (T(e), S.current = !1);
962
976
  }, [
963
977
  a,
964
978
  t,
965
- w,
966
- I,
967
- ie
968
- ]), /* @__PURE__ */ _e(st, { children: [
969
- /* @__PURE__ */ R(Pt, { ref: l, children: /* @__PURE__ */ R(
979
+ C,
980
+ T,
981
+ ie,
982
+ i
983
+ ]), /* @__PURE__ */ Ce(st, { children: [
984
+ /* @__PURE__ */ b(Pt, { ref: l, children: /* @__PURE__ */ b(
970
985
  Nt,
971
986
  {
972
987
  ref: s,
@@ -976,15 +991,15 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
976
991
  "--scale-round-x": `${Ae(n.current.sx)[1]}px`,
977
992
  "--scale-round-y": `${Ae(n.current.sy)[1]}px`
978
993
  },
979
- children: /* @__PURE__ */ R(or, { style: { minHeight: "50px" }, children: ({ width: v, height: O }) => /* @__PURE__ */ R("div", { "data-rp": "pages", ref: tt, style: { width: v, height: O }, children: o === Ie.PAGE_SCROLLING ? /* @__PURE__ */ R(
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(
980
995
  "div",
981
996
  {
982
997
  ref: g,
983
- style: { width: v, height: O },
998
+ style: { width: v, height: _ },
984
999
  className: ce(U["rp-pages"], U["rp-page-scrolling-wrapper"]),
985
- children: u === Se.DUAL_PAGE ? /* @__PURE__ */ R(Ct, { widths: k, heights: H }) : u === Se.DUAL_PAGE_WITH_COVER ? /* @__PURE__ */ R(St, { widths: k, heights: H }) : /* @__PURE__ */ R(It, { widths: k, heights: H })
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 })
986
1001
  }
987
- ) : J ? /* @__PURE__ */ R(
1002
+ ) : J ? /* @__PURE__ */ b(
988
1003
  Xt,
989
1004
  {
990
1005
  ref: f,
@@ -995,14 +1010,14 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
995
1010
  columnCount: N,
996
1011
  columnWidth: k,
997
1012
  rowHeight: H,
998
- height: O,
1013
+ height: _,
999
1014
  width: v,
1000
1015
  estimatedColumnWidth: Z,
1001
1016
  estimatedRowHeight: J,
1002
1017
  rowCount: P,
1003
1018
  className: ce(
1004
1019
  U["rp-pages"],
1005
- o === Ie.HORIZONTAL_SCROLLING ? U["rp-pages-horizontal-scroll"] : ""
1020
+ o === xe.HORIZONTAL_SCROLLING ? U["rp-pages-horizontal-scroll"] : ""
1006
1021
  ),
1007
1022
  style: {
1008
1023
  "--rp-pages-height": `${Q.height}px`,
@@ -1012,7 +1027,7 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
1012
1027
  },
1013
1028
  children: nr
1014
1029
  }
1015
- ) : !m && !C ? /* @__PURE__ */ R(
1030
+ ) : !m && !I ? /* @__PURE__ */ b(
1016
1031
  "div",
1017
1032
  {
1018
1033
  className: U["rp-loader"],
@@ -1023,22 +1038,22 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
1023
1038
  height: "100%",
1024
1039
  width: "100%"
1025
1040
  },
1026
- children: T && /* @__PURE__ */ R(T, {})
1041
+ children: x && /* @__PURE__ */ b(x, {})
1027
1042
  }
1028
- ) : C === _t.NOT_SUPPORTED ? /* @__PURE__ */ R("div", { className: U["rp-not-supported"], children: /* @__PURE__ */ _e("div", { className: U["rp-not-supported-content"], children: [
1043
+ ) : I === _t.NOT_SUPPORTED ? /* @__PURE__ */ b("div", { className: U["rp-not-supported"], children: /* @__PURE__ */ Ce("div", { className: U["rp-not-supported-content"], children: [
1029
1044
  "React PDF Kit is unable to render on this browser. Please use the supported browsers from the list below:",
1030
- /* @__PURE__ */ R("div", { children: /* @__PURE__ */ _e("ul", { className: U["rp-not-supported-list"], children: [
1031
- /* @__PURE__ */ R("li", { children: "Chrome 126+" }),
1032
- /* @__PURE__ */ R("li", { children: "Edge 126+" }),
1033
- /* @__PURE__ */ R("li", { children: "Firefox 126+" }),
1034
- /* @__PURE__ */ R("li", { children: "Safari 18.4+" }),
1035
- /* @__PURE__ */ R("li", { children: "Safari iOS 18.4+" }),
1036
- /* @__PURE__ */ R("li", { children: "Chrome Android 126+" })
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+" })
1037
1052
  ] }) })
1038
1053
  ] }) }) : null }) })
1039
1054
  }
1040
1055
  ) }),
1041
- p && /* @__PURE__ */ R(Et, {})
1056
+ p && /* @__PURE__ */ b(Et, {})
1042
1057
  ] });
1043
1058
  };
1044
1059
  export {