@la-batcave/ui 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +95 -0
  2. package/dist/Alert.d.ts +27 -0
  3. package/dist/Alert.js +56 -0
  4. package/dist/Avatar.d.ts +20 -0
  5. package/dist/Avatar.js +40 -0
  6. package/dist/Badge.d.ts +56 -0
  7. package/dist/Badge.js +74 -0
  8. package/dist/Button.d.ts +53 -0
  9. package/dist/Button.js +66 -0
  10. package/dist/Card.d.ts +18 -0
  11. package/dist/Card.js +98 -0
  12. package/dist/CodeBlock.d.ts +45 -0
  13. package/dist/CodeBlock.js +306 -0
  14. package/dist/Collapse.d.ts +58 -0
  15. package/dist/Collapse.js +89 -0
  16. package/dist/Combobox.d.ts +44 -0
  17. package/dist/Combobox.js +409 -0
  18. package/dist/DarkMode.d.ts +59 -0
  19. package/dist/DarkMode.js +56 -0
  20. package/dist/DatePicker.d.ts +48 -0
  21. package/dist/DatePicker.js +2954 -0
  22. package/dist/Dialog.d.ts +119 -0
  23. package/dist/Dialog.js +337 -0
  24. package/dist/Drawer.d.ts +28 -0
  25. package/dist/Drawer.js +1126 -0
  26. package/dist/Dropdown.d.ts +23 -0
  27. package/dist/Dropdown.js +247 -0
  28. package/dist/EasyForm.d.ts +138 -0
  29. package/dist/EasyForm.js +286 -0
  30. package/dist/HoverCard.d.ts +10 -0
  31. package/dist/HoverCard.js +195 -0
  32. package/dist/Input.d.ts +230 -0
  33. package/dist/Input.js +2216 -0
  34. package/dist/LogViewer.d.ts +57 -0
  35. package/dist/LogViewer.js +120 -0
  36. package/dist/Menubar.d.ts +32 -0
  37. package/dist/Menubar.js +398 -0
  38. package/dist/Navbar.d.ts +20 -0
  39. package/dist/Navbar.js +31 -0
  40. package/dist/Pagination.d.ts +78 -0
  41. package/dist/Pagination.js +106 -0
  42. package/dist/Popover.d.ts +11 -0
  43. package/dist/Popover.js +28 -0
  44. package/dist/ProgressBar.d.ts +35 -0
  45. package/dist/ProgressBar.js +210 -0
  46. package/dist/Resizable.d.ts +23 -0
  47. package/dist/Resizable.js +1532 -0
  48. package/dist/Separator.d.ts +4 -0
  49. package/dist/Separator.js +46 -0
  50. package/dist/Sheet.d.ts +29 -0
  51. package/dist/Sheet.js +104 -0
  52. package/dist/Sidebar.d.ts +117 -0
  53. package/dist/Sidebar.js +237 -0
  54. package/dist/Skeleton.d.ts +57 -0
  55. package/dist/Skeleton.js +47 -0
  56. package/dist/Table.d.ts +71 -0
  57. package/dist/Table.js +94 -0
  58. package/dist/Tabs.d.ts +76 -0
  59. package/dist/Tabs.js +202 -0
  60. package/dist/Toast.d.ts +54 -0
  61. package/dist/Toast.js +827 -0
  62. package/dist/Tooltip.d.ts +29 -0
  63. package/dist/Tooltip.js +352 -0
  64. package/dist/Typography.d.ts +101 -0
  65. package/dist/Typography.js +123 -0
  66. package/dist/Widget.d.ts +133 -0
  67. package/dist/Widget.js +207 -0
  68. package/dist/_shared/Combination-D_l4PLF_.js +676 -0
  69. package/dist/_shared/index-B03TCNO5.js +142 -0
  70. package/dist/_shared/index-B1f-hyuh.js +31 -0
  71. package/dist/_shared/index-BC7vfx-u.js +13 -0
  72. package/dist/_shared/index-BrLJJgkl.js +67 -0
  73. package/dist/_shared/index-C0gNQvxa.js +269 -0
  74. package/dist/_shared/index-C3aZemLI.js +268 -0
  75. package/dist/_shared/index-CXeb1OMI.js +198 -0
  76. package/dist/_shared/index-CukUn3R0.js +626 -0
  77. package/dist/_shared/index-DLcqcWxM.js +29 -0
  78. package/dist/_shared/index-DlSuDb9N.js +283 -0
  79. package/dist/_shared/index-V-Ajw7Ac.js +79 -0
  80. package/dist/_shared/index-uPOYJZpG.js +34 -0
  81. package/dist/_shared/index-uu9PT5Nu.js +1588 -0
  82. package/dist/_shared/utils-eGXXUFl7.js +2935 -0
  83. package/dist/backgrounds/Aurora.d.ts +7 -0
  84. package/dist/backgrounds/Aurora.js +126 -0
  85. package/dist/backgrounds/Iridescence.d.ts +7 -0
  86. package/dist/backgrounds/Iridescence.js +77 -0
  87. package/dist/backgrounds/Lightning.d.ts +8 -0
  88. package/dist/backgrounds/Lightning.js +75 -0
  89. package/dist/backgrounds/LiquidChrome.d.ts +9 -0
  90. package/dist/backgrounds/LiquidChrome.js +89 -0
  91. package/dist/backgrounds/Particles.d.ts +15 -0
  92. package/dist/backgrounds/Particles.js +137 -0
  93. package/dist/backgrounds/PixelSnow.d.ts +9 -0
  94. package/dist/backgrounds/PixelSnow.js +52 -0
  95. package/dist/backgrounds/Silk.d.ts +8 -0
  96. package/dist/backgrounds/Silk.js +92 -0
  97. package/dist/backgrounds/Squares.d.ts +9 -0
  98. package/dist/backgrounds/Squares.js +75 -0
  99. package/dist/backgrounds/Threads.d.ts +7 -0
  100. package/dist/backgrounds/Threads.js +110 -0
  101. package/dist/backgrounds/Waves.d.ts +14 -0
  102. package/dist/backgrounds/Waves.js +139 -0
  103. package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
  104. package/dist/index.css +1 -0
  105. package/dist/index.d.ts +2 -0
  106. package/dist/index.js +4 -0
  107. package/package.json +318 -0
