@pdf-viewer/react 1.14.0 → 1.15.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/{ToolbarLayout.module-07c61141.js → ToolbarLayout.module-5b9624f8.js} +994 -993
  2. package/dist/components/RPController.js +50 -48
  3. package/dist/components/RPPages.js +4 -4
  4. package/dist/components/RPProvider.js +35 -29
  5. package/dist/components/layout/LayoutContainer.js +4 -4
  6. package/dist/components/layout/RPDefaultLayout.js +4 -4
  7. package/dist/components/layout/RPLayout.js +4 -4
  8. package/dist/components/layout/sidebar/RPSidebar.js +4 -4
  9. package/dist/components/layout/sidebar/Thumbnail.js +4 -4
  10. package/dist/components/layout/sidebar/Thumbnails.js +4 -4
  11. package/dist/components/layout/toolbar/DarkModeTool.js +2 -2
  12. package/dist/components/layout/toolbar/DocumentDialog.js +4 -4
  13. package/dist/components/layout/toolbar/DocumentProperties.js +3 -3
  14. package/dist/components/layout/toolbar/FileDownloadTool.js +4 -4
  15. package/dist/components/layout/toolbar/FileUploadTool.js +3 -3
  16. package/dist/components/layout/toolbar/FullScreenTool.js +3 -3
  17. package/dist/components/layout/toolbar/MenuItem.js +3 -3
  18. package/dist/components/layout/toolbar/MenuSeparator.js +3 -3
  19. package/dist/components/layout/toolbar/MostPageTool.js +4 -4
  20. package/dist/components/layout/toolbar/OtherTool.js +4 -4
  21. package/dist/components/layout/toolbar/Paginate.js +4 -4
  22. package/dist/components/layout/toolbar/PrintTool.js +4 -4
  23. package/dist/components/layout/toolbar/RPMenuItem.js +3 -3
  24. package/dist/components/layout/toolbar/RPMoreOptions.js +4 -4
  25. package/dist/components/layout/toolbar/RPToolbar.js +4 -4
  26. package/dist/components/layout/toolbar/RPToolbarEnd.js +4 -4
  27. package/dist/components/layout/toolbar/RotateTool.js +3 -3
  28. package/dist/components/layout/toolbar/ScrollModeTool.js +3 -3
  29. package/dist/components/layout/toolbar/SearchCloseButton.js +2 -2
  30. package/dist/components/layout/toolbar/SearchResultNavigator.js +4 -4
  31. package/dist/components/layout/toolbar/SearchTool.js +4 -4
  32. package/dist/components/layout/toolbar/SelectionModeTool.js +3 -3
  33. package/dist/components/layout/toolbar/ThumbnailTool.js +4 -4
  34. package/dist/components/layout/toolbar/ToolbarCustom.js +4 -4
  35. package/dist/components/layout/toolbar/ToolbarDefault.js +4 -4
  36. package/dist/components/layout/toolbar/ToolbarLayout.js +4 -4
  37. package/dist/components/layout/toolbar/ViewModeTool.js +3 -3
  38. package/dist/components/layout/toolbar/ZoomTool.js +4 -4
  39. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +4 -4
  40. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +4 -4
  41. package/dist/components/layout/toolbar/tools/FileUploadTool.js +2 -2
  42. package/dist/components/layout/toolbar/tools/FullScreenTool.js +2 -2
  43. package/dist/components/layout/toolbar/tools/InputPageTool.js +4 -4
  44. package/dist/components/layout/toolbar/tools/NextPageTool.js +4 -4
  45. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +4 -4
  46. package/dist/components/layout/toolbar/tools/PrintTool.js +4 -4
  47. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +2 -2
  48. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +2 -2
  49. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +2 -2
  50. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +2 -2
  51. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +4 -4
  52. package/dist/components/layout/toolbar/tools/ZoomInTool.js +2 -2
  53. package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +4 -4
  54. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +4 -4
  55. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +2 -2
  56. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +4 -4
  57. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +4 -4
  58. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +3 -3
  59. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +4 -4
  60. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +4 -4
  61. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +3 -3
  62. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +4 -4
  63. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +4 -4
  64. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +3 -3
  65. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +3 -3
  66. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +3 -3
  67. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +3 -3
  68. package/dist/components/page/AnnotationLayer.js +4 -4
  69. package/dist/components/page/CanvasLayer.js +4 -4
  70. package/dist/components/page/DualPage.js +4 -4
  71. package/dist/components/page/RPPage.js +4 -4
  72. package/dist/components/page/SinglePage.js +4 -4
  73. package/dist/components/page/TextHighlightLayer.js +4 -4
  74. package/dist/components/page/TextLayer.js +4 -4
  75. package/dist/components/ui/Checkbox.js +1 -1
  76. package/dist/components/ui/DropDown.js +3 -3
  77. package/dist/components/ui/LoadingIndicator.js +4 -4
  78. package/dist/components/ui/RPTooltip.js +102 -118
  79. package/dist/contexts/PaginationContext.js +4 -4
  80. package/dist/contexts/PrintContext.js +4 -4
  81. package/dist/contexts/RPDocumentContext.js +27 -19
  82. package/dist/contexts/RenderQueueProvider.js +4 -4
  83. package/dist/contexts/SearchContext.js +4 -4
  84. package/dist/contexts/ThumbnailsContext.js +4 -4
  85. package/dist/{floating-ui.react-dom-d22a10b4.js → floating-ui.react-dom-6b2fe0df.js} +3 -3
  86. package/dist/{index-c9a2990a.js → index-35c7f4a2.js} +3 -3
  87. package/dist/{index-27c30844.js → index-f563c6f0.js} +2 -2
  88. package/dist/main.js +4 -4
  89. package/dist/types/contexts/RenderQueueProvider.d.ts +2 -2
  90. package/dist/types/utils/renderPage.d.ts +2 -2
  91. package/dist/types/utils/types.d.ts +7 -1
  92. package/dist/utils/hooks/useFileDownload.js +4 -4
  93. package/dist/utils/hooks/useLicense.js +1 -1
  94. package/dist/utils/hooks/useLoadPdf.js +42 -39
  95. package/dist/utils/hooks/usePaginate.js +4 -4
  96. package/dist/utils/hooks/usePresentPage.js +4 -4
  97. package/dist/utils/hooks/usePrint.js +4 -4
  98. package/dist/utils/hooks/useScrollToPage.js +4 -4
  99. package/dist/utils/hooks/useSearch.js +4 -4
  100. package/dist/utils/hooks/useThumbnail.js +4 -4
  101. package/dist/utils/hooks/useVirtualReactWindow.js +4 -4
  102. package/dist/utils/renderPage.js +12 -10
  103. package/package.json +1 -1
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../contexts/RPDocumentContext.js";
4
4
  import "../../contexts/DocumentPasswordContext.js";
