@react-pdf-kit/viewer 2.0.1-rc.0 → 2.0.1-rc.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 (48) hide show
  1. package/dist/{Combination-54a77a7a.js → Combination-136ff99c.js} +184 -187
  2. package/dist/components/layout/RPDefaultLayout.js +2 -2
  3. package/dist/components/layout/RPLayout.js +2 -2
  4. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  5. package/dist/components/layout/toolbar/DocumentProperties.js +2 -2
  6. package/dist/components/layout/toolbar/FileDownloadTool.js +2 -2
  7. package/dist/components/layout/toolbar/FileUploadTool.js +2 -2
  8. package/dist/components/layout/toolbar/FullScreenTool.js +2 -2
  9. package/dist/components/layout/toolbar/MenuItem.js +2 -2
  10. package/dist/components/layout/toolbar/MenuSeparator.js +2 -2
  11. package/dist/components/layout/toolbar/MostPageTool.js +2 -2
  12. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  13. package/dist/components/layout/toolbar/PrintTool.js +2 -2
  14. package/dist/components/layout/toolbar/RPMenuItem.js +2 -2
  15. package/dist/components/layout/toolbar/RPMoreOptions.js +2 -2
  16. package/dist/components/layout/toolbar/RPToolbar.js +2 -2
  17. package/dist/components/layout/toolbar/RPToolbarEnd.js +2 -2
  18. package/dist/components/layout/toolbar/RotateTool.js +2 -2
  19. package/dist/components/layout/toolbar/ScrollModeTool.js +2 -2
  20. package/dist/components/layout/toolbar/SearchTool.js +2 -2
  21. package/dist/components/layout/toolbar/SelectionModeTool.js +2 -2
  22. package/dist/components/layout/toolbar/ToolbarDefault.js +2 -2
  23. package/dist/components/layout/toolbar/ToolbarLayout.js +2 -2
  24. package/dist/components/layout/toolbar/ViewModeTool.js +2 -2
  25. package/dist/components/layout/toolbar/ZoomTool.js +2 -2
  26. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +1 -1
  27. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +2 -2
  28. package/dist/components/layout/toolbar/tools/FirstPageTool.js +2 -2
  29. package/dist/components/layout/toolbar/tools/LastPageTool.js +2 -2
  30. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +2 -2
  31. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +2 -2
  32. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +2 -2
  33. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +2 -2
  34. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +2 -2
  35. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +2 -2
  36. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +2 -2
  37. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +2 -2
  38. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +2 -2
  39. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +2 -2
  40. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +2 -2
  41. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +2 -2
  42. package/dist/components/ui/DropDown.js +2 -2
  43. package/dist/{index-4baea9b5.js → index-61f59539.js} +1 -1
  44. package/dist/main.js +2 -2
  45. package/dist/utils/highlight.js +36 -36
  46. package/dist/utils/hooks/useHighlight.js +78 -40
  47. package/dist/utils/hooks/useLicense.js +1 -1
  48. package/package.json +1 -1
@@ -1,38 +1,38 @@
1
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) => {
2
+ import { useState as ye } from "react";
3
+ import be from "react-dom";
4
+ import { u as Ee, P as ce, a as Se } from "./index-c0faa594.js";
5
+ import { jsx as ue } from "react/jsx-runtime";
6
+ import { a as z } from "./index-e3ee9457.js";
7
+ var we = "Portal", Ce = u.forwardRef((e, t) => {
8
8
  var a;
9
9
  const { container: n, ...r } = e, [c, i] = u.useState(!1);
10
- Ce(() => i(!0), []);
10
+ Ee(() => i(!0), []);
11
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;
12
+ return l ? be.createPortal(/* @__PURE__ */ ue(ce.div, { ...r, ref: t }), l) : null;
13
13
  });
14
- Te.displayName = Ae;
15
- var U = 0;
16
- function At() {
14
+ Ce.displayName = we;
15
+ var _ = 0;
16
+ function wt() {
17
17
  u.useEffect(() => {
18
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--;
19
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? Z()), document.body.insertAdjacentElement("beforeend", e[1] ?? Z()), _++, () => {
20
+ _ === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), _--;
21
21
  };
22
22
  }, []);
23
23
  }
