@react-pdf-kit/viewer 2.0.0-beta.0 → 2.0.0-beta.10

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 (212) hide show
  1. package/dist/Combination-54a77a7a.js +701 -0
  2. package/dist/MostPageTool.module-13578ad6.js +6 -0
  3. package/dist/OtherTool.module-a4be5f1f.js +6 -0
  4. package/dist/Paginate.module-206a7d7d.js +8 -0
  5. package/dist/PaginationContext-9217cab4.js +201 -0
  6. package/dist/{LayoutWrapper-a871c161.js → RPLayout.module-967bf4bc.js} +3 -9
  7. package/dist/RPToolbar.module-27d7fe77.js +10 -0
  8. package/dist/{RotateTool.module-03987eba.js → RotateTool.module-67946714.js} +1 -1
  9. package/dist/SearchTool.module-99f60dc7.js +16 -0
  10. package/dist/ToolbarLayout.module-1fee0a18.js +11 -0
  11. package/dist/{ZoomTool.module-6c5eabbb.js → ZoomTool.module-7082af8c.js} +1 -1
  12. package/dist/assets/style.css +1 -0
  13. package/dist/assets/style.js +75 -0
  14. package/dist/components/RPConfig.js +14 -1489
  15. package/dist/components/RPController.js +109 -66
  16. package/dist/components/RPDropFileZone.js +26 -12
  17. package/dist/components/RPPages.js +991 -58
  18. package/dist/components/RPProvider.js +107 -19
  19. package/dist/components/RPTheme.js +6 -5
  20. package/dist/components/icons/DualPageIcon.js +6 -6
  21. package/dist/components/icons/LoaderIcon.js +1 -1
  22. package/dist/components/icons/SinglePageIcon.js +6 -6
  23. package/dist/components/layout/Container.js +1 -1
  24. package/dist/components/layout/LayoutContainer.js +32 -57
  25. package/dist/components/layout/LayoutWrapper.js +9 -4
  26. package/dist/components/layout/RPDefaultLayout.js +214 -14
  27. package/dist/components/layout/RPLayout.js +143 -41
  28. package/dist/components/layout/WrapperLayout.js +22 -9
  29. package/dist/components/layout/sidebar/RPSidebar.js +110 -13
  30. package/dist/components/layout/sidebar/RPSplitter.js +1 -1
  31. package/dist/components/layout/sidebar/Thumbnail.js +129 -52
  32. package/dist/components/layout/sidebar/Thumbnails.js +75 -6
  33. package/dist/components/layout/toolbar/DarkModeTool.js +24 -13
  34. package/dist/components/layout/toolbar/DocumentDialog.js +311 -56
  35. package/dist/components/layout/toolbar/DocumentProperties.js +21 -8
  36. package/dist/components/layout/toolbar/FileDownloadTool.js +48 -13
  37. package/dist/components/layout/toolbar/FileUploadTool.js +34 -10
  38. package/dist/components/layout/toolbar/FullScreenTool.js +43 -28
  39. package/dist/components/layout/toolbar/MenuItem.js +15 -8
  40. package/dist/components/layout/toolbar/MenuSeparator.js +11 -4
  41. package/dist/components/layout/toolbar/MostPageTool.js +72 -51
  42. package/dist/components/layout/toolbar/OtherTool.js +188 -22
  43. package/dist/components/layout/toolbar/Paginate.js +136 -17
  44. package/dist/components/layout/toolbar/PrintTool.js +70 -13
  45. package/dist/components/layout/toolbar/PropertyItem.js +1 -1
  46. package/dist/components/layout/toolbar/RPMenuItem.js +23 -13
  47. package/dist/components/layout/toolbar/RPMoreOptions.js +119 -47
  48. package/dist/components/layout/toolbar/RPToolbar.js +148 -8
  49. package/dist/components/layout/toolbar/RPToolbarEnd.js +118 -7
  50. package/dist/components/layout/toolbar/RotateTool.js +42 -18
  51. package/dist/components/layout/toolbar/ScrollModeTool.js +33 -21
  52. package/dist/components/layout/toolbar/SearchCloseButton.js +30 -7
  53. package/dist/components/layout/toolbar/SearchResultNavigator.js +87 -8
  54. package/dist/components/layout/toolbar/SearchTool.js +236 -54
  55. package/dist/components/layout/toolbar/SelectionModeTool.js +22 -10
  56. package/dist/components/layout/toolbar/ThumbnailTool.js +32 -10
  57. package/dist/components/layout/toolbar/ToolbarCustom.js +52 -55
  58. package/dist/components/layout/toolbar/ToolbarDefault.js +144 -58
  59. package/dist/components/layout/toolbar/ToolbarLayout.js +149 -6
  60. package/dist/components/layout/toolbar/ViewModeTool.js +31 -19
  61. package/dist/components/layout/toolbar/ZoomTool.js +104 -84
  62. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +38 -12
  63. package/dist/components/layout/toolbar/tools/DualPageTool.js +26 -0
  64. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +31 -9
  65. package/dist/components/layout/toolbar/tools/FileUploadTool.js +29 -8
  66. package/dist/components/layout/toolbar/tools/FullScreenTool.js +25 -13
  67. package/dist/components/layout/toolbar/tools/InputPageTool.js +66 -26
  68. package/dist/components/layout/toolbar/tools/NextPageTool.js +36 -47
  69. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +51 -11
  70. package/dist/components/layout/toolbar/tools/PrintTool.js +29 -7
  71. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +31 -8
  72. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +34 -11
  73. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +31 -0
  74. package/dist/components/layout/toolbar/tools/SinglePageTool.js +26 -0
  75. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +17 -6
  76. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +35 -13
  77. package/dist/components/layout/toolbar/tools/ZoomInTool.js +49 -20
  78. package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +27 -0
  79. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +57 -23
  80. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +47 -18
  81. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +122 -45
  82. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +37 -11
  83. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +18 -5
  84. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +36 -11
  85. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +25 -50
  86. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +24 -9
  87. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +47 -54
  88. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +32 -7
  89. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +36 -12
  90. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +26 -14
  91. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +27 -15
  92. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +30 -18
  93. package/dist/components/page/AnnotationLayer.js +130 -54
  94. package/dist/components/page/CanvasLayer.js +62 -49
  95. package/dist/components/page/CustomElement.js +49 -18
  96. package/dist/components/page/DualPage.js +97 -4
  97. package/dist/components/page/RPPage.js +134 -51
  98. package/dist/components/page/SinglePage.js +87 -4
  99. package/dist/components/page/TextHighlightLayer.js +195 -57
  100. package/dist/components/page/TextLayer.js +193 -52
  101. package/dist/components/ui/Button.js +9 -8
  102. package/dist/components/ui/Checkbox.js +27 -25
  103. package/dist/components/ui/DropDown.js +21 -14
  104. package/dist/components/ui/Input.js +10 -9
  105. package/dist/components/ui/LoadingIndicator.js +45 -5
  106. package/dist/components/ui/PasswordModal.js +18 -15
  107. package/dist/components/ui/RPTooltip.js +98 -95
  108. package/dist/contexts/DimensionPagesContext.js +35 -17
  109. package/dist/contexts/DropFileZoneContext.js +32 -22
  110. package/dist/contexts/ElementPageContext.js +114 -51
  111. package/dist/contexts/EventCallbackContext.js +30 -0
  112. package/dist/contexts/FileInputContext.js +32 -22
  113. package/dist/contexts/FullScreenContext.js +17 -10
  114. package/dist/contexts/GlobalCurrentPage.js +13 -10
  115. package/dist/contexts/HighlightContext.js +24 -11
  116. package/dist/contexts/LicenseContext.js +1 -0
  117. package/dist/contexts/LoaderContext.js +10 -9
  118. package/dist/contexts/LocalizationContext.js +25 -29
  119. package/dist/contexts/PagesRotateContext.js +36 -18
  120. package/dist/contexts/PaginationContext.js +32 -4
  121. package/dist/contexts/PrintContext.js +76 -6
  122. package/dist/contexts/RPDocumentContext.js +48 -30
  123. package/dist/contexts/RenderQueueProvider.js +70 -8
  124. package/dist/contexts/RotationContext.js +25 -15
  125. package/dist/contexts/ScrollModeContext.js +7 -6
  126. package/dist/contexts/SearchContext.js +94 -6
  127. package/dist/contexts/SelectionModeContext.js +5 -4
  128. package/dist/contexts/ThumbnailsContext.js +41 -6
  129. package/dist/contexts/ViewModeContext.js +10 -9
  130. package/dist/contexts/ZoomContext.js +48 -38
  131. package/dist/floating-ui.react-dom-5ec29bd6.js +1327 -0
  132. package/dist/index-4baea9b5.js +1198 -0
  133. package/dist/index-655864a7.js +27 -0
  134. package/dist/{index-35c7f4a2.js → index-c0faa594.js} +63 -86
  135. package/dist/index-e3ee9457.js +150 -0
  136. package/dist/libInjectCss.js +9 -0
  137. package/dist/main.js +269 -84
  138. package/dist/types/assets/style.d.ts +1 -0
  139. package/dist/types/components/icons/DualPageIcon.d.ts +1 -1
  140. package/dist/types/components/icons/SinglePageIcon.d.ts +1 -1
  141. package/dist/types/components/layout/toolbar/tools/DualPageTool.d.ts +3 -0
  142. package/dist/types/components/layout/toolbar/tools/SelectionModeSwitcherTool.d.ts +3 -0
  143. package/dist/types/components/layout/toolbar/tools/SinglePageTool.d.ts +3 -0
  144. package/dist/types/components/layout/toolbar/tools/ZoomLevelDisplay.d.ts +7 -0
  145. package/dist/types/contexts/EventCallbackContext.d.ts +5 -0
  146. package/dist/types/contexts/RenderQueueProvider.d.ts +2 -2
  147. package/dist/types/libInjectCss.d.ts +1 -0
  148. package/dist/types/main.d.ts +6 -6
  149. package/dist/types/utils/annotations.d.ts +3 -3
  150. package/dist/types/utils/approximateFragtion.d.ts +9 -0
  151. package/dist/types/utils/getElementPositionInPage.d.ts +5 -0
  152. package/dist/types/utils/hooks/useCopyText.d.ts +1 -0
  153. package/dist/types/utils/hooks/usePrint.d.ts +3 -2
  154. package/dist/types/utils/hooks/useSearch.d.ts +1 -2
  155. package/dist/types/utils/injectPrintCSS.d.ts +1 -0
  156. package/dist/types/utils/link_service.d.ts +11 -1
  157. package/dist/types/utils/renderPage.d.ts +2 -2
  158. package/dist/types/utils/types.d.ts +38 -5
  159. package/dist/types/utils/zoom.d.ts +2 -0
  160. package/dist/utils/annotations.js +125 -149
  161. package/dist/utils/approximateFragtion.js +22 -0
  162. package/dist/utils/getElementPositionInPage.js +84 -0
  163. package/dist/utils/getWordPositionInPage.js +5 -5
  164. package/dist/utils/getZoomLevel.js +9 -8
  165. package/dist/utils/highlight.js +72 -72
  166. package/dist/utils/hooks/useCopyText.js +36 -0
  167. package/dist/utils/hooks/useDarkModeProps.js +3 -2
  168. package/dist/utils/hooks/useFileDownload.js +29 -54
  169. package/dist/utils/hooks/useHighlight.js +34 -33
  170. package/dist/utils/hooks/useLicense.js +1 -1
  171. package/dist/utils/hooks/useLoadPdf.js +44 -36
  172. package/dist/utils/hooks/useLoadWorker.js +11 -8
  173. package/dist/utils/hooks/useLocalization.js +13 -13
  174. package/dist/utils/hooks/usePageRotateContext.js +33 -17
  175. package/dist/utils/hooks/usePaginate.js +26 -49
  176. package/dist/utils/hooks/usePinch.js +62 -41
  177. package/dist/utils/hooks/usePresentPage.js +80 -50
  178. package/dist/utils/hooks/usePrint.js +181 -55
  179. package/dist/utils/hooks/useRotate.js +21 -7
  180. package/dist/utils/hooks/useScrollToPage.js +26 -51
  181. package/dist/utils/hooks/useSearch.js +141 -55
  182. package/dist/utils/hooks/useThumbnail.js +55 -55
  183. package/dist/utils/hooks/useVirtualReactWindow.js +70 -52
  184. package/dist/utils/hooks/useWatermark.js +18 -15
  185. package/dist/utils/injectPrintCSS.js +22 -0
  186. package/dist/utils/link_service.js +49 -9
  187. package/dist/utils/renderPage.js +13 -10
  188. package/dist/utils/zoom.js +6 -0
  189. package/package.json +6 -8
  190. package/dist/SearchCloseButton-cbf182aa.js +0 -33
  191. package/dist/ToolbarLayout.module-c588d36b.js +0 -3411
  192. package/dist/assets/Button.css +0 -1
  193. package/dist/assets/Checkbox.css +0 -1
  194. package/dist/assets/Container.css +0 -1
  195. package/dist/assets/DropDown.css +0 -1
  196. package/dist/assets/Input.css +0 -1
  197. package/dist/assets/LayoutWrapper.css +0 -1
  198. package/dist/assets/LoaderIcon.css +0 -1
  199. package/dist/assets/MenuItem.css +0 -1
  200. package/dist/assets/MenuSeparator.css +0 -1
  201. package/dist/assets/PasswordModal.css +0 -1
  202. package/dist/assets/PropertyItem.css +0 -1
  203. package/dist/assets/RPDropFileZone.css +0 -1
  204. package/dist/assets/RPSplitter.css +0 -1
  205. package/dist/assets/RPTooltip.css +0 -1
  206. package/dist/assets/RotateTool.css +0 -1
  207. package/dist/assets/SearchCloseButton.css +0 -1
  208. package/dist/assets/ToolbarLayout.css +0 -1
  209. package/dist/assets/WrapperLayout.css +0 -1
  210. package/dist/assets/ZoomTool.css +0 -1
  211. package/dist/floating-ui.react-dom-6b2fe0df.js +0 -1474
  212. package/dist/index-f563c6f0.js +0 -1889