5
- import { J as wt } from "../../ToolbarLayout.module-07c61141.js";
5
+ import { J as wt } from "../../ToolbarLayout.module-5b9624f8.js";
6
6
  import "../../contexts/DarkModeContext.js";
7
7
  import "../../contexts/RotationContext.js";
8
8
  import "../../contexts/LayerContext.js";
@@ -92,10 +92,10 @@ import "../../utils/getWordPositionInPage.js";
92
92
  import "../../utils/smoothScrollTo.js";
93
93
  import "../layout/toolbar/FileUploadTool.js";
94
94
  import "../icons/FileUploadDefaultIcon.js";
95
- import "../../index-27c30844.js";
96
- import "../../index-c9a2990a.js";
95
+ import "../../index-f563c6f0.js";
96
+ import "../../index-35c7f4a2.js";
97
97
  import "react-dom";
98
- import "../../floating-ui.react-dom-d22a10b4.js";
98
+ import "../../floating-ui.react-dom-6b2fe0df.js";
99
99
  import "../layout/toolbar/DarkModeTool.js";
100
100
  import "../icons/MoonIcon.js";
101
101
  import "../icons/SunIcon.js";
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../contexts/RPDocumentContext.js";
4
4
  import "../../contexts/DocumentPasswordContext.js";
5
- import { H as Ao } from "../../ToolbarLayout.module-07c61141.js";
5
+ import { H as Ao } from "../../ToolbarLayout.module-5b9624f8.js";
6
6
  import "../../contexts/DarkModeContext.js";
7
7
  import "../../contexts/RotationContext.js";
8
8
  import "../../contexts/LayerContext.js";
@@ -92,10 +92,10 @@ import "../../utils/getWordPositionInPage.js";
92
92
  import "../../utils/smoothScrollTo.js";
93
93
  import "../layout/toolbar/FileUploadTool.js";
94
94
  import "../icons/FileUploadDefaultIcon.js";
95
- import "../../index-27c30844.js";
96
- import "../../index-c9a2990a.js";
95
+ import "../../index-f563c6f0.js";
96
+ import "../../index-35c7f4a2.js";
97
97
  import "react-dom";
98
- import "../../floating-ui.react-dom-d22a10b4.js";
98
+ import "../../floating-ui.react-dom-6b2fe0df.js";
99
99
  import "../layout/toolbar/DarkModeTool.js";
100
100
  import "../icons/MoonIcon.js";
101
101
  import "../icons/SunIcon.js";
@@ -1,6 +1,6 @@
1
1
  import { jsx as i, jsxs as w, Fragment as U } from "react/jsx-runtime";
2
2
  import * as s from "react";
3
- import { c as z, u as B, P as E, a as S, b as G, d as K, e as X } from "../../index-c9a2990a.js";
3
+ import { c as z, u as B, P as E, a as S, b as G, d as K, e as X } from "../../index-35c7f4a2.js";
4
4
  import { CheckIcon as J } from "../icons/CheckIcon.js";
5
5
  import "react-dom";