@@ -0,0 +1,676 @@
1
+ import * as u from "react";
2
+ import { useState as ge } from "react";
3
+ import { u as ye } from "./index-DLcqcWxM.js";
4
+ import { P as be } from "./index-V-Ajw7Ac.js";
5
+ import { d as q } from "./index-CXeb1OMI.js";
6
+ import { jsx as Ee } from "react/jsx-runtime";
7
+ var _ = 0;
8
+ function Et() {
9
+ u.useEffect(() => {
10
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
11
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? Q()), document.body.insertAdjacentElement("beforeend", e[1] ?? Q()), _++, () => {
12
+ _ === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), _--;
13
+ };
14
+ }, []);
15
+ }
16
+ function Q() {
17
+ const e = document.createElement("span");
18
+ 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;
19
+ }
20
+ var j = "focusScope.autoFocusOnMount", K = "focusScope.autoFocusOnUnmount", $ = { bubbles: !1, cancelable: !0 }, Se = "FocusScope", we = u.forwardRef((e, t) => {
21
+ const {
22
+ loop: n = !1,
23
+ trapped: r = !1,
24
+ onMountAutoFocus: c,
25
+ onUnmountAutoFocus: i,
26
+ ...s
27
+ } = e, [a, S] = u.useState(null), b = q(c), g = q(i), f = u.useRef(null), v = ye(t, (o) => S(o)), h = u.useRef({
28
+ paused: !1,
29
+ pause() {
30
+ this.paused = !0;
31
+ },
32
+ resume() {
33
+ this.paused = !1;
34
+ }
35
+ }).current;
36
+ u.useEffect(() => {
37
+ if (r) {
38
+ let o = function(p) {
39
+ if (h.paused || !a) return;
40
+ const y = p.target;
41
+ a.contains(y) ? f.current = y : A(f.current, { select: !0 });
42
+ }, l = function(p) {
43
+ if (h.paused || !a) return;
44
+ const y = p.relatedTarget;
45
+ y !== null && (a.contains(y) || A(f.current, { select: !0 }));
46
+ }, d = function(p) {
47
+ if (document.activeElement === document.body)
48
+ for (const E of p)
49
+ E.removedNodes.length > 0 && A(a);
50
+ };
51
+ document.addEventListener("focusin", o), document.addEventListener("focusout", l);
52
+ const m = new MutationObserver(d);
53
+ return a && m.observe(a, { childList: !0, subtree: !0 }), () => {
54
+ document.removeEventListener("focusin", o), document.removeEventListener("focusout", l), m.disconnect();
55
+ };
56
+ }
57
+ }, [r, a, h.paused]), u.useEffect(() => {
58
+ if (a) {
59
+ ee.add(h);
60
+ const o = document.activeElement;
61
+ if (!a.contains(o)) {
62
+ const d = new CustomEvent(j, $);
63
+ a.addEventListener(j, b), a.dispatchEvent(d), d.defaultPrevented || (Ce(Ne(ue(a)), { select: !0 }), document.activeElement === o && A(a));
64
+ }
65
+ return () => {
66
+ a.removeEventListener(j, b), setTimeout(() => {
67
+ const d = new CustomEvent(K, $);
68
+ a.addEventListener(K, g), a.dispatchEvent(d), d.defaultPrevented || A(o ?? document.body, { select: !0 }), a.removeEventListener(K, g), ee.remove(h);
69
+ }, 0);
70
+ };
71
+ }
72
+ }, [a, b, g, h]);
73
+ const w = u.useCallback(
74
+ (o) => {
75
+ if (!n && !r || h.paused) return;
76
+ const l = o.key === "Tab" && !o.altKey && !o.ctrlKey && !o.metaKey, d = document.activeElement;
77
+ if (l && d) {
78
+ const m = o.currentTarget, [p, y] = Re(m);
79
+ 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();
80
+ }
81
+ },
82
+ [n, r, h.paused]
83
+ );
84
+ return /* @__PURE__ */ Ee(be.div, { tabIndex: -1, ...s, ref: v, onKeyDown: w });
85
+ });
86
+ we.displayName = Se;
87
+ function Ce(e, { select: t = !1 } = {}) {
88
+ const n = document.activeElement;
89
+ for (const r of e)
90
+ if (A(r, { select: t }), document.activeElement !== n) return;
91
+ }
92
+ function Re(e) {
93
+ const t = ue(e), n = J(t, e), r = J(t.reverse(), e);
94
+ return [n, r];
95
+ }
96
+ function ue(e) {
97
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
98
+ acceptNode: (r) => {
99
+ const c = r.tagName === "INPUT" && r.type === "hidden";
100
+ return r.disabled || r.hidden || c ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
101
+ }
102
+ });
103
+ for (; n.nextNode(); ) t.push(n.currentNode);
104
+ return t;
105
+ }
106
+ function J(e, t) {
107
+ for (const n of e)
108
+ if (!ke(n, { upTo: t })) return n;
109
+ }
110
+ function ke(e, { upTo: t }) {
111
+ if (getComputedStyle(e).visibility === "hidden") return !0;
112
+ for (; e; ) {
113
+ if (t !== void 0 && e === t) return !1;
114
+ if (getComputedStyle(e).display === "none") return !0;
115
+ e = e.parentElement;
116
+ }
117
+ return !1;
118
+ }
119
+ function Ae(e) {
120
+ return e instanceof HTMLInputElement && "select" in e;
121
+ }
122
+ function A(e, { select: t = !1 } = {}) {
123
+ if (e && e.focus) {
124
+ const n = document.activeElement;
125
+ e.focus({ preventScroll: !0 }), e !== n && Ae(e) && t && e.select();
126
+ }
127
+ }
128
+ var ee = Te();
129
+ function Te() {
130
+ let e = [];
131
+ return {
132
+ add(t) {
133
+ const n = e[0];
134
+ t !== n && n?.pause(), e = te(e, t), e.unshift(t);
135
+ },
136
+ remove(t) {
137
+ e = te(e, t), e[0]?.resume();
138
+ }
139
+ };
140
+ }
141
+ function te(e, t) {
142
+ const n = [...e], r = n.indexOf(t);
143
+ return r !== -1 && n.splice(r, 1), n;
144
+ }
145
+ function Ne(e) {
146
+ return e.filter((t) => t.tagName !== "A");
147
+ }
148
+ var Me = function(e) {
149
+ if (typeof document > "u")
150
+ return null;
151
+ var t = Array.isArray(e) ? e[0] : e;
152
+ return t.ownerDocument.body;
153
+ }, T = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), L = {}, H = 0, ie = function(e) {
154
+ return e && (e.host || ie(e.parentNode));
155
+ }, Fe = function(e, t) {
156
+ return t.map(function(n) {
157
+ if (e.contains(n))
158
+ return n;
159
+ var r = ie(n);
160
+ return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
161
+ }).filter(function(n) {
162
+ return !!n;
163
+ });
164
+ }, Pe = function(e, t, n, r) {
165
+ var c = Fe(t, Array.isArray(e) ? e : [e]);
166
+ L[n] || (L[n] = /* @__PURE__ */ new WeakMap());
167
+ var i = L[n], s = [], a = /* @__PURE__ */ new Set(), S = new Set(c), b = function(f) {
168
+ !f || a.has(f) || (a.add(f), b(f.parentNode));
169
+ };
170
+ c.forEach(b);
171
+ var g = function(f) {
172
+ !f || S.has(f) || Array.prototype.forEach.call(f.children, function(v) {
173
+ if (a.has(v))
174
+ g(v);
175
+ else
176
+ try {
177
+ var h = v.getAttribute(r), w = h !== null && h !== "false", o = (T.get(v) || 0) + 1, l = (i.get(v) || 0) + 1;
178
+ T.set(v, o), i.set(v, l), s.push(v), o === 1 && w && O.set(v, !0), l === 1 && v.setAttribute(n, "true"), w || v.setAttribute(r, "true");
179
+ } catch (d) {
180
+ console.error("aria-hidden: cannot operate on ", v, d);
181
+ }
182
+ });
183
+ };
184
+ return g(t), a.clear(), H++, function() {
185
+ s.forEach(function(f) {
186
+ var v = T.get(f) - 1, h = i.get(f) - 1;
187
+ T.set(f, v), i.set(f, h), v || (O.has(f) || f.removeAttribute(r), O.delete(f)), h || f.removeAttribute(n);
188
+ }), H--, H || (T = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), L = {});
189
+ };
190
+ }, St = function(e, t, n) {
191
+ n === void 0 && (n = "data-aria-hidden");
192
+ var r = Array.from(Array.isArray(e) ? e : [e]), c = Me(e);
193
+ return c ? (r.push.apply(r, Array.from(c.querySelectorAll("[aria-live], script"))), Pe(r, c, n, "aria-hidden")) : function() {
194
+ return null;
195
+ };
196
+ }, C = function() {
197
+ return C = Object.assign || function(t) {
198
+ for (var n, r = 1, c = arguments.length; r < c; r++) {
199
+ n = arguments[r];
200
+ for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
201
+ }
202
+ return t;
203
+ }, C.apply(this, arguments);
204
+ };
205
+ function le(e, t) {
206
+ var n = {};
207
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
208
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
209
+ for (var c = 0, r = Object.getOwnPropertySymbols(e); c < r.length; c++)
210
+ t.indexOf(r[c]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[c]) && (n[r[c]] = e[r[c]]);
211
+ return n;
212
+ }
213
+ function Oe(e, t, n) {
214
+ if (n || arguments.length === 2) for (var r = 0, c = t.length, i; r < c; r++)
215
+ (i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
216
+ return e.concat(i || Array.prototype.slice.call(t));
217
+ }
218
+ var W = "right-scroll-bar-position", B = "width-before-scroll-bar", Le = "with-scroll-bars-hidden", Ie = "--removed-body-scroll-bar-size";
219
+ function V(e, t) {
220
+ return typeof e == "function" ? e(t) : e && (e.current = t), e;
221
+ }
222
+ function xe(e, t) {
223
+ var n = ge(function() {
224
+ return {
225
+ // value
226
+ value: e,
227
+ // last callback
228
+ callback: t,
229
+ // "memoized" public interface
230
+ facade: {
231
+ get current() {
232
+ return n.value;
233
+ },
234
+ set current(r) {
235
+ var c = n.value;
236
+ c !== r && (n.value = r, n.callback(r, c));
237
+ }
238
+ }
239
+ };
240
+ })[0];
241
+ return n.callback = t, n.facade;
242
+ }
243
+ var We = typeof window < "u" ? u.useLayoutEffect : u.useEffect, ne = /* @__PURE__ */ new WeakMap();
244
+ function Be(e, t) {
245
+ var n = xe(null, function(r) {
246
+ return e.forEach(function(c) {
247
+ return V(c, r);
248
+ });
249
+ });
250
+ return We(function() {
251
+ var r = ne.get(n);
252
+ if (r) {
253
+ var c = new Set(r), i = new Set(e), s = n.current;
254
+ c.forEach(function(a) {
255
+ i.has(a) || V(a, null);
256
+ }), i.forEach(function(a) {
257
+ c.has(a) || V(a, s);
258
+ });
259
+ }
260
+ ne.set(n, e);
261
+ }, [e]), n;
262
+ }
263
+ function De(e) {
264
+ return e;
265
+ }
266
+ function Ue(e, t) {
267
+ t === void 0 && (t = De);
268
+ var n = [], r = !1, c = {
269
+ read: function() {
270
+ if (r)
271
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
272
+ return n.length ? n[n.length - 1] : e;
273
+ },
274
+ useMedium: function(i) {
275
+ var s = t(i, r);
276
+ return n.push(s), function() {
277
+ n = n.filter(function(a) {
278
+ return a !== s;
279
+ });
280
+ };
281
+ },
282
+ assignSyncMedium: function(i) {
283
+ for (r = !0; n.length; ) {
284
+ var s = n;
285
+ n = [], s.forEach(i);
286
+ }
287
+ n = {
288
+ push: function(a) {
289
+ return i(a);
290
+ },
291
+ filter: function() {
292
+ return n;
293
+ }
294
+ };
295
+ },
296
+ assignMedium: function(i) {
297
+ r = !0;
298
+ var s = [];
299
+ if (n.length) {
300
+ var a = n;
301
+ n = [], a.forEach(i), s = n;
302
+ }
303
+ var S = function() {
304
+ var g = s;
305
+ s = [], g.forEach(i);
306
+ }, b = function() {
307
+ return Promise.resolve().then(S);
308
+ };
309
+ b(), n = {
310
+ push: function(g) {
311
+ s.push(g), b();
312
+ },
313
+ filter: function(g) {
314
+ return s = s.filter(g), n;
315
+ }
316
+ };
317
+ }
318
+ };
319
+ return c;
320
+ }
321
+ function _e(e) {
322
+ e === void 0 && (e = {});
323
+ var t = Ue(null);
324
+ return t.options = C({ async: !0, ssr: !1 }, e), t;
325
+ }
326
+ var se = function(e) {
327
+ var t = e.sideCar, n = le(e, ["sideCar"]);
328
+ if (!t)
329
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
330
+ var r = t.read();
331
+ if (!r)
332
+ throw new Error("Sidecar medium not found");
333
+ return u.createElement(r, C({}, n));
334
+ };
335
+ se.isSideCarExport = !0;
336
+ function je(e, t) {
337
+ return e.useMedium(t), se;
338
+ }
339
+ var fe = _e(), X = function() {
340
+ }, D = u.forwardRef(function(e, t) {
341
+ var n = u.useRef(null), r = u.useState({
342
+ onScrollCapture: X,
343
+ onWheelCapture: X,
344
+ onTouchMoveCapture: X
345
+ }), c = r[0], i = r[1], s = 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, l = e.allowPinchZoom, d = e.as, m = d === void 0 ? "div" : d, p = e.gapMode, y = le(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = v, R = Be([n, t]), k = C(C({}, y), c);
346
+ return u.createElement(
347
+ u.Fragment,
348
+ null,
349
+ g && u.createElement(E, { sideCar: fe, removeScrollBar: b, shards: f, noRelative: h, noIsolation: w, inert: o, setCallbacks: i, allowPinchZoom: !!l, lockRef: n, gapMode: p }),
350
+ s ? u.cloneElement(u.Children.only(a), C(C({}, k), { ref: R })) : u.createElement(m, C({}, k, { className: S, ref: R }), a)
351
+ );
352
+ });
353
+ D.defaultProps = {
354
+ enabled: !0,
355
+ removeScrollBar: !0,
356
+ inert: !1
357
+ };
358
+ D.classNames = {
359
+ fullWidth: B,
360
+ zeroRight: W
361
+ };
362
+ var Ke = function() {
363
+ if (typeof __webpack_nonce__ < "u")
364
+ return __webpack_nonce__;
365
+ };
366
+ function He() {
367
+ if (!document)
368
+ return null;
369
+ var e = document.createElement("style");
370
+ e.type = "text/css";
371
+ var t = Ke();
372
+ return t && e.setAttribute("nonce", t), e;
373
+ }
374
+ function Ve(e, t) {
375
+ e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
376
+ }
377
+ function Xe(e) {
378
+ var t = document.head || document.getElementsByTagName("head")[0];
379
+ t.appendChild(e);
380
+ }
381
+ var Ye = function() {
382
+ var e = 0, t = null;
383
+ return {
384
+ add: function(n) {
385
+ e == 0 && (t = He()) && (Ve(t, n), Xe(t)), e++;
386
+ },
387
+ remove: function() {
388
+ e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
389
+ }
390
+ };
391
+ }, Ge = function() {
392
+ var e = Ye();
393
+ return function(t, n) {
394
+ u.useEffect(function() {
395
+ return e.add(t), function() {
396
+ e.remove();
397
+ };
398
+ }, [t && n]);
399
+ };
400
+ }, de = function() {
401
+ var e = Ge(), t = function(n) {
402
+ var r = n.styles, c = n.dynamic;
403
+ return e(r, c), null;
404
+ };
405
+ return t;
406
+ }, ze = {
407
+ left: 0,
408
+ top: 0,
409
+ right: 0,
410
+ gap: 0
411
+ }, Y = function(e) {
412
+ return parseInt(e || "", 10) || 0;
413
+ }, Ze = function(e) {
414
+ var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], c = t[e === "padding" ? "paddingRight" : "marginRight"];
415
+ return [Y(n), Y(r), Y(c)];
416
+ }, qe = function(e) {
417
+ if (e === void 0 && (e = "margin"), typeof window > "u")
418
+ return ze;
419
+ var t = Ze(e), n = document.documentElement.clientWidth, r = window.innerWidth;
420
+ return {
421
+ left: t[0],
422
+ top: t[1],
423
+ right: t[2],
424
+ gap: Math.max(0, r - n + t[2] - t[0])
425
+ };
426
+ }, Qe = de(), F = "data-scroll-locked", $e = function(e, t, n, r) {
427
+ var c = e.left, i = e.top, s = e.right, a = e.gap;
428
+ return n === void 0 && (n = "margin"), `
429
+ .`.concat(Le, ` {
430
+ overflow: hidden `).concat(r, `;
431
+ padding-right: `).concat(a, "px ").concat(r, `;
432
+ }
433
+ body[`).concat(F, `] {
434
+ overflow: hidden `).concat(r, `;
435
+ overscroll-behavior: contain;
436
+ `).concat([
437
+ t && "position: relative ".concat(r, ";"),
438
+ n === "margin" && `
439
+ padding-left: `.concat(c, `px;
440
+ padding-top: `).concat(i, `px;
441
+ padding-right: `).concat(s, `px;
442
+ margin-left:0;
443
+ margin-top:0;
444
+ margin-right: `).concat(a, "px ").concat(r, `;
445
+ `),
446
+ n === "padding" && "padding-right: ".concat(a, "px ").concat(r, ";")
447
+ ].filter(Boolean).join(""), `
448
+ }
449
+
450
+ .`).concat(W, ` {
451
+ right: `).concat(a, "px ").concat(r, `;
452
+ }
453
+
454
+ .`).concat(B, ` {
455
+ margin-right: `).concat(a, "px ").concat(r, `;
456
+ }
457
+
458
+ .`).concat(W, " .").concat(W, ` {
459
+ right: 0 `).concat(r, `;
460
+ }
461
+
462
+ .`).concat(B, " .").concat(B, ` {
463
+ margin-right: 0 `).concat(r, `;
464
+ }
465
+
466
+ body[`).concat(F, `] {
467
+ `).concat(Ie, ": ").concat(a, `px;
468
+ }
469
+ `);
470
+ }, re = function() {
471
+ var e = parseInt(document.body.getAttribute(F) || "0", 10);
472
+ return isFinite(e) ? e : 0;
473
+ }, Je = function() {
474
+ u.useEffect(function() {
475
+ return document.body.setAttribute(F, (re() + 1).toString()), function() {
476
+ var e = re() - 1;
477
+ e <= 0 ? document.body.removeAttribute(F) : document.body.setAttribute(F, e.toString());
478
+ };
479
+ }, []);
480
+ }, et = function(e) {
481
+ var t = e.noRelative, n = e.noImportant, r = e.gapMode, c = r === void 0 ? "margin" : r;
482
+ Je();
483
+ var i = u.useMemo(function() {
484
+ return qe(c);
485
+ }, [c]);
486
+ return u.createElement(Qe, { styles: $e(i, !t, c, n ? "" : "!important") });
487
+ }, G = !1;
488
+ if (typeof window < "u")
489
+ try {
490
+ var I = Object.defineProperty({}, "passive", {
491
+ get: function() {
492
+ return G = !0, !0;
493
+ }
494
+ });
495
+ window.addEventListener("test", I, I), window.removeEventListener("test", I, I);
496
+ } catch {
497
+ G = !1;
498
+ }
499
+ var N = G ? { passive: !1 } : !1, tt = function(e) {
500
+ return e.tagName === "TEXTAREA";
501
+ }, ve = function(e, t) {
502
+ if (!(e instanceof Element))
503
+ return !1;
504
+ var n = window.getComputedStyle(e);
505
+ return (
506
+ // not-not-scrollable
507
+ n[t] !== "hidden" && // contains scroll inside self
508
+ !(n.overflowY === n.overflowX && !tt(e) && n[t] === "visible")
509
+ );
510
+ }, nt = function(e) {
511
+ return ve(e, "overflowY");
512
+ }, rt = function(e) {
513
+ return ve(e, "overflowX");
514
+ }, ae = function(e, t) {
515
+ var n = t.ownerDocument, r = t;
516
+ do {
517
+ typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
518
+ var c = he(e, r);
519
+ if (c) {
520
+ var i = me(e, r), s = i[1], a = i[2];
521
+ if (s > a)
522
+ return !0;
523
+ }
524
+ r = r.parentNode;
525
+ } while (r && r !== n.body);
526
+ return !1;
527
+ }, at = function(e) {
528
+ var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
529
+ return [
530
+ t,
531
+ n,
532
+ r
533
+ ];
534
+ }, ot = function(e) {
535
+ var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
536
+ return [
537
+ t,
538
+ n,
539
+ r
540
+ ];
541
+ }, he = function(e, t) {
542
+ return e === "v" ? nt(t) : rt(t);
543
+ }, me = function(e, t) {
544
+ return e === "v" ? at(t) : ot(t);
545
+ }, ct = function(e, t) {
546
+ return e === "h" && t === "rtl" ? -1 : 1;
547
+ }, ut = function(e, t, n, r, c) {
548
+ var i = ct(e, window.getComputedStyle(t).direction), s = i * r, a = n.target, S = t.contains(a), b = !1, g = s > 0, f = 0, v = 0;
549
+ do {
550
+ if (!a)
551
+ break;
552
+ var h = me(e, a), w = h[0], o = h[1], l = h[2], d = o - l - i * w;
553
+ (w || d) && he(e, a) && (f += d, v += w);
554
+ var m = a.parentNode;
555
+ a = m && m.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? m.host : m;
556
+ } while (
557
+ // portaled content
558
+ !S && a !== document.body || // self content
559
+ S && (t.contains(a) || t === a)
560
+ );
561
+ return (g && Math.abs(f) < 1 || !g && Math.abs(v) < 1) && (b = !0), b;
562
+ }, x = function(e) {
563
+ return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
564
+ }, oe = function(e) {
565
+ return [e.deltaX, e.deltaY];
566
+ }, ce = function(e) {
567
+ return e && "current" in e ? e.current : e;
568
+ }, it = function(e, t) {
569
+ return e[0] === t[0] && e[1] === t[1];
570
+ }, lt = function(e) {
571
+ return `
572
+ .block-interactivity-`.concat(e, ` {pointer-events: none;}
573
+ .allow-interactivity-`).concat(e, ` {pointer-events: all;}
574
+ `);
575
+ }, st = 0, M = [];
576
+ function ft(e) {
577
+ var t = u.useRef([]), n = u.useRef([0, 0]), r = u.useRef(), c = u.useState(st++)[0], i = u.useState(de)[0], s = u.useRef(e);
578
+ u.useEffect(function() {
579
+ s.current = e;
580
+ }, [e]), u.useEffect(function() {
581
+ if (e.inert) {
582
+ document.body.classList.add("block-interactivity-".concat(c));
583
+ var o = Oe([e.lockRef.current], (e.shards || []).map(ce), !0).filter(Boolean);
584
+ return o.forEach(function(l) {
585
+ return l.classList.add("allow-interactivity-".concat(c));
586
+ }), function() {
587
+ document.body.classList.remove("block-interactivity-".concat(c)), o.forEach(function(l) {
588
+ return l.classList.remove("allow-interactivity-".concat(c));
589
+ });
590
+ };
591
+ }
592
+ }, [e.inert, e.lockRef.current, e.shards]);
593
+ var a = u.useCallback(function(o, l) {
594
+ if ("touches" in o && o.touches.length === 2 || o.type === "wheel" && o.ctrlKey)
595
+ return !s.current.allowPinchZoom;
596
+ 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, k = Math.abs(p) > Math.abs(y) ? "h" : "v";
597
+ if ("touches" in o && k === "h" && R.type === "range")
598
+ return !1;
599
+ var z = window.getSelection(), U = z && z.anchorNode, pe = U ? U === R || U.contains(R) : !1;
600
+ if (pe)
601
+ return !1;
602
+ var P = ae(k, R);
603
+ if (!P)
604
+ return !0;
605
+ if (P ? E = k : (E = k === "v" ? "h" : "v", P = ae(k, R)), !P)
606
+ return !1;
607
+ if (!r.current && "changedTouches" in o && (p || y) && (r.current = E), !E)
608
+ return !0;
609
+ var Z = r.current || E;
610
+ return ut(Z, l, o, Z === "h" ? p : y);
611
+ }, []), S = u.useCallback(function(o) {
612
+ var l = o;
613
+ if (!(!M.length || M[M.length - 1] !== i)) {
614
+ var d = "deltaY" in l ? oe(l) : x(l), m = t.current.filter(function(E) {
615
+ return E.name === l.type && (E.target === l.target || l.target === E.shadowParent) && it(E.delta, d);
616
+ })[0];
617
+ if (m && m.should) {
618
+ l.cancelable && l.preventDefault();
619
+ return;
620
+ }
621
+ if (!m) {
622
+ var p = (s.current.shards || []).map(ce).filter(Boolean).filter(function(E) {
623
+ return E.contains(l.target);
624
+ }), y = p.length > 0 ? a(l, p[0]) : !s.current.noIsolation;
625
+ y && l.cancelable && l.preventDefault();
626
+ }
627
+ }
628
+ }, []), b = u.useCallback(function(o, l, d, m) {
629
+ var p = { name: o, delta: l, target: d, should: m, shadowParent: dt(d) };
630
+ t.current.push(p), setTimeout(function() {
631
+ t.current = t.current.filter(function(y) {
632
+ return y !== p;
633
+ });
634
+ }, 1);
635
+ }, []), g = u.useCallback(function(o) {
636
+ n.current = x(o), r.current = void 0;
637
+ }, []), f = u.useCallback(function(o) {
638
+ b(o.type, oe(o), o.target, a(o, e.lockRef.current));
639
+ }, []), v = u.useCallback(function(o) {
640
+ b(o.type, x(o), o.target, a(o, e.lockRef.current));
641
+ }, []);
642
+ u.useEffect(function() {
643
+ return M.push(i), e.setCallbacks({
644
+ onScrollCapture: f,
645
+ onWheelCapture: f,
646
+ onTouchMoveCapture: v
647
+ }), document.addEventListener("wheel", S, N), document.addEventListener("touchmove", S, N), document.addEventListener("touchstart", g, N), function() {
648
+ M = M.filter(function(o) {
649
+ return o !== i;
650
+ }), document.removeEventListener("wheel", S, N), document.removeEventListener("touchmove", S, N), document.removeEventListener("touchstart", g, N);
651
+ };
652
+ }, []);
653
+ var h = e.removeScrollBar, w = e.inert;
654
+ return u.createElement(
655
+ u.Fragment,
656
+ null,
657
+ w ? u.createElement(i, { styles: lt(c) }) : null,
658
+ h ? u.createElement(et, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
659
+ );
660
+ }
661
+ function dt(e) {
662
+ for (var t = null; e !== null; )
663
+ e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
664
+ return t;
665
+ }
666
+ const vt = je(fe, ft);
667
+ var ht = u.forwardRef(function(e, t) {
668
+ return u.createElement(D, C({}, e, { ref: t, sideCar: vt }));
669
+ });
670
+ ht.classNames = D.classNames;
671
+ export {
672
+ we as F,
673
+ ht as R,
674
+ St as h,
675
+ Et as u
676
+ };