24
- function Q() {
24
+ function Z() {
25
25
  const e = document.createElement("span");
26
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
27
  }
28
- var j = "focusScope.autoFocusOnMount", K = "focusScope.autoFocusOnUnmount", $ = { bubbles: !1, cancelable: !0 }, ke = "FocusScope", Pe = u.forwardRef((e, t) => {
28
+ var U = "focusScope.autoFocusOnMount", j = "focusScope.autoFocusOnUnmount", q = { bubbles: !1, cancelable: !0 }, Re = "FocusScope", Ae = u.forwardRef((e, t) => {
29
29
  const {
30
30
  loop: n = !1,
31
31
  trapped: r = !1,
32
32
  onMountAutoFocus: c,
33
33
  onUnmountAutoFocus: i,
34
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({
35
+ } = e, [a, S] = u.useState(null), b = z(c), g = z(i), f = u.useRef(null), v = Se(t, (o) => S(o)), h = u.useRef({
36
36
  paused: !1,
37
37
  pause() {
38
38
  this.paused = !0;
@@ -47,16 +47,16 @@ var j = "focusScope.autoFocusOnMount", K = "focusScope.autoFocusOnUnmount", $ =
47
47
  if (h.paused || !a)
48
48
  return;
49
49
  const y = p.target;
50
- a.contains(y) ? f.current = y : T(f.current, { select: !0 });
50
+ a.contains(y) ? f.current = y : A(f.current, { select: !0 });
51
51
  }, s = function(p) {
52
52
  if (h.paused || !a)
53
53
  return;
54
54
  const y = p.relatedTarget;
55
- y !== null && (a.contains(y) || T(f.current, { select: !0 }));
55
+ y !== null && (a.contains(y) || A(f.current, { select: !0 }));
56
56
  }, d = function(p) {
57
57
  if (document.activeElement === document.body)
58
58
  for (const E of p)
59
- E.removedNodes.length > 0 && T(a);
59
+ E.removedNodes.length > 0 && A(a);
60
60
  };
61
61
  document.addEventListener("focusin", o), document.addEventListener("focusout", s);
62
62
  const m = new MutationObserver(d);
@@ -66,16 +66,16 @@ var j = "focusScope.autoFocusOnMount", K = "focusScope.autoFocusOnUnmount", $ =
66
66
  }
67
67
  }, [r, a, h.paused]), u.useEffect(() => {
68
68
  if (a) {
69
- ee.add(h);
69
+ $.add(h);
70
70
  const o = document.activeElement;
71
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));
72
+ const d = new CustomEvent(U, q);
73
+ a.addEventListener(U, b), a.dispatchEvent(d), d.defaultPrevented || (Te(Fe(ie(a)), { select: !0 }), document.activeElement === o && A(a));
74
74
  }
75
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);
76
+ a.removeEventListener(U, b), setTimeout(() => {
77
+ const d = new CustomEvent(j, q);
78
+ a.addEventListener(j, g), a.dispatchEvent(d), d.defaultPrevented || A(o ?? document.body, { select: !0 }), a.removeEventListener(j, g), $.remove(h);
79
79
  }, 0);
80
80
  };
81
81
  }
@@ -86,26 +86,26 @@ var j = "focusScope.autoFocusOnMount", K = "focusScope.autoFocusOnUnmount", $ =
86
86
  return;
87
87
  const s = o.key === "Tab" && !o.altKey && !o.ctrlKey && !o.metaKey, d = document.activeElement;
88
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();
89
+ const m = o.currentTarget, [p, y] = ke(m);
90
+ p && y ? !o.shiftKey && d === y ? (o.preventDefault(), n && A(p, { select: !0 })) : o.shiftKey && d === p && (o.preventDefault(), n && A(y, { select: !0 })) : d === m && o.preventDefault();
91
91
  }
92
92
  },
93
93
  [n, r, h.paused]
94
94
  );
95
- return /* @__PURE__ */ le(ie.div, { tabIndex: -1, ...l, ref: v, onKeyDown: w });
95
+ return /* @__PURE__ */ ue(ce.div, { tabIndex: -1, ...l, ref: v, onKeyDown: w });
96
96
  });