6
6
  function Q(e) {
@@ -1,10 +1,10 @@
1
1
  import { jsxs as p, jsx as d } from "react/jsx-runtime";
2
- import { R as l, T as c, P as _, C as m } from "../../index-27c30844.js";
2
+ import { R as l, T as c, P as _, C as m } from "../../index-f563c6f0.js";
3
3
  import { c as A } from "../../clsx-0c6e471a.js";
4
4
  import "react";
5
- import "../../index-c9a2990a.js";
5
+ import "../../index-35c7f4a2.js";
6
6
  import "react-dom";
7
- import "../../floating-ui.react-dom-d22a10b4.js";
7
+ import "../../floating-ui.react-dom-6b2fe0df.js";
8
8
  const F = "_slideDownAndFade_1vzkq_1", w = "_slideLeftAndFade_1vzkq_1", f = "_slideUpAndFade_1vzkq_1", g = "_slideRightAndFade_1vzkq_1", h = {
9
9
  "rp-dropdown-content": "_rp-dropdown-content_1vzkq_1",
10
10
  slideDownAndFade: F,
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { q as Dr } from "../../ToolbarLayout.module-07c61141.js";
2
+ import { q as Dr } from "../../ToolbarLayout.module-5b9624f8.js";
3
3
  import "../../clsx-0c6e471a.js";
4
4
  import "../../contexts/LocalizationContext.js";
5
5
  import "react";
@@ -75,15 +75,15 @@ import "../icons/DarkPdfIcon.js";
75
75
  import "../../utils/hooks/useLocalization.js";
76
76
  import "../../SearchCloseButton-08d57275.js";
77
77
  import "./RPTooltip.js";
78
- import "../../index-c9a2990a.js";
78
+ import "../../index-35c7f4a2.js";
79
79
  import "react-dom";
80
- import "../../floating-ui.react-dom-d22a10b4.js";
80
+ import "../../floating-ui.react-dom-6b2fe0df.js";
81
81
  import "../icons/CloseIcon.js";
82
82
  import "./Checkbox.js";
83
83
  import "../icons/CheckIcon.js";
84
84
  import "../../contexts/IconContext.js";
85
85
  import "./DropDown.js";
86
- import "../../index-27c30844.js";
86
+ import "../../index-f563c6f0.js";
87
87
  import "../layout/toolbar/MenuItem.js";
88
88
  import "../layout/toolbar/MenuSeparator.js";
89
89
  import "../../utils/dateFormatter.js";
@@ -1,11 +1,10 @@
1
1
  import { jsx as d, jsxs as Y } from "react/jsx-runtime";
2
2
  import * as a from "react";
3
- import { useRef as Fe, useEffect as Be, useMemo as We, useLayoutEffect as Ge } from "react";
4
- import { P as S, c as ae, u as k, d as Xe, e as Ve, a as E, b as Ue, f as ze } from "../../index-c9a2990a.js";
5
- import { u as qe, a as Ze, o as Ke, s as Je, f as Qe, b as et, c as tt, h as rt, l as ot, d as nt, D as at } from "../../floating-ui.react-dom-d22a10b4.js";
6
- import { withRef as st } from "../../utils/withRef.js";
3
+ import { P as S, c as ae, u as k, d as Fe, f as oe, e as We, a as E, b as Be, g as Ge } from "../../index-35c7f4a2.js";
4
+ import { u as Xe, a as Ve, o as Ue, s as ze, f as qe, b as Ze, c as Ke, h as Je, d as Qe, l as et, e as tt, D as rt } from "../../floating-ui.react-dom-6b2fe0df.js";
5
+ import { withRef as ot } from "../../utils/withRef.js";
7
6
  import "react-dom";
8
- var it = "Arrow", se = a.forwardRef((e, r) => {
7
+ var nt = "Arrow", se = a.forwardRef((e, r) => {
9
8
  const { children: t, width: o = 10, height: n = 5, ...i } = e;
10
9
  return /* @__PURE__ */ d(
11
10
  S.svg,
@@ -20,27 +19,12 @@ var it = "Arrow", se = a.forwardRef((e, r) => {
20
19
  }
21
20
  );
22
21
  });
23
- se.displayName = it;
24
- var lt = se;
25
- function ct(e) {
26
- const r = Fe(e);
27
- return Be(() => {
28
- r.current = e;
29
- }), We(
30
- () => (...t) => {
31
- var o;
32
- return (o = r.current) === null || o === void 0 ? void 0 : o.call(r, ...t);
33
- },
34
- []
35
- );
36
- }
37
- const oe = globalThis != null && globalThis.document ? Ge : () => {
38
- };
39
- var W = "Popper", [ie, le] = ae(W), [dt, ce] = ie(W), de = (e) => {
22
+ se.displayName = nt;
23
+ var at = se, B = "Popper", [ie, le] = ae(B), [st, ce] = ie(B), de = (e) => {
40
24
  const { __scopePopper: r, children: t } = e, [o, n] = a.useState(null);
41
- return /* @__PURE__ */ d(dt, { scope: r, anchor: o, onAnchorChange: n, children: t });
25
+ return /* @__PURE__ */ d(st, { scope: r, anchor: o, onAnchorChange: n, children: t });
42
26
  };
43
- de.displayName = W;
27
+ de.displayName = B;
44
28
  var pe = "PopperAnchor", ue = a.forwardRef(
45
29
  (e, r) => {
46
30
  const { __scopePopper: t, virtualRef: o, ...n } = e, i = ce(pe, t), l = a.useRef(null), h = k(r, l), s = a.useRef(null);
@@ -51,7 +35,7 @@ var pe = "PopperAnchor", ue = a.forwardRef(
51
35
  }
52
36
  );
53
37
  ue.displayName = pe;
54
- var G = "PopperContent", [pt, ut] = ie(G), fe = a.forwardRef(
38
+ var G = "PopperContent", [it, lt] = ie(G), fe = a.forwardRef(
55
39
  (e, r) => {
56
40
  var Z, K, J, Q, ee, te;
57
41
  const {
@@ -68,43 +52,43 @@ var G = "PopperContent", [pt, ut] = ie(G), fe = a.forwardRef(
68
52
  hideWhenDetached: g = !1,
69
53
  updatePositionStrategy: u = "optimized",
70
54
  onPlaced: v,
71
- ...m
72
- } = e, y = ce(G, t), [w, x] = a.useState(null), b = k(r, (_) => x(_)), [C, T] = a.useState(null), P = Xe(C), N = (P == null ? void 0 : P.width) ?? 0, V = (P == null ? void 0 : P.height) ?? 0, Ee = o + (i !== "center" ? "-" + i : ""), Re = typeof c == "number" ? c : { top: 0, right: 0, bottom: 0, left: 0, ...c }, U = Array.isArray(p) ? p : [p], _e = U.length > 0, D = {
55
+ ...y
56
+ } = e, m = ce(G, t), [w, x] = a.useState(null), T = k(r, (_) => x(_)), [C, b] = a.useState(null), P = Fe(C), N = (P == null ? void 0 : P.width) ?? 0, V = (P == null ? void 0 : P.height) ?? 0, Ee = o + (i !== "center" ? "-" + i : ""), Re = typeof c == "number" ? c : { top: 0, right: 0, bottom: 0, left: 0, ...c }, U = Array.isArray(p) ? p : [p], _e = U.length > 0, D = {
73
57
  padding: Re,
74
- boundary: U.filter(ht),
58
+ boundary: U.filter(dt),
75
59
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
76
60
  altBoundary: _e
77
- }, { refs: Oe, floatingStyles: z, placement: Se, isPositioned: H, middlewareData: A } = qe({
61
+ }, { refs: Oe, floatingStyles: z, placement: Se, isPositioned: H, middlewareData: A } = Xe({
78
62
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
79
63
  strategy: "fixed",
80
64
  placement: Ee,
81
- whileElementsMounted: (..._) => Ze(..._, {
65
+ whileElementsMounted: (..._) => Ve(..._, {
82
66
  animationFrame: u === "always"
83
67
  }),
84
68
  elements: {
85
- reference: y.anchor
69
+ reference: m.anchor
86
70
  },
87
71
  middleware: [
88
- Ke({ mainAxis: n + V, alignmentAxis: l }),
89
- s && Je({
72
+ Ue({ mainAxis: n + V, alignmentAxis: l }),
73
+ s && ze({
90
74
  mainAxis: !0,
91
75
  crossAxis: !1,
92
- limiter: f === "partial" ? ot() : void 0,
76
+ limiter: f === "partial" ? et() : void 0,
93
77
  ...D
94
78
  }),
95
- s && Qe({ ...D }),
96
- et({
79
+ s && qe({ ...D }),
80
+ Ze({
97
81
  ...D,
98
82
  apply: ({ elements: _, rects: re, availableWidth: Me, availableHeight: $e }) => {
99
83
  const { width: je, height: Ye } = re.reference, L = _.floating.style;
100
84
  L.setProperty("--radix-popper-available-width", `${Me}px`), L.setProperty("--radix-popper-available-height", `${$e}px`), L.setProperty("--radix-popper-anchor-width", `${je}px`), L.setProperty("--radix-popper-anchor-height", `${Ye}px`);
101
85
  }
102
86
  }),
103
- C && tt({ element: C, padding: h }),
104
- vt({ arrowWidth: N, arrowHeight: V }),
105
- g && rt({ strategy: "referenceHidden", ...D })
87
+ C && Ke({ element: C, padding: h }),
88
+ pt({ arrowWidth: N, arrowHeight: V }),
89
+ g && Je({ strategy: "referenceHidden", ...D })
106
90
  ]
107
- }), [q, Ne] = ge(Se), I = ct(v);
91
+ }), [q, Ne] = ge(Se), I = Qe(v);
108
92
  oe(() => {
109
93
  H && (I == null || I());
110
94
  }, [H, I]);
@@ -136,11 +120,11 @@ var G = "PopperContent", [pt, ut] = ie(G), fe = a.forwardRef(
136
120
  },
137
121
  dir: e.dir,
138
122
  children: /* @__PURE__ */ d(
139
- pt,
123
+ it,
140
124
  {
141
125
  scope: t,
142
126
  placedSide: q,
143
- onArrowChange: T,
127
+ onArrowChange: b,
144
128
  arrowX: De,
145
129
  arrowY: He,
146
130
  shouldHideArrow: Ie,
@@ -149,10 +133,10 @@ var G = "PopperContent", [pt, ut] = ie(G), fe = a.forwardRef(
149
133
  {
150
134
  "data-side": q,
151
135
  "data-align": Ne,
152
- ...m,
153
- ref: b,
136
+ ...y,
137
+ ref: T,
154
138
  style: {
155
- ...m.style,
139
+ ...y.style,
156
140
  // if the PopperContent hasn't been placed yet (not all measurements done)
157
141
  // we prevent animations so that users's animation don't kick in too early referring wrong sides
158
142
  animation: H ? void 0 : "none"
@@ -166,13 +150,13 @@ var G = "PopperContent", [pt, ut] = ie(G), fe = a.forwardRef(
166
150
  }
167
151
  );
168
152
  fe.displayName = G;
169
- var he = "PopperArrow", ft = {
153
+ var he = "PopperArrow", ct = {
170
154
  top: "bottom",
171
155
  right: "left",
172
156
  bottom: "top",
173
157
  left: "right"
174
158
  }, ve = a.forwardRef(function(r, t) {
175
- const { __scopePopper: o, ...n } = r, i = ut(he, o), l = ft[i.placedSide];
159
+ const { __scopePopper: o, ...n } = r, i = lt(he, o), l = ct[i.placedSide];
176
160
  return (
177
161
  // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
178
162
  // doesn't report size as we'd expect on SVG elements.
@@ -201,7 +185,7 @@ var he = "PopperArrow", ft = {
201
185
  visibility: i.shouldHideArrow ? "hidden" : void 0
202
186
  },
203
187
  children: /* @__PURE__ */ d(
204
- lt,
188
+ at,
205
189
  {
206
190
  ...n,
207
191
  ref: t,
@@ -217,24 +201,24 @@ var he = "PopperArrow", ft = {
217
201
  );
218
202
  });
219
203
  ve.displayName = he;
220
- function ht(e) {
204
+ function dt(e) {
221
205
  return e !== null;
222
206
  }
223
- var vt = (e) => ({
207
+ var pt = (e) => ({
224
208
  name: "transformOrigin",
225
209
  options: e,
226
210
  fn(r) {
227
- var y, w, x;
228
- const { placement: t, rects: o, middlewareData: n } = r, l = ((y = n.arrow) == null ? void 0 : y.centerOffset) !== 0, h = l ? 0 : e.arrowWidth, s = l ? 0 : e.arrowHeight, [p, c] = ge(t), f = { start: "0%", center: "50%", end: "100%" }[c], g = (((w = n.arrow) == null ? void 0 : w.x) ?? 0) + h / 2, u = (((x = n.arrow) == null ? void 0 : x.y) ?? 0) + s / 2;
229
- let v = "", m = "";
230
- return p === "bottom" ? (v = l ? f : `${g}px`, m = `${-s}px`) : p === "top" ? (v = l ? f : `${g}px`, m = `${o.floating.height + s}px`) : p === "right" ? (v = `${-s}px`, m = l ? f : `${u}px`) : p === "left" && (v = `${o.floating.width + s}px`, m = l ? f : `${u}px`), { data: { x: v, y: m } };
211
+ var m, w, x;
212
+ const { placement: t, rects: o, middlewareData: n } = r, l = ((m = n.arrow) == null ? void 0 : m.centerOffset) !== 0, h = l ? 0 : e.arrowWidth, s = l ? 0 : e.arrowHeight, [p, c] = ge(t), f = { start: "0%", center: "50%", end: "100%" }[c], g = (((w = n.arrow) == null ? void 0 : w.x) ?? 0) + h / 2, u = (((x = n.arrow) == null ? void 0 : x.y) ?? 0) + s / 2;
213
+ let v = "", y = "";
214
+ return p === "bottom" ? (v = l ? f : `${g}px`, y = `${-s}px`) : p === "top" ? (v = l ? f : `${g}px`, y = `${o.floating.height + s}px`) : p === "right" ? (v = `${-s}px`, y = l ? f : `${u}px`) : p === "left" && (v = `${o.floating.width + s}px`, y = l ? f : `${u}px`), { data: { x: v, y } };
231
215
  }
232
216
  });
233
217
  function ge(e) {
234
218
  const [r, t = "center"] = e.split("-");
235
219
  return [r, t];
236
220
  }
237
- var gt = de, mt = ue, yt = fe, wt = ve, xt = Object.freeze({
221
+ var ut = de, ft = ue, ht = fe, vt = ve, gt = Object.freeze({
238
222
  // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
239
223
  position: "absolute",
240
224
  border: 0,
@@ -246,23 +230,23 @@ var gt = de, mt = ue, yt = fe, wt = ve, xt = Object.freeze({
246
230
  clip: "rect(0, 0, 0, 0)",
247
231
  whiteSpace: "nowrap",
248
232
  wordWrap: "normal"
249
- }), Ct = "VisuallyHidden", me = a.forwardRef(
233
+ }), yt = "VisuallyHidden", ye = a.forwardRef(
250
234
  (e, r) => /* @__PURE__ */ d(
251
235
  S.span,
252
236
  {
253
237
  ...e,
254
238
  ref: r,
255
- style: { ...xt, ...e.style }
239
+ style: { ...gt, ...e.style }
256
240
  }
257
241
  )
258
242
  );
259
- me.displayName = Ct;
260
- var Pt = me, [M, Ut] = ae("Tooltip", [
243
+ ye.displayName = yt;
244
+ var mt = ye, [M, Wt] = ae("Tooltip", [
261
245
  le
262
- ]), $ = le(), ye = "TooltipProvider", bt = 700, F = "tooltip.open", [Tt, X] = M(ye), we = (e) => {
246
+ ]), $ = le(), me = "TooltipProvider", wt = 700, F = "tooltip.open", [xt, X] = M(me), we = (e) => {
263
247
  const {
264
248
  __scopeTooltip: r,
265
- delayDuration: t = bt,
249
+ delayDuration: t = wt,
266
250
  skipDelayDuration: o = 300,
267
251
  disableHoverableContent: n = !1,
268
252
  children: i
@@ -271,7 +255,7 @@ var Pt = me, [M, Ut] = ae("Tooltip", [
271
255
  const p = s.current;
272
256
  return () => window.clearTimeout(p);
273
257
  }, []), /* @__PURE__ */ d(
274
- Tt,
258
+ xt,
275
259
  {
276
260
  scope: r,
277
261
  isOpenDelayedRef: l,
@@ -294,8 +278,8 @@ var Pt = me, [M, Ut] = ae("Tooltip", [
294
278
  }
295
279
  );
296
280
  };
297
- we.displayName = ye;
298
- var O = "Tooltip", [At, j] = M(O), xe = (e) => {
281
+ we.displayName = me;
282
+ var O = "Tooltip", [Ct, j] = M(O), xe = (e) => {
299
283
  const {
300
284
  __scopeTooltip: r,
301
285
  children: t,
@@ -304,51 +288,51 @@ var O = "Tooltip", [At, j] = M(O), xe = (e) => {
304
288
  onOpenChange: i,
305
289
  disableHoverableContent: l,
306
290
  delayDuration: h
307
- } = e, s = X(O, e.__scopeTooltip), p = $(r), [c, f] = a.useState(null), g = nt(), u = a.useRef(0), v = l ?? s.disableHoverableContent, m = h ?? s.delayDuration, y = a.useRef(!1), [w, x] = Ve({
291
+ } = e, s = X(O, e.__scopeTooltip), p = $(r), [c, f] = a.useState(null), g = tt(), u = a.useRef(0), v = l ?? s.disableHoverableContent, y = h ?? s.delayDuration, m = a.useRef(!1), [w, x] = We({
308
292
  prop: o,
309
293
  defaultProp: n ?? !1,
310
294
  onChange: (N) => {
311
295
  N ? (s.onOpen(), document.dispatchEvent(new CustomEvent(F))) : s.onClose(), i == null || i(N);
312
296
  },
313
297
  caller: O
314
- }), b = a.useMemo(() => w ? y.current ? "delayed-open" : "instant-open" : "closed", [w]), C = a.useCallback(() => {
315
- window.clearTimeout(u.current), u.current = 0, y.current = !1, x(!0);
316
- }, [x]), T = a.useCallback(() => {
298
+ }), T = a.useMemo(() => w ? m.current ? "delayed-open" : "instant-open" : "closed", [w]), C = a.useCallback(() => {
299
+ window.clearTimeout(u.current), u.current = 0, m.current = !1, x(!0);
300
+ }, [x]), b = a.useCallback(() => {
317
301
  window.clearTimeout(u.current), u.current = 0, x(!1);
318
302
  }, [x]), P = a.useCallback(() => {
319
303
  window.clearTimeout(u.current), u.current = window.setTimeout(() => {
320
- y.current = !0, x(!0), u.current = 0;
321
- }, m);
322
- }, [m, x]);
304
+ m.current = !0, x(!0), u.current = 0;
305
+ }, y);
306
+ }, [y, x]);
323
307
  return a.useEffect(() => () => {
324
308
  u.current && (window.clearTimeout(u.current), u.current = 0);
325
- }, []), /* @__PURE__ */ d(gt, { ...p, children: /* @__PURE__ */ d(
326
- At,
309
+ }, []), /* @__PURE__ */ d(ut, { ...p, children: /* @__PURE__ */ d(
310
+ Ct,
327
311
  {
328
312
  scope: r,
329
313
  contentId: g,
330
314
  open: w,
331
- stateAttribute: b,
315
+ stateAttribute: T,
332
316
  trigger: c,
333
317
  onTriggerChange: f,
334
318
  onTriggerEnter: a.useCallback(() => {
335
319
  s.isOpenDelayedRef.current ? P() : C();
336
320
  }, [s.isOpenDelayedRef, P, C]),
337
321
  onTriggerLeave: a.useCallback(() => {
338
- v ? T() : (window.clearTimeout(u.current), u.current = 0);
339
- }, [T, v]),
322
+ v ? b() : (window.clearTimeout(u.current), u.current = 0);
323
+ }, [b, v]),
340
324
  onOpen: C,
341
- onClose: T,
325
+ onClose: b,
342
326
  disableHoverableContent: v,
343
327
  children: t
344
328
  }
345
329
  ) });
346
330
  };
347
331
  xe.displayName = O;
348
- var B = "TooltipTrigger", Ce = a.forwardRef(
332
+ var W = "TooltipTrigger", Ce = a.forwardRef(
349
333
  (e, r) => {
350
- const { __scopeTooltip: t, ...o } = e, n = j(B, t), i = X(B, t), l = $(t), h = a.useRef(null), s = k(r, h, n.onTriggerChange), p = a.useRef(!1), c = a.useRef(!1), f = a.useCallback(() => p.current = !1, []);
351
- return a.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ d(mt, { asChild: !0, ...l, children: /* @__PURE__ */ d(
334
+ const { __scopeTooltip: t, ...o } = e, n = j(W, t), i = X(W, t), l = $(t), h = a.useRef(null), s = k(r, h, n.onTriggerChange), p = a.useRef(!1), c = a.useRef(!1), f = a.useCallback(() => p.current = !1, []);
335
+ return a.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ d(ft, { asChild: !0, ...l, children: /* @__PURE__ */ d(
352
336
  S.button,
353
337
  {
354
338
  "aria-describedby": n.open ? n.contentId : void 0,
@@ -373,41 +357,41 @@ var B = "TooltipTrigger", Ce = a.forwardRef(
373
357
  ) });
374
358
  }
375
359
  );
376
- Ce.displayName = B;
377
- var Et = "TooltipPortal", [zt, Rt] = M(Et, {
360
+ Ce.displayName = W;
361
+ var Pt = "TooltipPortal", [Bt, Tt] = M(Pt, {
378
362
  forceMount: void 0
379
363
  }), R = "TooltipContent", Pe = a.forwardRef(
380
364
  (e, r) => {
381
- const t = Rt(R, e.__scopeTooltip), { forceMount: o = t.forceMount, side: n = "top", ...i } = e, l = j(R, e.__scopeTooltip);
382
- return /* @__PURE__ */ d(Ue, { present: o || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ d(be, { side: n, ...i, ref: r }) : /* @__PURE__ */ d(_t, { side: n, ...i, ref: r }) });
365
+ const t = Tt(R, e.__scopeTooltip), { forceMount: o = t.forceMount, side: n = "top", ...i } = e, l = j(R, e.__scopeTooltip);
366
+ return /* @__PURE__ */ d(Be, { present: o || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ d(Te, { side: n, ...i, ref: r }) : /* @__PURE__ */ d(bt, { side: n, ...i, ref: r }) });
383
367
  }
384
- ), _t = a.forwardRef((e, r) => {
368
+ ), bt = a.forwardRef((e, r) => {
385
369
  const t = j(R, e.__scopeTooltip), o = X(R, e.__scopeTooltip), n = a.useRef(null), i = k(r, n), [l, h] = a.useState(null), { trigger: s, onClose: p } = t, c = n.current, { onPointerInTransitChange: f } = o, g = a.useCallback(() => {
386
370
  h(null), f(!1);
387
371
  }, [f]), u = a.useCallback(
388
- (v, m) => {
389
- const y = v.currentTarget, w = { x: v.clientX, y: v.clientY }, x = Dt(w, y.getBoundingClientRect()), b = Ht(w, x), C = It(m.getBoundingClientRect()), T = kt([...b, ...C]);
390
- h(T), f(!0);
372
+ (v, y) => {
373
+ const m = v.currentTarget, w = { x: v.clientX, y: v.clientY }, x = _t(w, m.getBoundingClientRect()), T = Ot(w, x), C = St(y.getBoundingClientRect()), b = Dt([...T, ...C]);
374
+ h(b), f(!0);
391
375
  },
392
376
  [f]
393
377
  );
394
378
  return a.useEffect(() => () => g(), [g]), a.useEffect(() => {
395
379
  if (s && c) {
396
- const v = (y) => u(y, c), m = (y) => u(y, s);
397
- return s.addEventListener("pointerleave", v), c.addEventListener("pointerleave", m), () => {
398
- s.removeEventListener("pointerleave", v), c.removeEventListener("pointerleave", m);
380
+ const v = (m) => u(m, c), y = (m) => u(m, s);
381
+ return s.addEventListener("pointerleave", v), c.addEventListener("pointerleave", y), () => {
382
+ s.removeEventListener("pointerleave", v), c.removeEventListener("pointerleave", y);
399
383
  };
400
384
  }
401
385
  }, [s, c, u, g]), a.useEffect(() => {
402
386
  if (l) {
403
- const v = (m) => {
404
- const y = m.target, w = { x: m.clientX, y: m.clientY }, x = (s == null ? void 0 : s.contains(y)) || (c == null ? void 0 : c.contains(y)), b = !Lt(w, l);
405
- x ? g() : b && (g(), p());
387
+ const v = (y) => {
388
+ const m = y.target, w = { x: y.clientX, y: y.clientY }, x = (s == null ? void 0 : s.contains(m)) || (c == null ? void 0 : c.contains(m)), T = !Nt(w, l);
389
+ x ? g() : T && (g(), p());
406
390
  };
407
391
  return document.addEventListener("pointermove", v), () => document.removeEventListener("pointermove", v);
408
392
  }
409
- }, [s, c, l, p, g]), /* @__PURE__ */ d(be, { ...e, ref: i });
410
- }), [Ot, St] = M(O, { isInside: !1 }), Nt = ze("TooltipContent"), be = a.forwardRef(
393
+ }, [s, c, l, p, g]), /* @__PURE__ */ d(Te, { ...e, ref: i });
394
+ }), [At, Et] = M(O, { isInside: !1 }), Rt = Ge("TooltipContent"), Te = a.forwardRef(
411
395
  (e, r) => {
412
396
  const {
413
397
  __scopeTooltip: t,
@@ -426,7 +410,7 @@ var Et = "TooltipPortal", [zt, Rt] = M(Et, {
426
410
  return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
427
411
  }
428
412
  }, [s.trigger, c]), /* @__PURE__ */ d(
429
- at,
413
+ rt,
430
414
  {
431
415
  asChild: !0,
432
416
  disableOutsidePointerEvents: !1,
@@ -435,7 +419,7 @@ var Et = "TooltipPortal", [zt, Rt] = M(Et, {
435
419
  onFocusOutside: (f) => f.preventDefault(),
436
420
  onDismiss: c,
437
421
  children: /* @__PURE__ */ Y(
438
- yt,
422
+ ht,
439
423
  {
440
424
  "data-state": s.stateAttribute,
441
425
  ...p,
@@ -450,8 +434,8 @@ var Et = "TooltipPortal", [zt, Rt] = M(Et, {
450
434
  "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
451
435
  },
452
436
  children: [
453
- /* @__PURE__ */ d(Nt, { children: o }),
454
- /* @__PURE__ */ d(Ot, { scope: t, isInside: !0, children: /* @__PURE__ */ d(Pt, { id: s.contentId, role: "tooltip", children: n || o }) })
437
+ /* @__PURE__ */ d(Rt, { children: o }),
438
+ /* @__PURE__ */ d(At, { scope: t, isInside: !0, children: /* @__PURE__ */ d(mt, { id: s.contentId, role: "tooltip", children: n || o }) })
455
439
  ]
456
440
  }
457
441
  )
@@ -460,17 +444,17 @@ var Et = "TooltipPortal", [zt, Rt] = M(Et, {
460
444
  }
461
445
  );
462
446
  Pe.displayName = R;
463
- var Te = "TooltipArrow", Ae = a.forwardRef(
447
+ var be = "TooltipArrow", Ae = a.forwardRef(
464
448
  (e, r) => {
465
449
  const { __scopeTooltip: t, ...o } = e, n = $(t);
466
- return St(
467
- Te,
450
+ return Et(
451
+ be,
468
452
  t
469
- ).isInside ? null : /* @__PURE__ */ d(wt, { ...n, ...o, ref: r });
453
+ ).isInside ? null : /* @__PURE__ */ d(vt, { ...n, ...o, ref: r });
470
454
  }
471
455
  );
472
- Ae.displayName = Te;
473
- function Dt(e, r) {
456
+ Ae.displayName = be;
457
+ function _t(e, r) {
474
458
  const t = Math.abs(r.top - e.y), o = Math.abs(r.bottom - e.y), n = Math.abs(r.right - e.x), i = Math.abs(r.left - e.x);
475
459
  switch (Math.min(t, o, n, i)) {
476
460
  case i:
@@ -485,7 +469,7 @@ function Dt(e, r) {
485
469
  throw new Error("unreachable");
486
470
  }
487
471
  }
488
- function Ht(e, r, t = 5) {
472
+ function Ot(e, r, t = 5) {
489
473
  const o = [];
490
474
  switch (r) {
491
475
  case "top":
@@ -515,7 +499,7 @@ function Ht(e, r, t = 5) {
515
499
  }
516
500
  return o;
517
501
  }
518
- function It(e) {
502
+ function St(e) {
519
503
  const { top: r, right: t, bottom: o, left: n } = e;
520
504
  return [
521
505
  { x: n, y: r },
@@ -524,7 +508,7 @@ function It(e) {
524
508
  { x: n, y: o }
525
509
  ];
526
510
  }
527
- function Lt(e, r) {
511
+ function Nt(e, r) {
528
512
  const { x: t, y: o } = e;
529
513
  let n = !1;
530
514
  for (let i = 0, l = r.length - 1; i < r.length; l = i++) {
@@ -533,11 +517,11 @@ function Lt(e, r) {
533
517
  }
534
518
  return n;
535
519
  }
536
- function kt(e) {
520
+ function Dt(e) {
537
521
  const r = e.slice();
538
- return r.sort((t, o) => t.x < o.x ? -1 : t.x > o.x ? 1 : t.y < o.y ? -1 : t.y > o.y ? 1 : 0), Mt(r);
522
+ return r.sort((t, o) => t.x < o.x ? -1 : t.x > o.x ? 1 : t.y < o.y ? -1 : t.y > o.y ? 1 : 0), Ht(r);
539
523
  }
540
- function Mt(e) {
524
+ function Ht(e) {
541
525
  if (e.length <= 1)
542
526
  return e.slice();
543
527
  const r = [];
@@ -567,11 +551,11 @@ function Mt(e) {
567
551
  }
568
552
  return t.pop(), r.length === 1 && t.length === 1 && r[0].x === t[0].x && r[0].y === t[0].y ? r : r.concat(t);
569
553
  }
570
- const $t = "_tooltipContent_12gjy_1", jt = "_tooltipArrow_12gjy_8", Yt = "_fadeIn_12gjy_1", ne = {
571
- tooltipContent: $t,
572
- tooltipArrow: jt,
573
- fadeIn: Yt
574
- }, qt = st(
554
+ const It = "_tooltipContent_12gjy_1", Lt = "_tooltipArrow_12gjy_8", kt = "_fadeIn_12gjy_1", ne = {
555
+ tooltipContent: It,
556
+ tooltipArrow: Lt,
557
+ fadeIn: kt
558
+ }, Gt = ot(
575
559
  ({ children: e, content: r, className: t, style: o }, n) => /* @__PURE__ */ d(we, { children: /* @__PURE__ */ Y(xe, { delayDuration: 1e3, children: [
576
560
  /* @__PURE__ */ d(Ce, { asChild: !0, children: /* @__PURE__ */ d("div", { ref: n, className: t, style: o, children: e }) }),
577
561
  /* @__PURE__ */ Y(Pe, { className: ne.tooltipContent, sideOffset: 5, children: [
@@ -581,5 +565,5 @@ const $t = "_tooltipContent_12gjy_1", jt = "_tooltipArrow_12gjy_8", Yt = "_fadeI
581
565
  ] }) })
582
566
  );
583
567
  export {
584
- qt as default
568
+ Gt as default
585
569
  };
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { w as Bt, P as Dt, u as Et } from "../ToolbarLayout.module-07c61141.js";
3
+ import { w as Bt, P as Dt, u as Et } from "../ToolbarLayout.module-5b9624f8.js";
4
4
  import "./RPDocumentContext.js";
5
5
  import "../utils/appConsole.js";
6
6
  import "./GlobalCurrentPage.js";
@@ -75,15 +75,15 @@ import "../components/icons/LightPdfIcon.js";
75
75
  import "../components/icons/DarkPdfIcon.js";
76
76
  import "../SearchCloseButton-08d57275.js";
77
77
  import "../components/ui/RPTooltip.js";
78
- import "../index-c9a2990a.js";
78
+ import "../index-35c7f4a2.js";
79
79
  import "react-dom";
80
- import "../floating-ui.react-dom-d22a10b4.js";
80
+ import "../floating-ui.react-dom-6b2fe0df.js";
81
81
  import "../components/icons/CloseIcon.js";
82
82
  import "../components/ui/Checkbox.js";
83
83
  import "../components/icons/CheckIcon.js";
84
84
  import "./IconContext.js";
85
85
  import "../components/ui/DropDown.js";
86
- import "../index-27c30844.js";
86
+ import "../index-f563c6f0.js";
87
87
  import "../components/layout/toolbar/MenuItem.js";
88
88
  import "../components/layout/toolbar/MenuSeparator.js";
89
89
  import "../utils/dateFormatter.js";
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { y as Ar, g as Br, c as Dr } from "../ToolbarLayout.module-07c61141.js";
3
+ import { y as Ar, g as Br, c as Dr } from "../ToolbarLayout.module-5b9624f8.js";
4
4
  import "../components/icons/ChevronUpIcon.js";
5
5
  import "../components/ui/Button.js";
6
6
  import "../clsx-0c6e471a.js";
@@ -75,15 +75,15 @@ import "../components/icons/LightPdfIcon.js";
75
75
  import "../components/icons/DarkPdfIcon.js";
76
76
  import "../SearchCloseButton-08d57275.js";
77
77
  import "../components/ui/RPTooltip.js";
78
- import "../index-c9a2990a.js";
78
+ import "../index-35c7f4a2.js";
79
79
  import "react-dom";
80
- import "../floating-ui.react-dom-d22a10b4.js";
80
+ import "../floating-ui.react-dom-6b2fe0df.js";
81
81
  import "../components/icons/CloseIcon.js";
82
82
  import "../components/ui/Checkbox.js";
83
83
  import "../components/icons/CheckIcon.js";
84
84
  import "./IconContext.js";
85
85
  import "../components/ui/DropDown.js";
86
- import "../index-27c30844.js";
86
+ import "../index-f563c6f0.js";
87
87
  import "../components/layout/toolbar/MenuItem.js";
88
88
  import "../components/layout/toolbar/MenuSeparator.js";
89
89
  import "../utils/dateFormatter.js";