@@ -0,0 +1,701 @@
1
+ import * as u from "react";
2
+ import { useState as Se } from "react";
3
+ import we from "react-dom";
4
+ import { u as Ce, P as ie, a as Re } from "./index-c0faa594.js";
5
+ import { jsx as le } from "react/jsx-runtime";
6
+ import { a as q } from "./index-e3ee9457.js";
7
+ var Ae = "Portal", Te = u.forwardRef((e, t) => {
8
+ var a;
9
+ const { container: n, ...r } = e, [c, i] = u.useState(!1);
10
+ Ce(() => i(!0), []);
11
+ const l = n || c && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
12
+ return l ? we.createPortal(/* @__PURE__ */ le(ie.div, { ...r, ref: t }), l) : null;
13
+ });
14
+ Te.displayName = Ae;
15
+ var U = 0;
16
+ function At() {
17
+ u.useEffect(() => {
18
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
19
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? Q()), document.body.insertAdjacentElement("beforeend", e[1] ?? Q()), U++, () => {
20
+ U === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), U--;
21
+ };
22
+ }, []);
23
+ }
24
+ function Q() {
25
+ const e = document.createElement("span");
26
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
27
+ }
28
+ var j = "focusScope.autoFocusOnMount", K = "focusScope.autoFocusOnUnmount", $ = { bubbles: !1, cancelable: !0 }, ke = "FocusScope", Pe = u.forwardRef((e, t) => {
29
+ const {
30
+ loop: n = !1,
31
+ trapped: r = !1,
32
+ onMountAutoFocus: c,
33
+ onUnmountAutoFocus: i,
34
+ ...l
35
+ } = e, [a, S] = u.useState(null), b = q(c), g = q(i), f = u.useRef(null), v = Re(t, (o) => S(o)), h = u.useRef({
36
+ paused: !1,
37
+ pause() {
38
+ this.paused = !0;
39
+ },
40
+ resume() {
41
+ this.paused = !1;
42
+ }
43
+ }).current;
44
+ u.useEffect(() => {
45
+ if (r) {
46
+ let o = function(p) {
47
+ if (h.paused || !a)
48
+ return;
49
+ const y = p.target;
50
+ a.contains(y) ? f.current = y : T(f.current, { select: !0 });
51
+ }, s = function(p) {
52
+ if (h.paused || !a)
53
+ return;
54
+ const y = p.relatedTarget;
55
+ y !== null && (a.contains(y) || T(f.current, { select: !0 }));
56
+ }, d = function(p) {
57
+ if (document.activeElement === document.body)
58
+ for (const E of p)
59
+ E.removedNodes.length > 0 && T(a);
60
+ };
61
+ document.addEventListener("focusin", o), document.addEventListener("focusout", s);
62
+ const m = new MutationObserver(d);
63
+ return a && m.observe(a, { childList: !0, subtree: !0 }), () => {
64
+ document.removeEventListener("focusin", o), document.removeEventListener("focusout", s), m.disconnect();
65
+ };
66
+ }
67
+ }, [r, a, h.paused]), u.useEffect(() => {
68
+ if (a) {
69
+ ee.add(h);
70
+ const o = document.activeElement;
71
+ if (!a.contains(o)) {
72
+ const d = new CustomEvent(j, $);
73
+ a.addEventListener(j, b), a.dispatchEvent(d), d.defaultPrevented || (Ne(Ie(se(a)), { select: !0 }), document.activeElement === o && T(a));
74
+ }
75
+ return () => {
76
+ a.removeEventListener(j, b), setTimeout(() => {
77
+ const d = new CustomEvent(K, $);
78
+ a.addEventListener(K, g), a.dispatchEvent(d), d.defaultPrevented || T(o ?? document.body, { select: !0 }), a.removeEventListener(K, g), ee.remove(h);
79
+ }, 0);
80
+ };
81
+ }
82
+ }, [a, b, g, h]);
83
+ const w = u.useCallback(
84
+ (o) => {
85
+ if (!n && !r || h.paused)
86
+ return;
87
+ const s = o.key === "Tab" && !o.altKey && !o.ctrlKey && !o.metaKey, d = document.activeElement;
88
+ if (s && d) {
89
+ const m = o.currentTarget, [p, y] = Me(m);
90
+ p && y ? !o.shiftKey && d === y ? (o.preventDefault(), n && T(p, { select: !0 })) : o.shiftKey && d === p && (o.preventDefault(), n && T(y, { select: !0 })) : d === m && o.preventDefault();
91
+ }
92
+ },
93
+ [n, r, h.paused]
94
+ );
95
+ return /* @__PURE__ */ le(ie.div, { tabIndex: -1, ...l, ref: v, onKeyDown: w });
96
+ });
97
+ Pe.displayName = ke;
98
+ function Ne(e, { select: t = !1 } = {}) {
99
+ const n = document.activeElement;
100
+ for (const r of e)
101
+ if (T(r, { select: t }), document.activeElement !== n)
102
+ return;
103
+ }
104
+ function Me(e) {
105
+ const t = se(e), n = J(t, e), r = J(t.reverse(), e);
106
+ return [n, r];
107
+ }
108
+ function se(e) {
109
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
110
+ acceptNode: (r) => {
111
+ const c = r.tagName === "INPUT" && r.type === "hidden";
112
+ return r.disabled || r.hidden || c ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
113
+ }
114
+ });
115
+ for (; n.nextNode(); )
116
+ t.push(n.currentNode);
117
+ return t;
118
+ }
119
+ function J(e, t) {
120
+ for (const n of e)
121
+ if (!Fe(n, { upTo: t }))
122
+ return n;
123
+ }
124
+ function Fe(e, { upTo: t }) {
125
+ if (getComputedStyle(e).visibility === "hidden")
126
+ return !0;
127
+ for (; e; ) {
128
+ if (t !== void 0 && e === t)
129
+ return !1;
130
+ if (getComputedStyle(e).display === "none")
131
+ return !0;
132
+ e = e.parentElement;
133
+ }
134
+ return !1;
135
+ }
136
+ function Le(e) {
137
+ return e instanceof HTMLInputElement && "select" in e;
138
+ }
139
+ function T(e, { select: t = !1 } = {}) {
140
+ if (e && e.focus) {
141
+ const n = document.activeElement;
142
+ e.focus({ preventScroll: !0 }), e !== n && Le(e) && t && e.select();
143
+ }
144
+ }
145
+ var ee = Oe();
146
+ function Oe() {
147
+ let e = [];
148
+ return {
149
+ add(t) {
150
+ const n = e[0];
151
+ t !== n && (n == null || n.pause()), e = te(e, t), e.unshift(t);
152
+ },
153
+ remove(t) {
154
+ var n;
155
+ e = te(e, t), (n = e[0]) == null || n.resume();
156
+ }
157
+ };
158
+ }
159
+ function te(e, t) {
160
+ const n = [...e], r = n.indexOf(t);
161
+ return r !== -1 && n.splice(r, 1), n;
162
+ }
163
+ function Ie(e) {
164
+ return e.filter((t) => t.tagName !== "A");
165
+ }
166
+ var xe = function(e) {
167
+ if (typeof document > "u")
168
+ return null;
169
+ var t = Array.isArray(e) ? e[0] : e;
170
+ return t.ownerDocument.body;
171
+ }, k = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), O = {}, H = 0, fe = function(e) {
172
+ return e && (e.host || fe(e.parentNode));
173
+ }, We = function(e, t) {
174
+ return t.map(function(n) {
175
+ if (e.contains(n))
176
+ return n;
177
+ var r = fe(n);
178
+ return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
179
+ }).filter(function(n) {
180
+ return !!n;
181
+ });
182
+ }, Be = function(e, t, n, r) {
183
+ var c = We(t, Array.isArray(e) ? e : [e]);
184
+ O[n] || (O[n] = /* @__PURE__ */ new WeakMap());
185
+ var i = O[n], l = [], a = /* @__PURE__ */ new Set(), S = new Set(c), b = function(f) {
186
+ !f || a.has(f) || (a.add(f), b(f.parentNode));
187
+ };
188
+ c.forEach(b);
189
+ var g = function(f) {
190
+ !f || S.has(f) || Array.prototype.forEach.call(f.children, function(v) {
191
+ if (a.has(v))
192
+ g(v);
193
+ else
194
+ try {
195
+ var h = v.getAttribute(r), w = h !== null && h !== "false", o = (k.get(v) || 0) + 1, s = (i.get(v) || 0) + 1;
196
+ k.set(v, o), i.set(v, s), l.push(v), o === 1 && w && L.set(v, !0), s === 1 && v.setAttribute(n, "true"), w || v.setAttribute(r, "true");
197
+ } catch (d) {
198
+ console.error("aria-hidden: cannot operate on ", v, d);
199
+ }
200
+ });
201
+ };
202
+ return g(t), a.clear(), H++, function() {
203
+ l.forEach(function(f) {
204
+ var v = k.get(f) - 1, h = i.get(f) - 1;
205
+ k.set(f, v), i.set(f, h), v || (L.has(f) || f.removeAttribute(r), L.delete(f)), h || f.removeAttribute(n);
206
+ }), H--, H || (k = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), O = {});
207
+ };
208
+ }, Tt = function(e, t, n) {
209
+ n === void 0 && (n = "data-aria-hidden");
210
+ var r = Array.from(Array.isArray(e) ? e : [e]), c = t || xe(e);
211
+ return c ? (r.push.apply(r, Array.from(c.querySelectorAll("[aria-live], script"))), Be(r, c, n, "aria-hidden")) : function() {
212
+ return null;
213
+ };
214
+ }, C = function() {
215
+ return C = Object.assign || function(t) {
216
+ for (var n, r = 1, c = arguments.length; r < c; r++) {
217
+ n = arguments[r];
218
+ for (var i in n)
219
+ Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
220
+ }
221
+ return t;
222
+ }, C.apply(this, arguments);
223
+ };
224
+ function de(e, t) {
225
+ var n = {};
226
+ for (var r in e)
227
+ Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
228
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
229
+ for (var c = 0, r = Object.getOwnPropertySymbols(e); c < r.length; c++)
230
+ t.indexOf(r[c]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[c]) && (n[r[c]] = e[r[c]]);
231
+ return n;
232
+ }
233
+ function De(e, t, n) {
234
+ if (n || arguments.length === 2)
235
+ for (var r = 0, c = t.length, i; r < c; r++)
236
+ (i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
237
+ return e.concat(i || Array.prototype.slice.call(t));
238
+ }
239
+ var W = "right-scroll-bar-position", B = "width-before-scroll-bar", _e = "with-scroll-bars-hidden", Ue = "--removed-body-scroll-bar-size";
240
+ function V(e, t) {
241
+ return typeof e == "function" ? e(t) : e && (e.current = t), e;
242
+ }
243
+ function je(e, t) {
244
+ var n = Se(function() {
245
+ return {
246
+ // value
247
+ value: e,
248
+ // last callback
249
+ callback: t,
250
+ // "memoized" public interface
251
+ facade: {
252
+ get current() {
253
+ return n.value;
254
+ },
255
+ set current(r) {
256
+ var c = n.value;
257
+ c !== r && (n.value = r, n.callback(r, c));
258
+ }
259
+ }
260
+ };
261
+ })[0];
262
+ return n.callback = t, n.facade;
263
+ }
264
+ var Ke = typeof window < "u" ? u.useLayoutEffect : u.useEffect, ne = /* @__PURE__ */ new WeakMap();
265
+ function He(e, t) {
266
+ var n = je(t || null, function(r) {
267
+ return e.forEach(function(c) {
268
+ return V(c, r);
269
+ });
270
+ });
271
+ return Ke(function() {
272
+ var r = ne.get(n);
273
+ if (r) {
274
+ var c = new Set(r), i = new Set(e), l = n.current;
275
+ c.forEach(function(a) {
276
+ i.has(a) || V(a, null);
277
+ }), i.forEach(function(a) {
278
+ c.has(a) || V(a, l);
279
+ });
280
+ }
281
+ ne.set(n, e);
282
+ }, [e]), n;
283
+ }
284
+ function Ve(e) {
285
+ return e;
286
+ }
287
+ function Xe(e, t) {
288
+ t === void 0 && (t = Ve);
289
+ var n = [], r = !1, c = {
290
+ read: function() {
291
+ if (r)
292
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
293
+ return n.length ? n[n.length - 1] : e;
294
+ },
295
+ useMedium: function(i) {
296
+ var l = t(i, r);
297
+ return n.push(l), function() {
298
+ n = n.filter(function(a) {
299
+ return a !== l;
300
+ });
301
+ };
302
+ },
303
+ assignSyncMedium: function(i) {
304
+ for (r = !0; n.length; ) {
305
+ var l = n;
306
+ n = [], l.forEach(i);
307
+ }
308
+ n = {
309
+ push: function(a) {
310
+ return i(a);
311
+ },
312
+ filter: function() {
313
+ return n;
314
+ }
315
+ };
316
+ },
317
+ assignMedium: function(i) {
318
+ r = !0;
319
+ var l = [];
320
+ if (n.length) {
321
+ var a = n;
322
+ n = [], a.forEach(i), l = n;
323
+ }
324
+ var S = function() {
325
+ var g = l;
326
+ l = [], g.forEach(i);
327
+ }, b = function() {
328
+ return Promise.resolve().then(S);
329
+ };
330
+ b(), n = {
331
+ push: function(g) {
332
+ l.push(g), b();
333
+ },
334
+ filter: function(g) {
335
+ return l = l.filter(g), n;
336
+ }
337
+ };
338
+ }
339
+ };
340
+ return c;
341
+ }
342
+ function Ye(e) {
343
+ e === void 0 && (e = {});
344
+ var t = Xe(null);
345
+ return t.options = C({ async: !0, ssr: !1 }, e), t;
346
+ }
347
+ var ve = function(e) {
348
+ var t = e.sideCar, n = de(e, ["sideCar"]);
349
+ if (!t)
350
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
351
+ var r = t.read();
352
+ if (!r)
353
+ throw new Error("Sidecar medium not found");
354
+ return u.createElement(r, C({}, n));
355
+ };
356
+ ve.isSideCarExport = !0;
357
+ function Ge(e, t) {
358
+ return e.useMedium(t), ve;
359
+ }
360
+ var he = Ye(), X = function() {
361
+ }, D = u.forwardRef(function(e, t) {
362
+ var n = u.useRef(null), r = u.useState({
363
+ onScrollCapture: X,
364
+ onWheelCapture: X,
365
+ onTouchMoveCapture: X
366
+ }), c = r[0], i = r[1], l = e.forwardProps, a = e.children, S = e.className, b = e.removeScrollBar, g = e.enabled, f = e.shards, v = e.sideCar, h = e.noRelative, w = e.noIsolation, o = e.inert, s = e.allowPinchZoom, d = e.as, m = d === void 0 ? "div" : d, p = e.gapMode, y = de(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = v, R = He([n, t]), A = C(C({}, y), c);
367
+ return u.createElement(
368
+ u.Fragment,
369
+ null,
370
+ g && u.createElement(E, { sideCar: he, removeScrollBar: b, shards: f, noRelative: h, noIsolation: w, inert: o, setCallbacks: i, allowPinchZoom: !!s, lockRef: n, gapMode: p }),
371
+ l ? u.cloneElement(u.Children.only(a), C(C({}, A), { ref: R })) : u.createElement(m, C({}, A, { className: S, ref: R }), a)
372
+ );
373
+ });
374
+ D.defaultProps = {
375
+ enabled: !0,
376
+ removeScrollBar: !0,
377
+ inert: !1
378
+ };
379
+ D.classNames = {
380
+ fullWidth: B,
381
+ zeroRight: W
382
+ };
383
+ var re, ze = function() {
384
+ if (re)
385
+ return re;
386
+ if (typeof __webpack_nonce__ < "u")
387
+ return __webpack_nonce__;
388
+ };
389
+ function Ze() {
390
+ if (!document)
391
+ return null;
392
+ var e = document.createElement("style");
393
+ e.type = "text/css";
394
+ var t = ze();
395
+ return t && e.setAttribute("nonce", t), e;
396
+ }
397
+ function qe(e, t) {
398
+ e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
399
+ }
400
+ function Qe(e) {
401
+ var t = document.head || document.getElementsByTagName("head")[0];
402
+ t.appendChild(e);
403
+ }
404
+ var $e = function() {
405
+ var e = 0, t = null;
406
+ return {
407
+ add: function(n) {
408
+ e == 0 && (t = Ze()) && (qe(t, n), Qe(t)), e++;
409
+ },
410
+ remove: function() {
411
+ e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
412
+ }
413
+ };
414
+ }, Je = function() {
415
+ var e = $e();
416
+ return function(t, n) {
417
+ u.useEffect(function() {
418
+ return e.add(t), function() {
419
+ e.remove();
420
+ };
421
+ }, [t && n]);
422
+ };
423
+ }, me = function() {
424
+ var e = Je(), t = function(n) {
425
+ var r = n.styles, c = n.dynamic;
426
+ return e(r, c), null;
427
+ };
428
+ return t;
429
+ }, et = {
430
+ left: 0,
431
+ top: 0,
432
+ right: 0,
433
+ gap: 0
434
+ }, Y = function(e) {
435
+ return parseInt(e || "", 10) || 0;
436
+ }, tt = function(e) {
437
+ var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], c = t[e === "padding" ? "paddingRight" : "marginRight"];
438
+ return [Y(n), Y(r), Y(c)];
439
+ }, nt = function(e) {
440
+ if (e === void 0 && (e = "margin"), typeof window > "u")
441
+ return et;
442
+ var t = tt(e), n = document.documentElement.clientWidth, r = window.innerWidth;
443
+ return {
444
+ left: t[0],
445
+ top: t[1],
446
+ right: t[2],
447
+ gap: Math.max(0, r - n + t[2] - t[0])
448
+ };
449
+ }, rt = me(), M = "data-scroll-locked", at = function(e, t, n, r) {
450
+ var c = e.left, i = e.top, l = e.right, a = e.gap;
451
+ return n === void 0 && (n = "margin"), `
452
+ .`.concat(_e, ` {
453
+ overflow: hidden `).concat(r, `;
454
+ padding-right: `).concat(a, "px ").concat(r, `;
455
+ }
456
+ body[`).concat(M, `] {
457
+ overflow: hidden `).concat(r, `;
458
+ overscroll-behavior: contain;
459
+ `).concat([
460
+ t && "position: relative ".concat(r, ";"),
461
+ n === "margin" && `
462
+ padding-left: `.concat(c, `px;
463
+ padding-top: `).concat(i, `px;
464
+ padding-right: `).concat(l, `px;
465
+ margin-left:0;
466
+ margin-top:0;
467
+ margin-right: `).concat(a, "px ").concat(r, `;
468
+ `),
469
+ n === "padding" && "padding-right: ".concat(a, "px ").concat(r, ";")
470
+ ].filter(Boolean).join(""), `
471
+ }
472
+
473
+ .`).concat(W, ` {
474
+ right: `).concat(a, "px ").concat(r, `;
475
+ }
476
+
477
+ .`).concat(B, ` {
478
+ margin-right: `).concat(a, "px ").concat(r, `;
479
+ }
480
+
481
+ .`).concat(W, " .").concat(W, ` {
482
+ right: 0 `).concat(r, `;
483
+ }
484
+
485
+ .`).concat(B, " .").concat(B, ` {
486
+ margin-right: 0 `).concat(r, `;
487
+ }
488
+
489
+ body[`).concat(M, `] {
490
+ `).concat(Ue, ": ").concat(a, `px;
491
+ }
492
+ `);
493
+ }, ae = function() {
494
+ var e = parseInt(document.body.getAttribute(M) || "0", 10);
495
+ return isFinite(e) ? e : 0;
496
+ }, ot = function() {
497
+ u.useEffect(function() {
498
+ return document.body.setAttribute(M, (ae() + 1).toString()), function() {
499
+ var e = ae() - 1;
500
+ e <= 0 ? document.body.removeAttribute(M) : document.body.setAttribute(M, e.toString());
501
+ };
502
+ }, []);
503
+ }, ct = function(e) {
504
+ var t = e.noRelative, n = e.noImportant, r = e.gapMode, c = r === void 0 ? "margin" : r;
505
+ ot();
506
+ var i = u.useMemo(function() {
507
+ return nt(c);
508
+ }, [c]);
509
+ return u.createElement(rt, { styles: at(i, !t, c, n ? "" : "!important") });
510
+ }, G = !1;
511
+ if (typeof window < "u")
512
+ try {
513
+ var I = Object.defineProperty({}, "passive", {
514
+ get: function() {
515
+ return G = !0, !0;
516
+ }
517
+ });
518
+ window.addEventListener("test", I, I), window.removeEventListener("test", I, I);
519
+ } catch {
520
+ G = !1;
521
+ }
522
+ var P = G ? { passive: !1 } : !1, ut = function(e) {
523
+ return e.tagName === "TEXTAREA";
524
+ }, pe = function(e, t) {
525
+ if (!(e instanceof Element))
526
+ return !1;
527
+ var n = window.getComputedStyle(e);
528
+ return (
529
+ // not-not-scrollable
530
+ n[t] !== "hidden" && // contains scroll inside self
531
+ !(n.overflowY === n.overflowX && !ut(e) && n[t] === "visible")
532
+ );
533
+ }, it = function(e) {
534
+ return pe(e, "overflowY");
535
+ }, lt = function(e) {
536
+ return pe(e, "overflowX");
537
+ }, oe = function(e, t) {
538
+ var n = t.ownerDocument, r = t;
539
+ do {
540
+ typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
541
+ var c = ge(e, r);
542
+ if (c) {
543
+ var i = ye(e, r), l = i[1], a = i[2];
544
+ if (l > a)
545
+ return !0;
546
+ }
547
+ r = r.parentNode;
548
+ } while (r && r !== n.body);
549
+ return !1;
550
+ }, st = function(e) {
551
+ var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
552
+ return [
553
+ t,
554
+ n,
555
+ r
556
+ ];
557
+ }, ft = function(e) {
558
+ var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
559
+ return [
560
+ t,
561
+ n,
562
+ r
563
+ ];
564
+ }, ge = function(e, t) {
565
+ return e === "v" ? it(t) : lt(t);
566
+ }, ye = function(e, t) {
567
+ return e === "v" ? st(t) : ft(t);
568
+ }, dt = function(e, t) {
569
+ return e === "h" && t === "rtl" ? -1 : 1;
570
+ }, vt = function(e, t, n, r, c) {
571
+ var i = dt(e, window.getComputedStyle(t).direction), l = i * r, a = n.target, S = t.contains(a), b = !1, g = l > 0, f = 0, v = 0;
572
+ do {
573
+ if (!a)
574
+ break;
575
+ var h = ye(e, a), w = h[0], o = h[1], s = h[2], d = o - s - i * w;
576
+ (w || d) && ge(e, a) && (f += d, v += w);
577
+ var m = a.parentNode;
578
+ a = m && m.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? m.host : m;
579
+ } while (
580
+ // portaled content
581
+ !S && a !== document.body || // self content
582
+ S && (t.contains(a) || t === a)
583
+ );
584
+ return (g && (c && Math.abs(f) < 1 || !c && l > f) || !g && (c && Math.abs(v) < 1 || !c && -l > v)) && (b = !0), b;
585
+ }, x = function(e) {
586
+ return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
587
+ }, ce = function(e) {
588
+ return [e.deltaX, e.deltaY];
589
+ }, ue = function(e) {
590
+ return e && "current" in e ? e.current : e;
591
+ }, ht = function(e, t) {
592
+ return e[0] === t[0] && e[1] === t[1];
593
+ }, mt = function(e) {
594
+ return `
595
+ .block-interactivity-`.concat(e, ` {pointer-events: none;}
596
+ .allow-interactivity-`).concat(e, ` {pointer-events: all;}
597
+ `);
598
+ }, pt = 0, N = [];
599
+ function gt(e) {
600
+ var t = u.useRef([]), n = u.useRef([0, 0]), r = u.useRef(), c = u.useState(pt++)[0], i = u.useState(me)[0], l = u.useRef(e);
601
+ u.useEffect(function() {
602
+ l.current = e;
603
+ }, [e]), u.useEffect(function() {
604
+ if (e.inert) {
605
+ document.body.classList.add("block-interactivity-".concat(c));
606
+ var o = De([e.lockRef.current], (e.shards || []).map(ue), !0).filter(Boolean);
607
+ return o.forEach(function(s) {
608
+ return s.classList.add("allow-interactivity-".concat(c));
609
+ }), function() {
610
+ document.body.classList.remove("block-interactivity-".concat(c)), o.forEach(function(s) {
611
+ return s.classList.remove("allow-interactivity-".concat(c));
612
+ });
613
+ };
614
+ }
615
+ }, [e.inert, e.lockRef.current, e.shards]);
616
+ var a = u.useCallback(function(o, s) {
617
+ if ("touches" in o && o.touches.length === 2 || o.type === "wheel" && o.ctrlKey)
618
+ return !l.current.allowPinchZoom;
619
+ var d = x(o), m = n.current, p = "deltaX" in o ? o.deltaX : m[0] - d[0], y = "deltaY" in o ? o.deltaY : m[1] - d[1], E, R = o.target, A = Math.abs(p) > Math.abs(y) ? "h" : "v";
620
+ if ("touches" in o && A === "h" && R.type === "range")
621
+ return !1;
622
+ var z = window.getSelection(), _ = z && z.anchorNode, Ee = _ ? _ === R || _.contains(R) : !1;
623
+ if (Ee)
624
+ return !1;
625
+ var F = oe(A, R);
626
+ if (!F)
627
+ return !0;
628
+ if (F ? E = A : (E = A === "v" ? "h" : "v", F = oe(A, R)), !F)
629
+ return !1;
630
+ if (!r.current && "changedTouches" in o && (p || y) && (r.current = E), !E)
631
+ return !0;
632
+ var Z = r.current || E;
633
+ return vt(Z, s, o, Z === "h" ? p : y, !0);
634
+ }, []), S = u.useCallback(function(o) {
635
+ var s = o;
636
+ if (!(!N.length || N[N.length - 1] !== i)) {
637
+ var d = "deltaY" in s ? ce(s) : x(s), m = t.current.filter(function(E) {
638
+ return E.name === s.type && (E.target === s.target || s.target === E.shadowParent) && ht(E.delta, d);
639
+ })[0];
640
+ if (m && m.should) {
641
+ s.cancelable && s.preventDefault();
642
+ return;
643
+ }
644
+ if (!m) {
645
+ var p = (l.current.shards || []).map(ue).filter(Boolean).filter(function(E) {
646
+ return E.contains(s.target);
647
+ }), y = p.length > 0 ? a(s, p[0]) : !l.current.noIsolation;
648
+ y && s.cancelable && s.preventDefault();
649
+ }
650
+ }
651
+ }, []), b = u.useCallback(function(o, s, d, m) {
652
+ var p = { name: o, delta: s, target: d, should: m, shadowParent: yt(d) };
653
+ t.current.push(p), setTimeout(function() {
654
+ t.current = t.current.filter(function(y) {
655
+ return y !== p;
656
+ });
657
+ }, 1);
658
+ }, []), g = u.useCallback(function(o) {
659
+ n.current = x(o), r.current = void 0;
660
+ }, []), f = u.useCallback(function(o) {
661
+ b(o.type, ce(o), o.target, a(o, e.lockRef.current));
662
+ }, []), v = u.useCallback(function(o) {
663
+ b(o.type, x(o), o.target, a(o, e.lockRef.current));
664
+ }, []);
665
+ u.useEffect(function() {
666
+ return N.push(i), e.setCallbacks({
667
+ onScrollCapture: f,
668
+ onWheelCapture: f,
669
+ onTouchMoveCapture: v
670
+ }), document.addEventListener("wheel", S, P), document.addEventListener("touchmove", S, P), document.addEventListener("touchstart", g, P), function() {
671
+ N = N.filter(function(o) {
672
+ return o !== i;
673
+ }), document.removeEventListener("wheel", S, P), document.removeEventListener("touchmove", S, P), document.removeEventListener("touchstart", g, P);
674
+ };
675
+ }, []);
676
+ var h = e.removeScrollBar, w = e.inert;
677
+ return u.createElement(
678
+ u.Fragment,
679
+ null,
680
+ w ? u.createElement(i, { styles: mt(c) }) : null,
681
+ h ? u.createElement(ct, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
682
+ );
683
+ }
684
+ function yt(e) {
685
+ for (var t = null; e !== null; )
686
+ e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
687
+ return t;
688
+ }
689
+ const bt = Ge(he, gt);
690
+ var be = u.forwardRef(function(e, t) {
691
+ return u.createElement(D, C({}, e, { ref: t, sideCar: bt }));
692
+ });
693
+ be.classNames = D.classNames;
694
+ const kt = be;
695
+ export {
696
+ Pe as F,
697
+ Te as P,
698
+ kt as R,
699
+ Tt as h,
700
+ At as u
701
+ };
@@ -0,0 +1,6 @@
1
+ const o = {
2
+ "rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
3
+ };
4
+ export {
5
+ o as c
6
+ };