97
- Pe.displayName = ke;
98
- function Ne(e, { select: t = !1 } = {}) {
97
+ Ae.displayName = Re;
98
+ function Te(e, { select: t = !1 } = {}) {
99
99
  const n = document.activeElement;
100
100
  for (const r of e)
101
- if (T(r, { select: t }), document.activeElement !== n)
101
+ if (A(r, { select: t }), document.activeElement !== n)
102
102
  return;
103
103
  }
104
- function Me(e) {
105
- const t = se(e), n = J(t, e), r = J(t.reverse(), e);
104
+ function ke(e) {
105
+ const t = ie(e), n = Q(t, e), r = Q(t.reverse(), e);
106
106
  return [n, r];
107
107
  }
108
- function se(e) {
108
+ function ie(e) {
109
109
  const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
110
110
  acceptNode: (r) => {
111
111
  const c = r.tagName === "INPUT" && r.type === "hidden";
@@ -116,12 +116,12 @@ function se(e) {
116
116
  t.push(n.currentNode);
117
117
  return t;
118
118
  }
119
- function J(e, t) {
119
+ function Q(e, t) {
120
120
  for (const n of e)
121
- if (!Fe(n, { upTo: t }))
121
+ if (!Pe(n, { upTo: t }))
122
122
  return n;
123
123
  }
124
- function Fe(e, { upTo: t }) {
124
+ function Pe(e, { upTo: t }) {
125
125
  if (getComputedStyle(e).visibility === "hidden")
126
126
  return !0;
127
127
  for (; e; ) {
@@ -133,54 +133,54 @@ function Fe(e, { upTo: t }) {
133
133
  }
134
134
  return !1;
135
135
  }
136
- function Le(e) {
136
+ function Me(e) {
137
137
  return e instanceof HTMLInputElement && "select" in e;
138
138
  }
139
- function T(e, { select: t = !1 } = {}) {
139
+ function A(e, { select: t = !1 } = {}) {
140
140
  if (e && e.focus) {
141
141
  const n = document.activeElement;
142
- e.focus({ preventScroll: !0 }), e !== n && Le(e) && t && e.select();
142
+ e.focus({ preventScroll: !0 }), e !== n && Me(e) && t && e.select();
143
143
  }
144
144
  }
145
- var ee = Oe();
146
- function Oe() {
145
+ var $ = Ne();
146
+ function Ne() {
147
147
  let e = [];
148
148
  return {
149
149
  add(t) {
150
150
  const n = e[0];
151
- t !== n && (n == null || n.pause()), e = te(e, t), e.unshift(t);
151
+ t !== n && (n == null || n.pause()), e = J(e, t), e.unshift(t);
152
152
  },
153
153
  remove(t) {
154
154
  var n;
155
- e = te(e, t), (n = e[0]) == null || n.resume();
155
+ e = J(e, t), (n = e[0]) == null || n.resume();
156
156
  }
157
157
  };
158
158
  }
159
- function te(e, t) {
159
+ function J(e, t) {
160
160
  const n = [...e], r = n.indexOf(t);
161
161
  return r !== -1 && n.splice(r, 1), n;
162
162
  }
163
- function Ie(e) {
163
+ function Fe(e) {
164
164
  return e.filter((t) => t.tagName !== "A");
165
165
  }
166
- var xe = function(e) {
166
+ var Le = function(e) {
167
167
  if (typeof document > "u")
168
168
  return null;
169
169
  var t = Array.isArray(e) ? e[0] : e;
170
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) {
171
+ }, k = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), O = {}, K = 0, le = function(e) {
172
+ return e && (e.host || le(e.parentNode));
173
+ }, Oe = function(e, t) {
174
174
  return t.map(function(n) {
175
175
  if (e.contains(n))
176
176
  return n;
177
- var r = fe(n);
177
+ var r = le(n);
178
178
  return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
179
179
  }).filter(function(n) {
180
180
  return !!n;
181
181
  });
182
- }, Be = function(e, t, n, r) {
183
- var c = We(t, Array.isArray(e) ? e : [e]);
182
+ }, Ie = function(e, t, n, r) {
183
+ var c = Oe(t, Array.isArray(e) ? e : [e]);
184
184
  O[n] || (O[n] = /* @__PURE__ */ new WeakMap());
185
185
  var i = O[n], l = [], a = /* @__PURE__ */ new Set(), S = new Set(c), b = function(f) {
186
186
  !f || a.has(f) || (a.add(f), b(f.parentNode));
@@ -199,16 +199,16 @@ var xe = function(e) {
199
199
  }
200
200
  });
201
201
  };
202
- return g(t), a.clear(), H++, function() {
202
+ return g(t), a.clear(), K++, function() {
203
203
  l.forEach(function(f) {
204
204
  var v = k.get(f) - 1, h = i.get(f) - 1;
205
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 = {});
206
+ }), K--, K || (k = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), O = {});
207
207
  };
208
- }, Tt = function(e, t, n) {
208
+ }, Ct = function(e, t, n) {
209
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() {
210
+ var r = Array.from(Array.isArray(e) ? e : [e]), c = t || Le(e);
211
+ return c ? (r.push.apply(r, Array.from(c.querySelectorAll("[aria-live], script"))), Ie(r, c, n, "aria-hidden")) : function() {
212
212
  return null;
213
213
  };
214
214
  }, C = function() {
@@ -221,7 +221,7 @@ var xe = function(e) {
221
221
  return t;
222
222
  }, C.apply(this, arguments);
223
223
  };
224
- function de(e, t) {
224
+ function se(e, t) {
225
225
  var n = {};
226
226
  for (var r in e)
227
227
  Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
@@ -230,18 +230,18 @@ function de(e, t) {
230
230
  t.indexOf(r[c]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[c]) && (n[r[c]] = e[r[c]]);
231
231
  return n;
232
232
  }
233
- function De(e, t, n) {
233
+ function xe(e, t, n) {
234
234
  if (n || arguments.length === 2)
235
235
  for (var r = 0, c = t.length, i; r < c; r++)
236
236
  (i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
237
237
  return e.concat(i || Array.prototype.slice.call(t));
238
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) {
239
+ var W = "right-scroll-bar-position", B = "width-before-scroll-bar", We = "with-scroll-bars-hidden", Be = "--removed-body-scroll-bar-size";
240
+ function H(e, t) {
241
241
  return typeof e == "function" ? e(t) : e && (e.current = t), e;
242
242
  }
243
- function je(e, t) {
244
- var n = Se(function() {
243
+ function De(e, t) {
244
+ var n = ye(function() {
245
245
  return {
246
246
  // value
247
247
  value: e,
@@ -261,31 +261,31 @@ function je(e, t) {
261
261
  })[0];
262
262
  return n.callback = t, n.facade;
263
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) {
264
+ var _e = typeof window < "u" ? u.useLayoutEffect : u.useEffect, ee = /* @__PURE__ */ new WeakMap();
265
+ function Ue(e, t) {
266
+ var n = De(t || null, function(r) {
267
267
  return e.forEach(function(c) {
268
- return V(c, r);
268
+ return H(c, r);
269
269
  });
270
270
  });
271
- return Ke(function() {
272
- var r = ne.get(n);
271
+ return _e(function() {
272
+ var r = ee.get(n);
273
273
  if (r) {
274
274
  var c = new Set(r), i = new Set(e), l = n.current;
275
275
  c.forEach(function(a) {
276
- i.has(a) || V(a, null);
276
+ i.has(a) || H(a, null);
277
277
  }), i.forEach(function(a) {
278
- c.has(a) || V(a, l);
278
+ c.has(a) || H(a, l);
279
279
  });
280
280
  }
281
- ne.set(n, e);
281
+ ee.set(n, e);
282
282
  }, [e]), n;
283
283
  }
284
- function Ve(e) {
284
+ function je(e) {
285
285
  return e;
286
286
  }
287
- function Xe(e, t) {
288
- t === void 0 && (t = Ve);
287
+ function Ke(e, t) {
288
+ t === void 0 && (t = je);
289
289
  var n = [], r = !1, c = {
290
290
  read: function() {
291
291
  if (r)
@@ -339,13 +339,13 @@ function Xe(e, t) {
339
339
  };
340
340
  return c;
341
341
  }
342
- function Ye(e) {
342
+ function He(e) {
343
343
  e === void 0 && (e = {});
344
- var t = Xe(null);
344
+ var t = Ke(null);
345
345
  return t.options = C({ async: !0, ssr: !1 }, e), t;
346
346
  }
347
- var ve = function(e) {
348
- var t = e.sideCar, n = de(e, ["sideCar"]);
347
+ var fe = function(e) {
348
+ var t = e.sideCar, n = se(e, ["sideCar"]);
349
349
  if (!t)
350
350
  throw new Error("Sidecar: please provide `sideCar` property to import the right car");
351
351
  var r = t.read();
@@ -353,22 +353,22 @@ var ve = function(e) {
353
353
  throw new Error("Sidecar medium not found");
354
354
  return u.createElement(r, C({}, n));
355
355
  };
356
- ve.isSideCarExport = !0;
357
- function Ge(e, t) {
358
- return e.useMedium(t), ve;
356
+ fe.isSideCarExport = !0;
357
+ function Ve(e, t) {
358
+ return e.useMedium(t), fe;
359
359
  }
360
- var he = Ye(), X = function() {
360
+ var de = He(), V = function() {
361
361
  }, D = u.forwardRef(function(e, t) {
362
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);
363
+ onScrollCapture: V,
364
+ onWheelCapture: V,
365
+ onTouchMoveCapture: V
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 = se(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = v, T = Ue([n, t]), R = C(C({}, y), c);
367
367
  return u.createElement(
368
368
  u.Fragment,
369
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)
370
+ g && u.createElement(E, { sideCar: de, 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({}, R), { ref: T })) : u.createElement(m, C({}, R, { className: S, ref: T }), a)
372
372
  );
373
373
  });
374
374
  D.defaultProps = {
@@ -380,39 +380,39 @@ D.classNames = {
380
380
  fullWidth: B,
381
381
  zeroRight: W
382
382
  };
383
- var re, ze = function() {
384
- if (re)
385
- return re;
383
+ var te, Xe = function() {
384
+ if (te)
385
+ return te;
386
386
  if (typeof __webpack_nonce__ < "u")
387
387
  return __webpack_nonce__;
388
388
  };
389
- function Ze() {
389
+ function Ye() {
390
390
  if (!document)
391
391
  return null;
392
392
  var e = document.createElement("style");
393
393
  e.type = "text/css";
394
- var t = ze();
394
+ var t = Xe();
395
395
  return t && e.setAttribute("nonce", t), e;
396
396
  }
397
- function qe(e, t) {
397
+ function Ge(e, t) {
398
398
  e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
399
399
  }
400
- function Qe(e) {
400
+ function ze(e) {
401
401
  var t = document.head || document.getElementsByTagName("head")[0];
402
402
  t.appendChild(e);
403
403
  }
404
- var $e = function() {
404
+ var Ze = function() {
405
405
  var e = 0, t = null;
406
406
  return {
407
407
  add: function(n) {
408
- e == 0 && (t = Ze()) && (qe(t, n), Qe(t)), e++;
408
+ e == 0 && (t = Ye()) && (Ge(t, n), ze(t)), e++;
409
409
  },
410
410
  remove: function() {
411
411
  e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
412
412
  }
413
413
  };
414
- }, Je = function() {
415
- var e = $e();
414
+ }, qe = function() {
415
+ var e = Ze();
416
416
  return function(t, n) {
417
417
  u.useEffect(function() {
418
418
  return e.add(t), function() {
@@ -420,40 +420,40 @@ var $e = function() {
420
420
  };
421
421
  }, [t && n]);
422
422
  };
423
- }, me = function() {
424
- var e = Je(), t = function(n) {
423
+ }, ve = function() {
424
+ var e = qe(), t = function(n) {
425
425
  var r = n.styles, c = n.dynamic;
426
426
  return e(r, c), null;
427
427
  };
428
428
  return t;
429
- }, et = {
429
+ }, Qe = {
430
430
  left: 0,
431
431
  top: 0,
432
432
  right: 0,
433
433
  gap: 0
434
- }, Y = function(e) {
434
+ }, X = function(e) {
435
435
  return parseInt(e || "", 10) || 0;
436
- }, tt = function(e) {
436
+ }, $e = function(e) {
437
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) {
438
+ return [X(n), X(r), X(c)];
439
+ }, Je = function(e) {
440
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;
441
+ return Qe;
442
+ var t = $e(e), n = document.documentElement.clientWidth, r = window.innerWidth;
443
443
  return {
444
444
  left: t[0],
445
445
  top: t[1],
446
446
  right: t[2],
447
447
  gap: Math.max(0, r - n + t[2] - t[0])
448
448
  };
449
- }, rt = me(), M = "data-scroll-locked", at = function(e, t, n, r) {
449
+ }, et = ve(), N = "data-scroll-locked", tt = function(e, t, n, r) {
450
450
  var c = e.left, i = e.top, l = e.right, a = e.gap;
451
451
  return n === void 0 && (n = "margin"), `
452
- .`.concat(_e, ` {
452
+ .`.concat(We, ` {
453
453
  overflow: hidden `).concat(r, `;
454
454
  padding-right: `).concat(a, "px ").concat(r, `;
455
455
  }
456
- body[`).concat(M, `] {
456
+ body[`).concat(N, `] {
457
457
  overflow: hidden `).concat(r, `;
458
458
  overscroll-behavior: contain;
459
459
  `).concat([
@@ -486,94 +486,94 @@ var $e = function() {
486
486
  margin-right: 0 `).concat(r, `;
487
487
  }
488
488
 
489
- body[`).concat(M, `] {
490
- `).concat(Ue, ": ").concat(a, `px;
489
+ body[`).concat(N, `] {
490
+ `).concat(Be, ": ").concat(a, `px;
491
491
  }
492
492
  `);
493
- }, ae = function() {
494
- var e = parseInt(document.body.getAttribute(M) || "0", 10);
493
+ }, ne = function() {
494
+ var e = parseInt(document.body.getAttribute(N) || "0", 10);
495
495
  return isFinite(e) ? e : 0;
496
- }, ot = function() {
496
+ }, nt = function() {
497
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());
498
+ return document.body.setAttribute(N, (ne() + 1).toString()), function() {
499
+ var e = ne() - 1;
500
+ e <= 0 ? document.body.removeAttribute(N) : document.body.setAttribute(N, e.toString());
501
501
  };
502
502
  }, []);
503
- }, ct = function(e) {
503
+ }, rt = function(e) {
504
504
  var t = e.noRelative, n = e.noImportant, r = e.gapMode, c = r === void 0 ? "margin" : r;
505
- ot();
505
+ nt();
506
506
  var i = u.useMemo(function() {
507
- return nt(c);
507
+ return Je(c);
508
508
  }, [c]);
509
- return u.createElement(rt, { styles: at(i, !t, c, n ? "" : "!important") });
510
- }, G = !1;
509
+ return u.createElement(et, { styles: tt(i, !t, c, n ? "" : "!important") });
510
+ }, Y = !1;
511
511
  if (typeof window < "u")
512
512
  try {
513
513
  var I = Object.defineProperty({}, "passive", {
514
514
  get: function() {
515
- return G = !0, !0;
515
+ return Y = !0, !0;
516
516
  }
517
517
  });
518
518
  window.addEventListener("test", I, I), window.removeEventListener("test", I, I);
519
519
  } catch {
520
- G = !1;
520
+ Y = !1;
521
521
  }
522
- var P = G ? { passive: !1 } : !1, ut = function(e) {
522
+ var P = Y ? { passive: !1 } : !1, at = function(e) {
523
523
  return e.tagName === "TEXTAREA";
524
- }, pe = function(e, t) {
524
+ }, he = function(e, t) {
525
525
  if (!(e instanceof Element))
526
526
  return !1;
527
527
  var n = window.getComputedStyle(e);
528
528
  return (
529
529
  // not-not-scrollable
530
530
  n[t] !== "hidden" && // contains scroll inside self
531
- !(n.overflowY === n.overflowX && !ut(e) && n[t] === "visible")
531
+ !(n.overflowY === n.overflowX && !at(e) && n[t] === "visible")
532
532
  );
533
- }, it = function(e) {
534
- return pe(e, "overflowY");
535
- }, lt = function(e) {
536
- return pe(e, "overflowX");
537
- }, oe = function(e, t) {
533
+ }, ot = function(e) {
534
+ return he(e, "overflowY");
535
+ }, ct = function(e) {
536
+ return he(e, "overflowX");
537
+ }, re = function(e, t) {
538
538
  var n = t.ownerDocument, r = t;
539
539
  do {
540
540
  typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
541
- var c = ge(e, r);
541
+ var c = me(e, r);
542
542
  if (c) {
543
- var i = ye(e, r), l = i[1], a = i[2];
543
+ var i = pe(e, r), l = i[1], a = i[2];
544
544
  if (l > a)
545
545
  return !0;
546
546
  }
547
547
  r = r.parentNode;
548
548
  } while (r && r !== n.body);
549
549
  return !1;
550
- }, st = function(e) {
550
+ }, ut = function(e) {
551
551
  var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
552
552
  return [
553
553
  t,
554
554
  n,
555
555
  r
556
556
  ];
557
- }, ft = function(e) {
557
+ }, it = function(e) {
558
558
  var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
559
559
  return [
560
560
  t,
561
561
  n,
562
562
  r
563
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) {
564
+ }, me = function(e, t) {
565
+ return e === "v" ? ot(t) : ct(t);
566
+ }, pe = function(e, t) {
567
+ return e === "v" ? ut(t) : it(t);
568
+ }, lt = function(e, t) {
569
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;
570
+ }, st = function(e, t, n, r, c) {
571
+ var i = lt(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
572
  do {
573
573
  if (!a)
574
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);
575
+ var h = pe(e, a), w = h[0], o = h[1], s = h[2], d = o - s - i * w;
576
+ (w || d) && me(e, a) && (f += d, v += w);
577
577
  var m = a.parentNode;
578
578
  a = m && m.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? m.host : m;
579
579
  } while (
@@ -584,26 +584,26 @@ var P = G ? { passive: !1 } : !1, ut = function(e) {
584
584
  return (g && (c && Math.abs(f) < 1 || !c && l > f) || !g && (c && Math.abs(v) < 1 || !c && -l > v)) && (b = !0), b;
585
585
  }, x = function(e) {
586
586
  return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
587
- }, ce = function(e) {
587
+ }, ae = function(e) {
588
588
  return [e.deltaX, e.deltaY];
589
- }, ue = function(e) {
589
+ }, oe = function(e) {
590
590
  return e && "current" in e ? e.current : e;
591
- }, ht = function(e, t) {
591
+ }, ft = function(e, t) {
592
592
  return e[0] === t[0] && e[1] === t[1];
593
- }, mt = function(e) {
593
+ }, dt = function(e) {
594
594
  return `
595
595
  .block-interactivity-`.concat(e, ` {pointer-events: none;}
596
596
  .allow-interactivity-`).concat(e, ` {pointer-events: all;}
597
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);
598
+ }, vt = 0, M = [];
599
+ function ht(e) {
600
+ var t = u.useRef([]), n = u.useRef([0, 0]), r = u.useRef(), c = u.useState(vt++)[0], i = u.useState(ve)[0], l = u.useRef(e);
601
601
  u.useEffect(function() {
602
602
  l.current = e;
603
603
  }, [e]), u.useEffect(function() {
604
604
  if (e.inert) {
605
605
  document.body.classList.add("block-interactivity-".concat(c));
606
- var o = De([e.lockRef.current], (e.shards || []).map(ue), !0).filter(Boolean);
606
+ var o = xe([e.lockRef.current], (e.shards || []).map(oe), !0).filter(Boolean);
607
607
  return o.forEach(function(s) {
608
608
  return s.classList.add("allow-interactivity-".concat(c));
609
609
  }), function() {
@@ -616,40 +616,37 @@ function gt(e) {
616
616
  var a = u.useCallback(function(o, s) {
617
617
  if ("touches" in o && o.touches.length === 2 || o.type === "wheel" && o.ctrlKey)
618
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)
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, T = o.target, R = Math.abs(p) > Math.abs(y) ? "h" : "v";
620
+ if ("touches" in o && R === "h" && T.type === "range")
624
621
  return !1;
625
- var F = oe(A, R);
622
+ var F = re(R, T);
626
623
  if (!F)
627
624
  return !0;
628
- if (F ? E = A : (E = A === "v" ? "h" : "v", F = oe(A, R)), !F)
625
+ if (F ? E = R : (E = R === "v" ? "h" : "v", F = re(R, T)), !F)
629
626
  return !1;
630
627
  if (!r.current && "changedTouches" in o && (p || y) && (r.current = E), !E)
631
628
  return !0;
632
- var Z = r.current || E;
633
- return vt(Z, s, o, Z === "h" ? p : y, !0);
629
+ var G = r.current || E;
630
+ return st(G, s, o, G === "h" ? p : y, !0);
634
631
  }, []), S = u.useCallback(function(o) {
635
632
  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);
633
+ if (!(!M.length || M[M.length - 1] !== i)) {
634
+ var d = "deltaY" in s ? ae(s) : x(s), m = t.current.filter(function(E) {
635
+ return E.name === s.type && (E.target === s.target || s.target === E.shadowParent) && ft(E.delta, d);
639
636
  })[0];
640
637
  if (m && m.should) {
641
638
  s.cancelable && s.preventDefault();
642
639
  return;
643
640
  }
644
641
  if (!m) {
645
- var p = (l.current.shards || []).map(ue).filter(Boolean).filter(function(E) {
642
+ var p = (l.current.shards || []).map(oe).filter(Boolean).filter(function(E) {
646
643
  return E.contains(s.target);
647
644
  }), y = p.length > 0 ? a(s, p[0]) : !l.current.noIsolation;
648
645
  y && s.cancelable && s.preventDefault();
649
646
  }
650
647
  }
651
648
  }, []), b = u.useCallback(function(o, s, d, m) {
652
- var p = { name: o, delta: s, target: d, should: m, shadowParent: yt(d) };
649
+ var p = { name: o, delta: s, target: d, should: m, shadowParent: mt(d) };
653
650
  t.current.push(p), setTimeout(function() {
654
651
  t.current = t.current.filter(function(y) {
655
652
  return y !== p;
@@ -658,17 +655,17 @@ function gt(e) {
658
655
  }, []), g = u.useCallback(function(o) {
659
656
  n.current = x(o), r.current = void 0;
660
657
  }, []), f = u.useCallback(function(o) {
661
- b(o.type, ce(o), o.target, a(o, e.lockRef.current));
658
+ b(o.type, ae(o), o.target, a(o, e.lockRef.current));
662
659
  }, []), v = u.useCallback(function(o) {
663
660
  b(o.type, x(o), o.target, a(o, e.lockRef.current));
664
661
  }, []);
665
662
  u.useEffect(function() {
666
- return N.push(i), e.setCallbacks({
663
+ return M.push(i), e.setCallbacks({
667
664
  onScrollCapture: f,
668
665
  onWheelCapture: f,
669
666
  onTouchMoveCapture: v
670
667
  }), document.addEventListener("wheel", S, P), document.addEventListener("touchmove", S, P), document.addEventListener("touchstart", g, P), function() {
671
- N = N.filter(function(o) {
668
+ M = M.filter(function(o) {
672
669
  return o !== i;
673
670
  }), document.removeEventListener("wheel", S, P), document.removeEventListener("touchmove", S, P), document.removeEventListener("touchstart", g, P);
674
671
  };
@@ -677,25 +674,25 @@ function gt(e) {
677
674
  return u.createElement(
678
675
  u.Fragment,
679
676
  null,
680
- w ? u.createElement(i, { styles: mt(c) }) : null,
681
- h ? u.createElement(ct, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
677
+ w ? u.createElement(i, { styles: dt(c) }) : null,
678
+ h ? u.createElement(rt, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
682
679
  );
683
680
  }
684
- function yt(e) {
681
+ function mt(e) {
685
682
  for (var t = null; e !== null; )
686
683
  e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
687
684
  return t;
688
685
  }
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 }));
686
+ const pt = Ve(de, ht);
687
+ var ge = u.forwardRef(function(e, t) {
688
+ return u.createElement(D, C({}, e, { ref: t, sideCar: pt }));
692
689
  });
693
- be.classNames = D.classNames;
694
- const kt = be;
690
+ ge.classNames = D.classNames;
691
+ const Rt = ge;
695
692
  export {
696
- Pe as F,
697
- Te as P,
698
- kt as R,
699
- Tt as h,
700
- At as u
693
+ Ae as F,
694
+ Ce as P,
695
+ Rt as R,
696
+ Ct as h,
697
+ wt as u
701
698
  };