@luciodale/swipe-bar 1.3.2 → 1.3.4

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.
@@ -1,4 +1,4 @@
1
- import xt, { createContext as Rt, useState as Q, useRef as L, useMemo as Je, useCallback as B, useEffect as z, useContext as Tt } from "react";
1
+ import Rt, { createContext as Tt, useState as Q, useRef as _, useMemo as Ke, useCallback as Y, useEffect as G, useContext as Et } from "react";
2
2
  var Re = { exports: {} }, me = {};
3
3
  /**
4
4
  * @license React
@@ -9,29 +9,29 @@ var Re = { exports: {} }, me = {};
9
9
  * This source code is licensed under the MIT license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
- var $e;
12
+ var Be;
13
13
  function Ot() {
14
- if ($e) return me;
15
- $e = 1;
14
+ if (Be) return me;
15
+ Be = 1;
16
16
  var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
17
- function r(i, s, o) {
18
- var f = null;
19
- if (o !== void 0 && (f = "" + o), s.key !== void 0 && (f = "" + s.key), "key" in s) {
17
+ function r(i, c, o) {
18
+ var u = null;
19
+ if (o !== void 0 && (u = "" + o), c.key !== void 0 && (u = "" + c.key), "key" in c) {
20
20
  o = {};
21
- for (var c in s)
22
- c !== "key" && (o[c] = s[c]);
23
- } else o = s;
24
- return s = o.ref, {
21
+ for (var f in c)
22
+ f !== "key" && (o[f] = c[f]);
23
+ } else o = c;
24
+ return c = o.ref, {
25
25
  $$typeof: e,
26
26
  type: i,
27
- key: f,
28
- ref: s !== void 0 ? s : null,
27
+ key: u,
28
+ ref: c !== void 0 ? c : null,
29
29
  props: o
30
30
  };
31
31
  }
32
32
  return me.Fragment = t, me.jsx = r, me.jsxs = r, me;
33
33
  }
34
- var ve = {};
34
+ var be = {};
35
35
  /**
36
36
  * @license React
37
37
  * react-jsx-runtime.development.js
@@ -42,25 +42,25 @@ var ve = {};
42
42
  * LICENSE file in the root directory of this source tree.
43
43
  */
44
44
  var We;
45
- function Et() {
45
+ function At() {
46
46
  return We || (We = 1, process.env.NODE_ENV !== "production" && function() {
47
47
  function e(n) {
48
48
  if (n == null) return null;
49
49
  if (typeof n == "function")
50
- return n.$$typeof === V ? null : n.displayName || n.name || null;
50
+ return n.$$typeof === q ? null : n.displayName || n.name || null;
51
51
  if (typeof n == "string") return n;
52
52
  switch (n) {
53
- case M:
53
+ case P:
54
54
  return "Fragment";
55
- case C:
55
+ case I:
56
56
  return "Profiler";
57
- case _:
57
+ case L:
58
58
  return "StrictMode";
59
59
  case k:
60
60
  return "Suspense";
61
61
  case v:
62
62
  return "SuspenseList";
63
- case P:
63
+ case M:
64
64
  return "Activity";
65
65
  }
66
66
  if (typeof n == "object")
@@ -71,17 +71,17 @@ function Et() {
71
71
  return "Portal";
72
72
  case j:
73
73
  return n.displayName || "Context";
74
- case Y:
75
- return (n._context.displayName || "Context") + ".Consumer";
76
74
  case $:
77
- var h = n.render;
78
- return n = n.displayName, n || (n = h.displayName || h.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
79
- case y:
80
- return h = n.displayName || null, h !== null ? h : e(n.type) || "Memo";
81
- case O:
82
- h = n._payload, n = n._init;
75
+ return (n._context.displayName || "Context") + ".Consumer";
76
+ case B:
77
+ var m = n.render;
78
+ return n = n.displayName, n || (n = m.displayName || m.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
79
+ case x:
80
+ return m = n.displayName || null, m !== null ? m : e(n.type) || "Memo";
81
+ case E:
82
+ m = n._payload, n = n._init;
83
83
  try {
84
- return e(n(h));
84
+ return e(n(m));
85
85
  } catch {
86
86
  }
87
87
  }
@@ -93,74 +93,74 @@ function Et() {
93
93
  function r(n) {
94
94
  try {
95
95
  t(n);
96
- var h = !1;
96
+ var m = !1;
97
97
  } catch {
98
- h = !0;
98
+ m = !0;
99
99
  }
100
- if (h) {
101
- h = console;
102
- var R = h.error, x = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
103
- return R.call(
104
- h,
100
+ if (m) {
101
+ m = console;
102
+ var T = m.error, R = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
103
+ return T.call(
104
+ m,
105
105
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
106
- x
106
+ R
107
107
  ), t(n);
108
108
  }
109
109
  }
110
110
  function i(n) {
111
- if (n === M) return "<>";
112
- if (typeof n == "object" && n !== null && n.$$typeof === O)
111
+ if (n === P) return "<>";
112
+ if (typeof n == "object" && n !== null && n.$$typeof === E)
113
113
  return "<...>";
114
114
  try {
115
- var h = e(n);
116
- return h ? "<" + h + ">" : "<...>";
115
+ var m = e(n);
116
+ return m ? "<" + m + ">" : "<...>";
117
117
  } catch {
118
118
  return "<...>";
119
119
  }
120
120
  }
121
- function s() {
121
+ function c() {
122
122
  var n = D.A;
123
123
  return n === null ? null : n.getOwner();
124
124
  }
125
125
  function o() {
126
126
  return Error("react-stack-top-frame");
127
127
  }
128
- function f(n) {
129
- if (q.call(n, "key")) {
130
- var h = Object.getOwnPropertyDescriptor(n, "key").get;
131
- if (h && h.isReactWarning) return !1;
128
+ function u(n) {
129
+ if (V.call(n, "key")) {
130
+ var m = Object.getOwnPropertyDescriptor(n, "key").get;
131
+ if (m && m.isReactWarning) return !1;
132
132
  }
133
133
  return n.key !== void 0;
134
134
  }
135
- function c(n, h) {
136
- function R() {
137
- F || (F = !0, console.error(
135
+ function f(n, m) {
136
+ function T() {
137
+ N || (N = !0, console.error(
138
138
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
139
- h
139
+ m
140
140
  ));
141
141
  }
142
- R.isReactWarning = !0, Object.defineProperty(n, "key", {
143
- get: R,
142
+ T.isReactWarning = !0, Object.defineProperty(n, "key", {
143
+ get: T,
144
144
  configurable: !0
145
145
  });
146
146
  }
147
- function d() {
147
+ function l() {
148
148
  var n = e(this.type);
149
- return U[n] || (U[n] = !0, console.error(
149
+ return Z[n] || (Z[n] = !0, console.error(
150
150
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
151
151
  )), n = this.props.ref, n !== void 0 ? n : null;
152
152
  }
153
- function u(n, h, R, x, Z, N) {
154
- var X = R.ref;
153
+ function s(n, m, T, R, z, F) {
154
+ var X = T.ref;
155
155
  return n = {
156
- $$typeof: I,
156
+ $$typeof: C,
157
157
  type: n,
158
- key: h,
159
- props: R,
160
- _owner: x
158
+ key: m,
159
+ props: T,
160
+ _owner: R
161
161
  }, (X !== void 0 ? X : null) !== null ? Object.defineProperty(n, "ref", {
162
162
  enumerable: !1,
163
- get: d
163
+ get: l
164
164
  }) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
165
165
  configurable: !1,
166
166
  enumerable: !1,
@@ -175,69 +175,69 @@ function Et() {
175
175
  configurable: !1,
176
176
  enumerable: !1,
177
177
  writable: !0,
178
- value: Z
178
+ value: z
179
179
  }), Object.defineProperty(n, "_debugTask", {
180
180
  configurable: !1,
181
181
  enumerable: !1,
182
182
  writable: !0,
183
- value: N
183
+ value: F
184
184
  }), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
185
185
  }
186
- function T(n, h, R, x, Z, N) {
187
- var X = h.children;
186
+ function w(n, m, T, R, z, F) {
187
+ var X = m.children;
188
188
  if (X !== void 0)
189
- if (x)
190
- if (G(X)) {
191
- for (x = 0; x < X.length; x++)
192
- w(X[x]);
189
+ if (R)
190
+ if (U(X)) {
191
+ for (R = 0; R < X.length; R++)
192
+ y(X[R]);
193
193
  Object.freeze && Object.freeze(X);
194
194
  } else
195
195
  console.error(
196
196
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
197
197
  );
198
- else w(X);
199
- if (q.call(h, "key")) {
198
+ else y(X);
199
+ if (V.call(m, "key")) {
200
200
  X = e(n);
201
- var J = Object.keys(h).filter(function(pe) {
202
- return pe !== "key";
201
+ var J = Object.keys(m).filter(function(Se) {
202
+ return Se !== "key";
203
203
  });
204
- x = 0 < J.length ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}", ae[X + x] || (J = 0 < J.length ? "{" + J.join(": ..., ") + ": ...}" : "{}", console.error(
204
+ R = 0 < J.length ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}", ae[X + R] || (J = 0 < J.length ? "{" + J.join(": ..., ") + ": ...}" : "{}", console.error(
205
205
  `A props object containing a "key" prop is being spread into JSX:
206
206
  let props = %s;
207
207
  <%s {...props} />
208
208
  React keys must be passed directly to JSX without using spread:
209
209
  let props = %s;
210
210
  <%s key={someKey} {...props} />`,
211
- x,
211
+ R,
212
212
  X,
213
213
  J,
214
214
  X
215
- ), ae[X + x] = !0);
215
+ ), ae[X + R] = !0);
216
216
  }
217
- if (X = null, R !== void 0 && (r(R), X = "" + R), f(h) && (r(h.key), X = "" + h.key), "key" in h) {
218
- R = {};
219
- for (var ge in h)
220
- ge !== "key" && (R[ge] = h[ge]);
221
- } else R = h;
222
- return X && c(
223
- R,
217
+ if (X = null, T !== void 0 && (r(T), X = "" + T), u(m) && (r(m.key), X = "" + m.key), "key" in m) {
218
+ T = {};
219
+ for (var ge in m)
220
+ ge !== "key" && (T[ge] = m[ge]);
221
+ } else T = m;
222
+ return X && f(
223
+ T,
224
224
  typeof n == "function" ? n.displayName || n.name || "Unknown" : n
225
- ), u(
225
+ ), s(
226
226
  n,
227
227
  X,
228
- R,
229
- s(),
230
- Z,
231
- N
228
+ T,
229
+ c(),
230
+ z,
231
+ F
232
232
  );
233
233
  }
234
- function w(n) {
235
- b(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === O && (n._payload.status === "fulfilled" ? b(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
234
+ function y(n) {
235
+ h(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === E && (n._payload.status === "fulfilled" ? h(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
236
236
  }
237
- function b(n) {
238
- return typeof n == "object" && n !== null && n.$$typeof === I;
237
+ function h(n) {
238
+ return typeof n == "object" && n !== null && n.$$typeof === C;
239
239
  }
240
- var S = xt, I = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), M = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), Y = Symbol.for("react.consumer"), j = Symbol.for("react.context"), $ = Symbol.for("react.forward_ref"), k = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), V = Symbol.for("react.client.reference"), D = S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, q = Object.prototype.hasOwnProperty, G = Array.isArray, H = console.createTask ? console.createTask : function() {
240
+ var S = Rt, C = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), P = Symbol.for("react.fragment"), L = Symbol.for("react.strict_mode"), I = Symbol.for("react.profiler"), $ = Symbol.for("react.consumer"), j = Symbol.for("react.context"), B = Symbol.for("react.forward_ref"), k = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), M = Symbol.for("react.activity"), q = Symbol.for("react.client.reference"), D = S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, U = Array.isArray, H = console.createTask ? console.createTask : function() {
241
241
  return null;
242
242
  };
243
243
  S = {
@@ -245,164 +245,164 @@ React keys must be passed directly to JSX without using spread:
245
245
  return n();
246
246
  }
247
247
  };
248
- var F, U = {}, oe = S.react_stack_bottom_frame.bind(
248
+ var N, Z = {}, oe = S.react_stack_bottom_frame.bind(
249
249
  S,
250
250
  o
251
251
  )(), ne = H(i(o)), ae = {};
252
- ve.Fragment = M, ve.jsx = function(n, h, R) {
253
- var x = 1e4 > D.recentlyCreatedOwnerStacks++;
254
- return T(
252
+ be.Fragment = P, be.jsx = function(n, m, T) {
253
+ var R = 1e4 > D.recentlyCreatedOwnerStacks++;
254
+ return w(
255
255
  n,
256
- h,
257
- R,
256
+ m,
257
+ T,
258
258
  !1,
259
- x ? Error("react-stack-top-frame") : oe,
260
- x ? H(i(n)) : ne
259
+ R ? Error("react-stack-top-frame") : oe,
260
+ R ? H(i(n)) : ne
261
261
  );
262
- }, ve.jsxs = function(n, h, R) {
263
- var x = 1e4 > D.recentlyCreatedOwnerStacks++;
264
- return T(
262
+ }, be.jsxs = function(n, m, T) {
263
+ var R = 1e4 > D.recentlyCreatedOwnerStacks++;
264
+ return w(
265
265
  n,
266
- h,
267
- R,
266
+ m,
267
+ T,
268
268
  !0,
269
- x ? Error("react-stack-top-frame") : oe,
270
- x ? H(i(n)) : ne
269
+ R ? Error("react-stack-top-frame") : oe,
270
+ R ? H(i(n)) : ne
271
271
  );
272
272
  };
273
- }()), ve;
273
+ }()), be;
274
274
  }
275
- process.env.NODE_ENV === "production" ? Re.exports = Ot() : Re.exports = Et();
276
- var E = Re.exports;
277
- const Ke = Rt(null), ye = (e) => {
275
+ process.env.NODE_ENV === "production" ? Re.exports = Ot() : Re.exports = At();
276
+ var O = Re.exports;
277
+ const et = Tt(null), ye = (e) => {
278
278
  throw new Error(`Unhandled sidebar side: ${e}`);
279
279
  }, we = {
280
280
  isOpen: !1,
281
281
  anchorState: "closed",
282
282
  meta: null
283
- }, hr = ({
283
+ }, vr = ({
284
284
  children: e,
285
285
  sidebarWidthPx: t,
286
286
  transitionMs: r,
287
287
  edgeActivationWidthPx: i,
288
- dragActivationDeltaPx: s,
288
+ dragActivationDeltaPx: c,
289
289
  showOverlay: o,
290
- isAbsolute: f,
291
- overlayBackgroundColor: c,
292
- toggleIconColor: d,
293
- toggleIconSizePx: u,
294
- toggleIconEdgeDistancePx: T,
295
- showToggle: w,
296
- mediaQueryWidth: b,
290
+ isAbsolute: u,
291
+ overlayBackgroundColor: f,
292
+ toggleIconColor: l,
293
+ toggleIconSizePx: s,
294
+ toggleIconEdgeDistancePx: w,
295
+ showToggle: y,
296
+ mediaQueryWidth: h,
297
297
  swipeBarZIndex: S,
298
- toggleZIndex: I,
298
+ toggleZIndex: C,
299
299
  overlayZIndex: p,
300
- fadeContent: M,
301
- fadeContentTransitionMs: _,
302
- closeSidebarOnOverlayClick: C,
303
- resetMetaOnClose: Y
300
+ fadeContent: P,
301
+ fadeContentTransitionMs: L,
302
+ closeSidebarOnOverlayClick: I,
303
+ resetMetaOnClose: $
304
304
  }) => {
305
- var De, Xe;
306
- const [j, $] = Q(null), [k, v] = Q(!1), [y, O] = Q(!1), [P, V] = Q({}), [D, q] = Q({}), G = L(null), H = L(null), F = L(null), U = L(null), [oe, ne] = Q(null), [ae, n] = Q(null), [h, R] = Q({}), [x, Z] = Q({}), N = L(/* @__PURE__ */ new Map()), X = L(null), J = L([]), ge = ((De = h.primary) == null ? void 0 : De.isOpen) ?? !1, pe = ((Xe = h.primary) == null ? void 0 : Xe.anchorState) ?? "closed", _e = Je(
307
- () => Object.values(h).some((l) => l.isOpen),
308
- [h]
309
- ), ce = N.current.get("primary"), it = (ce == null ? void 0 : ce.sidebarRef) ?? { current: null }, ot = (ce == null ? void 0 : ce.toggleRef) ?? { current: null }, at = x.primary ?? {}, [st, ct] = Q({
305
+ var Xe, Ye;
306
+ const [j, B] = Q(null), [k, v] = Q(!1), [x, E] = Q(!1), [M, q] = Q({}), [D, V] = Q({}), U = _(null), H = _(null), N = _(null), Z = _(null), [oe, ne] = Q(null), [ae, n] = Q(null), [m, T] = Q({}), [R, z] = Q({}), F = _(/* @__PURE__ */ new Map()), X = _(null), J = _([]), ge = ((Xe = m.primary) == null ? void 0 : Xe.isOpen) ?? !1, Se = ((Ye = m.primary) == null ? void 0 : Ye.anchorState) ?? "closed", Le = Ke(
307
+ () => Object.values(m).some((d) => d.isOpen),
308
+ [m]
309
+ ), ce = F.current.get("primary"), ot = (ce == null ? void 0 : ce.sidebarRef) ?? { current: null }, at = (ce == null ? void 0 : ce.toggleRef) ?? { current: null }, st = R.primary ?? {}, [ct, lt] = Q({
310
310
  sidebarWidthPx: t ?? It,
311
- sidebarHeightPx: Be,
312
- transitionMs: r ?? At,
313
- edgeActivationWidthPx: i ?? Pt,
314
- dragActivationDeltaPx: s ?? Mt,
315
- showOverlay: o ?? Ct,
316
- isAbsolute: f ?? Lt,
317
- overlayBackgroundColor: c ?? et,
318
- toggleIconColor: d ?? Dt,
319
- toggleIconSizePx: u ?? Xt,
320
- toggleIconEdgeDistancePx: T ?? Yt,
321
- showToggle: w ?? $t,
322
- mediaQueryWidth: b ?? Te,
311
+ sidebarHeightPx: je,
312
+ transitionMs: r ?? Pt,
313
+ edgeActivationWidthPx: i ?? Mt,
314
+ dragActivationDeltaPx: c ?? Ct,
315
+ showOverlay: o ?? _t,
316
+ isAbsolute: u ?? Dt,
317
+ overlayBackgroundColor: f ?? tt,
318
+ toggleIconColor: l ?? Xt,
319
+ toggleIconSizePx: s ?? Yt,
320
+ toggleIconEdgeDistancePx: w ?? $t,
321
+ showToggle: y ?? Bt,
322
+ mediaQueryWidth: h ?? Te,
323
323
  swipeBarZIndex: S ?? Wt,
324
- toggleZIndex: I ?? Bt,
325
- overlayZIndex: p ?? jt,
326
- fadeContent: M ?? Ft,
327
- fadeContentTransitionMs: _ ?? Nt,
328
- swipeToOpen: Ht,
329
- swipeToClose: Gt,
330
- midAnchorPoint: Ut,
331
- midAnchorPointPx: Be / 3,
324
+ toggleZIndex: C ?? jt,
325
+ overlayZIndex: p ?? kt,
326
+ fadeContent: P ?? Ht,
327
+ fadeContentTransitionMs: L ?? Nt,
328
+ swipeToOpen: Gt,
329
+ swipeToClose: Ut,
330
+ midAnchorPoint: Zt,
331
+ midAnchorPointPx: je / 3,
332
332
  disabled: !1,
333
- closeSidebarOnOverlayClick: C ?? _t,
334
- resetMetaOnClose: Y ?? !1
335
- }), lt = B((l, a) => {
336
- N.current.set(l, a), R((g) => g[l] ? g : { ...g, [l]: { ...we } });
337
- }, []), ut = B((l) => {
338
- N.current.delete(l), R((a) => {
333
+ closeSidebarOnOverlayClick: I ?? Lt,
334
+ resetMetaOnClose: $ ?? !1
335
+ }), ut = Y((d, a) => {
336
+ F.current.set(d, a), T((g) => g[d] ? g : { ...g, [d]: { ...we } });
337
+ }, []), dt = Y((d) => {
338
+ F.current.delete(d), T((a) => {
339
339
  const g = { ...a };
340
- return delete g[l], g;
341
- }), Z((a) => {
340
+ return delete g[d], g;
341
+ }), z((a) => {
342
342
  const g = { ...a };
343
- return delete g[l], g;
343
+ return delete g[d], g;
344
344
  });
345
- }, []), dt = B((l) => N.current.get(l), []), ft = B(
346
- (l, a) => {
347
- Z((g) => g[l] === a ? g : { ...g, [l]: a });
345
+ }, []), ft = Y((d) => F.current.get(d), []), gt = Y(
346
+ (d, a) => {
347
+ z((g) => g[d] === a ? g : { ...g, [d]: a });
348
348
  },
349
349
  []
350
- ), te = B((l, a) => {
351
- R((g) => {
352
- const m = g[l] ?? we;
353
- return m.isOpen === a ? g : { ...g, [l]: { ...m, isOpen: a } };
350
+ ), te = Y((d, a) => {
351
+ T((g) => {
352
+ const b = g[d] ?? we;
353
+ return b.isOpen === a ? g : { ...g, [d]: { ...b, isOpen: a } };
354
354
  });
355
- }, []), re = B(
356
- (l, a) => {
357
- R((g) => {
358
- const m = g[l] ?? we;
359
- return m.anchorState === a ? g : { ...g, [l]: { ...m, anchorState: a } };
355
+ }, []), re = Y(
356
+ (d, a) => {
357
+ T((g) => {
358
+ const b = g[d] ?? we;
359
+ return b.anchorState === a ? g : { ...g, [d]: { ...b, anchorState: a } };
360
360
  });
361
361
  },
362
362
  []
363
- ), he = B((l, a) => {
364
- R((g) => {
365
- const m = g[l] ?? we;
366
- return m.meta === a ? g : { ...g, [l]: { ...m, meta: a } };
363
+ ), he = Y((d, a) => {
364
+ T((g) => {
365
+ const b = g[d] ?? we;
366
+ return b.meta === a ? g : { ...g, [d]: { ...b, meta: a } };
367
367
  });
368
368
  }, []);
369
- z(() => (k || y || _e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
369
+ G(() => (k || x || Le ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
370
370
  document.body.style.overflow = "";
371
- }), [k, y, _e]), z(() => {
372
- var l;
373
- if (P.fadeContent === !1) {
374
- const a = (l = G.current) == null ? void 0 : l.firstElementChild;
371
+ }), [k, x, Le]), G(() => {
372
+ var d;
373
+ if (M.fadeContent === !1) {
374
+ const a = (d = U.current) == null ? void 0 : d.firstElementChild;
375
375
  a && (a.style.opacity = "1");
376
376
  }
377
- }, [P.fadeContent]), z(() => {
378
- var l;
377
+ }, [M.fadeContent]), G(() => {
378
+ var d;
379
379
  if (D.fadeContent === !1) {
380
- const a = (l = H.current) == null ? void 0 : l.firstElementChild;
380
+ const a = (d = H.current) == null ? void 0 : d.firstElementChild;
381
381
  a && (a.style.opacity = "1");
382
382
  }
383
- }, [D.fadeContent]), z(() => {
384
- var l;
385
- for (const [a, g] of Object.entries(x))
383
+ }, [D.fadeContent]), G(() => {
384
+ var d;
385
+ for (const [a, g] of Object.entries(R))
386
386
  if (g.fadeContent === !1) {
387
- const m = N.current.get(a), A = (l = m == null ? void 0 : m.sidebarRef.current) == null ? void 0 : l.firstElementChild;
387
+ const b = F.current.get(a), A = (d = b == null ? void 0 : b.sidebarRef.current) == null ? void 0 : d.firstElementChild;
388
388
  A && (A.style.opacity = "1");
389
389
  }
390
- }, [x]);
391
- const gt = B((l) => {
392
- ct((a) => ({ ...a, ...l }));
393
- }, []), le = B((l, a) => {
394
- const g = l === "left" ? ne : n;
390
+ }, [R]);
391
+ const ht = Y((d) => {
392
+ lt((a) => ({ ...a, ...d }));
393
+ }, []), le = Y((d, a) => {
394
+ const g = d === "left" ? ne : n;
395
395
  a != null && a.resetMeta ? g(null) : (a == null ? void 0 : a.meta) !== void 0 && g(a.meta);
396
- }, []), ie = B(
397
- (l, a) => {
398
- a != null && a.resetMeta ? he(l, null) : (a == null ? void 0 : a.meta) !== void 0 && he(l, a.meta);
396
+ }, []), ie = Y(
397
+ (d, a) => {
398
+ a != null && a.resetMeta ? he(d, null) : (a == null ? void 0 : a.meta) !== void 0 && he(d, a.meta);
399
399
  },
400
400
  [he]
401
- ), ht = B(
402
- (l, a) => {
403
- if (l === "left")
401
+ ), mt = Y(
402
+ (d, a) => {
403
+ if (d === "left")
404
404
  ne(a);
405
- else if (l === "right")
405
+ else if (d === "right")
406
406
  n(a);
407
407
  else {
408
408
  const g = a;
@@ -410,72 +410,72 @@ const Ke = Rt(null), ye = (e) => {
410
410
  }
411
411
  },
412
412
  [he]
413
- ), se = B((l) => {
414
- const a = J.current, g = a.indexOf(l);
415
- g !== -1 && a.splice(g, 1), a.push(l), $("bottom");
416
- }, []), Le = B((l) => {
417
- const a = J.current, g = a.indexOf(l);
418
- g !== -1 && a.splice(g, 1), R((m) => (Object.entries(m).some(([W, K]) => W !== l && K.isOpen) || $(null), m));
419
- }, []), mt = B(
420
- (l, a) => {
421
- const g = (m, A, W, K) => {
413
+ ), se = Y((d) => {
414
+ const a = J.current, g = a.indexOf(d);
415
+ g !== -1 && a.splice(g, 1), a.push(d), B("bottom");
416
+ }, []), De = Y((d) => {
417
+ const a = J.current, g = a.indexOf(d);
418
+ g !== -1 && a.splice(g, 1), T((b) => (Object.entries(b).some(([W, K]) => W !== d && K.isOpen) || B(null), b));
419
+ }, []), bt = Y(
420
+ (d, a) => {
421
+ const g = (b, A, W, K) => {
422
422
  xe({
423
- side: l,
424
- ref: m,
423
+ side: d,
424
+ ref: b,
425
425
  options: A,
426
426
  toggleRef: W,
427
427
  afterApply: () => {
428
- K(!0), $(l);
428
+ K(!0), B(d);
429
429
  }
430
430
  });
431
431
  };
432
- if (l === "left") {
433
- if (P.disabled) return;
434
- le("left", a), g(G, P, F, v);
435
- } else if (l === "right") {
432
+ if (d === "left") {
433
+ if (M.disabled) return;
434
+ le("left", a), g(U, M, N, v);
435
+ } else if (d === "right") {
436
436
  if (D.disabled) return;
437
- le("right", a), g(H, D, U, O);
438
- } else if (l === "bottom") {
439
- const m = (a == null ? void 0 : a.id) ?? "primary", A = x[m], W = N.current.get(m);
437
+ le("right", a), g(H, D, Z, E);
438
+ } else if (d === "bottom") {
439
+ const b = (a == null ? void 0 : a.id) ?? "primary", A = R[b], W = F.current.get(b);
440
440
  if (!A || !W || A.disabled) return;
441
- ie(m, a);
442
- const K = A.sidebarHeightPx ?? 0, pt = A.mediaQueryWidth ?? 640, Ye = window.innerWidth < pt, yt = Ye ? A.midAnchorPointPx ?? 0 : K;
443
- Ye && A.midAnchorPoint && !A.swipeToOpen && yt < K ? Ne({
441
+ ie(b, a);
442
+ const K = A.sidebarHeightPx ?? 0, yt = A.mediaQueryWidth ?? 640, $e = window.innerWidth < yt, xt = $e ? A.midAnchorPointPx ?? 0 : K;
443
+ $e && A.midAnchorPoint && !A.swipeToOpen && xt < K ? Ne({
444
444
  ref: W.sidebarRef,
445
445
  options: A,
446
446
  toggleRef: W.toggleRef,
447
447
  afterApply: () => {
448
- te(m, !0), re(m, "midAnchor"), se(m);
448
+ te(b, !0), re(b, "midAnchor"), se(b);
449
449
  }
450
450
  }) : xe({
451
- side: l,
451
+ side: d,
452
452
  ref: W.sidebarRef,
453
453
  options: A,
454
454
  toggleRef: W.toggleRef,
455
455
  afterApply: () => {
456
- te(m, !0), re(m, "open"), se(m);
456
+ te(b, !0), re(b, "open"), se(b);
457
457
  }
458
458
  });
459
459
  } else
460
- ye(l);
460
+ ye(d);
461
461
  },
462
462
  [
463
- P,
463
+ M,
464
464
  D,
465
- x,
465
+ R,
466
466
  te,
467
467
  re,
468
468
  se,
469
469
  le,
470
470
  ie
471
471
  ]
472
- ), vt = B(
473
- (l, a) => {
474
- if (l !== "bottom") return;
475
- const g = (a == null ? void 0 : a.id) ?? "primary", m = x[g], A = N.current.get(g);
476
- !m || !A || m.disabled || (ie(g, a), Ne({
472
+ ), vt = Y(
473
+ (d, a) => {
474
+ if (d !== "bottom") return;
475
+ const g = (a == null ? void 0 : a.id) ?? "primary", b = R[g], A = F.current.get(g);
476
+ !b || !A || b.disabled || (ie(g, a), Ne({
477
477
  ref: A.sidebarRef,
478
- options: m,
478
+ options: b,
479
479
  toggleRef: A.toggleRef,
480
480
  afterApply: () => {
481
481
  te(g, !0), re(g, "midAnchor"), se(g);
@@ -483,20 +483,20 @@ const Ke = Rt(null), ye = (e) => {
483
483
  }));
484
484
  },
485
485
  [
486
- x,
486
+ R,
487
487
  te,
488
488
  re,
489
489
  se,
490
490
  ie
491
491
  ]
492
- ), bt = B(
493
- (l, a) => {
494
- if (l !== "bottom") return;
495
- const g = (a == null ? void 0 : a.id) ?? "primary", m = x[g], A = N.current.get(g);
496
- !m || !A || m.disabled || (ie(g, a), xe({
497
- side: l,
492
+ ), wt = Y(
493
+ (d, a) => {
494
+ if (d !== "bottom") return;
495
+ const g = (a == null ? void 0 : a.id) ?? "primary", b = R[g], A = F.current.get(g);
496
+ !b || !A || b.disabled || (ie(g, a), xe({
497
+ side: d,
498
498
  ref: A.sidebarRef,
499
- options: m,
499
+ options: b,
500
500
  toggleRef: A.toggleRef,
501
501
  afterApply: () => {
502
502
  te(g, !0), re(g, "open"), se(g);
@@ -504,198 +504,198 @@ const Ke = Rt(null), ye = (e) => {
504
504
  }));
505
505
  },
506
506
  [
507
- x,
507
+ R,
508
508
  te,
509
509
  re,
510
510
  se,
511
511
  ie
512
512
  ]
513
- ), wt = B(
514
- (l, a) => {
515
- const g = (m, A, W, K) => {
516
- ke({
517
- ref: m,
513
+ ), pt = Y(
514
+ (d, a) => {
515
+ const g = (b, A, W, K) => {
516
+ Fe({
517
+ ref: b,
518
518
  options: A,
519
519
  toggleRef: W,
520
- side: l,
520
+ side: d,
521
521
  afterApply: () => {
522
- K(!1), $(null);
522
+ K(!1), B(null);
523
523
  }
524
524
  });
525
525
  };
526
- if (l === "left") {
527
- if (P.disabled) return;
528
- const m = P.resetMetaOnClose && (a == null ? void 0 : a.meta) === void 0 && (a == null ? void 0 : a.resetMeta) === void 0 ? { ...a, resetMeta: !0 } : a;
529
- le("left", m), g(G, P, F, v);
530
- } else if (l === "right") {
526
+ if (d === "left") {
527
+ if (M.disabled) return;
528
+ const b = M.resetMetaOnClose && (a == null ? void 0 : a.meta) === void 0 && (a == null ? void 0 : a.resetMeta) === void 0 ? { ...a, resetMeta: !0 } : a;
529
+ le("left", b), g(U, M, N, v);
530
+ } else if (d === "right") {
531
531
  if (D.disabled) return;
532
- const m = D.resetMetaOnClose && (a == null ? void 0 : a.meta) === void 0 && (a == null ? void 0 : a.resetMeta) === void 0 ? { ...a, resetMeta: !0 } : a;
533
- le("right", m), g(H, D, U, O);
534
- } else if (l === "bottom") {
535
- const m = (a == null ? void 0 : a.id) ?? "primary", A = x[m], W = N.current.get(m);
532
+ const b = D.resetMetaOnClose && (a == null ? void 0 : a.meta) === void 0 && (a == null ? void 0 : a.resetMeta) === void 0 ? { ...a, resetMeta: !0 } : a;
533
+ le("right", b), g(H, D, Z, E);
534
+ } else if (d === "bottom") {
535
+ const b = (a == null ? void 0 : a.id) ?? "primary", A = R[b], W = F.current.get(b);
536
536
  if (!A || !W || A.disabled) return;
537
537
  const K = A.resetMetaOnClose && (a == null ? void 0 : a.meta) === void 0 && (a == null ? void 0 : a.resetMeta) === void 0 ? { ...a, resetMeta: !0 } : a;
538
- ie(m, K), ke({
538
+ ie(b, K), Fe({
539
539
  ref: W.sidebarRef,
540
540
  options: A,
541
541
  toggleRef: W.toggleRef,
542
- side: l,
542
+ side: d,
543
543
  afterApply: () => {
544
- te(m, !1), re(m, "closed"), Le(m);
544
+ te(b, !1), re(b, "closed"), De(b);
545
545
  }
546
546
  });
547
547
  } else
548
- ye(l);
548
+ ye(d);
549
549
  },
550
550
  [
551
- P,
551
+ M,
552
552
  D,
553
- x,
553
+ R,
554
554
  te,
555
555
  re,
556
- Le,
556
+ De,
557
557
  le,
558
558
  ie
559
559
  ]
560
- ), St = B(
561
- (l, a, g) => {
562
- if (l === "left")
563
- Fe({
564
- ref: G,
565
- toggleRef: F,
566
- options: P,
560
+ ), St = Y(
561
+ (d, a, g) => {
562
+ if (d === "left")
563
+ He({
564
+ ref: U,
565
+ toggleRef: N,
566
+ options: M,
567
567
  translateX: a
568
568
  });
569
- else if (l === "right")
570
- Fe({
569
+ else if (d === "right")
570
+ He({
571
571
  ref: H,
572
- toggleRef: U,
572
+ toggleRef: Z,
573
573
  options: D,
574
574
  translateX: a
575
575
  });
576
- else if (l === "bottom") {
577
- const m = (g == null ? void 0 : g.id) ?? "primary", A = x[m], W = N.current.get(m);
576
+ else if (d === "bottom") {
577
+ const b = (g == null ? void 0 : g.id) ?? "primary", A = R[b], W = F.current.get(b);
578
578
  if (!A || !W) return;
579
- ir({
579
+ or({
580
580
  ref: W.sidebarRef,
581
581
  toggleRef: W.toggleRef,
582
582
  options: A,
583
583
  translateY: a
584
584
  });
585
585
  } else
586
- ye(l);
586
+ ye(d);
587
587
  },
588
- [P, D, x]
588
+ [M, D, R]
589
589
  );
590
- return /* @__PURE__ */ E.jsx(
591
- Ke.Provider,
590
+ return /* @__PURE__ */ O.jsx(
591
+ et.Provider,
592
592
  {
593
593
  value: {
594
594
  lockedSidebar: j,
595
- setLockedSidebar: $,
596
- leftSidebarRef: G,
595
+ setLockedSidebar: B,
596
+ leftSidebarRef: U,
597
597
  rightSidebarRef: H,
598
598
  isLeftOpen: k,
599
- isRightOpen: y,
599
+ isRightOpen: x,
600
600
  // Backwards-compat aliases for primary bottom sidebar
601
601
  isBottomOpen: ge,
602
- bottomAnchorState: pe,
603
- bottomSidebarRef: it,
604
- bottomToggleRef: ot,
605
- bottomSidebarOptions: at,
602
+ bottomAnchorState: Se,
603
+ bottomSidebarRef: ot,
604
+ bottomToggleRef: at,
605
+ bottomSidebarOptions: st,
606
606
  // Multi-instance bottom sidebar
607
- bottomSidebars: h,
608
- bottomSidebarOptionsMap: x,
609
- registerBottomSidebar: lt,
610
- unregisterBottomSidebar: ut,
611
- getBottomSidebarRefs: dt,
607
+ bottomSidebars: m,
608
+ bottomSidebarOptionsMap: R,
609
+ registerBottomSidebar: ut,
610
+ unregisterBottomSidebar: dt,
611
+ getBottomSidebarRefs: ft,
612
612
  activeBottomDragIdRef: X,
613
613
  bottomFocusStackRef: J,
614
614
  // Functions
615
- openSidebar: mt,
616
- openSidebarFully: bt,
615
+ openSidebar: bt,
616
+ openSidebarFully: wt,
617
617
  openSidebarToMidAnchor: vt,
618
- closeSidebar: wt,
618
+ closeSidebar: pt,
619
619
  dragSidebar: St,
620
- globalOptions: st,
621
- setGlobalOptions: gt,
622
- leftSidebarOptions: P,
620
+ globalOptions: ct,
621
+ setGlobalOptions: ht,
622
+ leftSidebarOptions: M,
623
623
  rightSidebarOptions: D,
624
- setLeftSidebarOptions: V,
625
- setRightSidebarOptions: q,
626
- setBottomSidebarOptionsById: ft,
627
- leftToggleRef: F,
628
- rightToggleRef: U,
624
+ setLeftSidebarOptions: q,
625
+ setRightSidebarOptions: V,
626
+ setBottomSidebarOptionsById: gt,
627
+ leftToggleRef: N,
628
+ rightToggleRef: Z,
629
629
  leftMeta: oe,
630
630
  rightMeta: ae,
631
- setMeta: ht
631
+ setMeta: mt
632
632
  },
633
633
  children: e
634
634
  }
635
635
  );
636
636
  };
637
637
  function ee() {
638
- const e = Tt(Ke);
638
+ const e = Et(et);
639
639
  if (!e)
640
640
  throw new Error("useSwipeBarContext must be used within SwipeBarProvider");
641
641
  return e;
642
642
  }
643
- const At = 300, Pt = 40, Mt = 20, It = 320, Be = window.innerHeight, Ct = !0, _t = !0, Lt = !1, et = "rgba(0, 0, 0, 0.5)", Oe = "rgb(36,36,36)", Dt = "white", Xt = 40, Yt = 40, $t = !0, Te = 640, Wt = 30, Bt = 15, jt = 20, je = 0.6, kt = 200, Nt = 100, Ft = !1, Ht = !0, Gt = !0, Ut = !1, ue = "cubic-bezier(0.22, 1, 0.36, 1)", tt = {
643
+ const Pt = 300, Mt = 40, Ct = 20, It = 320, je = window.innerHeight, _t = !0, Lt = !0, Dt = !1, tt = "rgba(0, 0, 0, 0.5)", Ee = "rgb(36,36,36)", Xt = "white", Yt = 40, $t = 40, Bt = !0, Te = 640, Wt = 30, jt = 15, kt = 20, ke = 0.6, Ft = 200, Nt = 100, Ht = !1, Gt = !0, Ut = !0, Zt = !1, ue = "cubic-bezier(0.22, 1, 0.36, 1)", rt = {
644
644
  width: 0,
645
645
  top: 0,
646
646
  bottom: 0,
647
647
  flexShrink: 0,
648
648
  overflowX: "hidden",
649
649
  willChange: "transform"
650
- }, Zt = {
651
- transform: "translateX(-100%)"
652
650
  }, zt = {
651
+ transform: "translateX(-100%)"
652
+ }, qt = {
653
653
  transform: "translateX(100%)"
654
654
  }, Vt = {
655
655
  position: "fixed",
656
656
  left: 0,
657
657
  top: 0,
658
658
  bottom: 0
659
- }, qt = {
659
+ }, Qt = {
660
660
  position: "fixed",
661
661
  right: 0,
662
662
  top: 0,
663
663
  bottom: 0
664
- }, Qt = {
664
+ }, Jt = {
665
665
  height: 0,
666
666
  left: 0,
667
667
  right: 0,
668
668
  flexShrink: 0,
669
669
  overflowY: "hidden",
670
670
  willChange: "transform"
671
- }, Jt = {
672
- transform: "translateY(100%)"
673
671
  }, Kt = {
672
+ transform: "translateY(100%)"
673
+ }, er = {
674
674
  position: "fixed",
675
675
  bottom: 0,
676
676
  left: 0,
677
677
  right: 0
678
- }, er = {
678
+ }, tr = {
679
679
  position: "fixed",
680
680
  top: 0,
681
681
  left: 0,
682
682
  width: "100%",
683
683
  height: "100%",
684
- backgroundColor: et,
684
+ backgroundColor: tt,
685
685
  transitionProperty: "opacity",
686
686
  pointerEvents: "none",
687
687
  opacity: 0
688
- }, tr = {
688
+ }, rr = {
689
689
  opacity: 1,
690
690
  pointerEvents: "auto"
691
- }, rt = {
691
+ }, nt = {
692
692
  position: "fixed",
693
693
  top: "50%",
694
694
  transform: "translateY(-50%)",
695
695
  width: "1px",
696
696
  display: "flex",
697
697
  justifyContent: "center"
698
- }, rr = {
698
+ }, nr = {
699
699
  position: "fixed",
700
700
  bottom: 0,
701
701
  left: "50%",
@@ -703,16 +703,16 @@ const At = 300, Pt = 40, Mt = 20, It = 320, Be = window.innerHeight, Ct = !0, _t
703
703
  height: "1px",
704
704
  display: "flex",
705
705
  alignItems: "center"
706
- }, nr = {
706
+ }, ir = {
707
707
  position: "relative",
708
708
  cursor: "pointer",
709
709
  display: "flex",
710
710
  height: "72px",
711
711
  alignItems: "center",
712
712
  justifyContent: "center"
713
- }, Ee = (e) => {
713
+ }, Oe = (e) => {
714
714
  throw new Error(`Unhandled sidebar side: ${e}`);
715
- }, be = (e) => {
715
+ }, ve = (e) => {
716
716
  var t;
717
717
  return (t = e.current) == null ? void 0 : t.firstElementChild;
718
718
  }, xe = ({
@@ -720,43 +720,43 @@ const At = 300, Pt = 40, Mt = 20, It = 320, Be = window.innerHeight, Ct = !0, _t
720
720
  side: t,
721
721
  options: r,
722
722
  toggleRef: i,
723
- afterApply: s
723
+ afterApply: c
724
724
  }) => {
725
- const o = be(e), f = r.transitionMs ? r.transitionMs / 2 : 0;
725
+ const o = ve(e), u = r.transitionMs ? r.transitionMs / 2 : 0;
726
726
  o && r.fadeContent && (o.style.opacity = "0");
727
- let c, d;
728
- t === "left" || t === "right" ? (c = "width", d = r.sidebarWidthPx, o && d && (o.style.minWidth = `${d}px`)) : t === "bottom" ? (c = "height", d = r.sidebarHeightPx, o && d && (o.style.minHeight = `${d}px`)) : Ee(t), requestAnimationFrame(() => {
727
+ let f, l;
728
+ t === "left" || t === "right" ? (f = "width", l = r.sidebarWidthPx, o && l && (o.style.minWidth = `${l}px`)) : t === "bottom" ? (f = "height", l = r.sidebarHeightPx, o && l && (o.style.minHeight = `${l}px`)) : Oe(t), requestAnimationFrame(() => {
729
729
  if (!e.current) return;
730
- const u = `transform ${r.transitionMs}ms ${ue}`, T = r.isAbsolute ? "" : `, ${c} ${r.transitionMs}ms ${ue}`;
731
- e.current.style.transition = `${u}${T}`, o && r.fadeContent && (o.style.transition = `opacity ${r.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
730
+ const s = `transform ${r.transitionMs}ms ${ue}`, w = r.isAbsolute ? "" : `, ${f} ${r.transitionMs}ms ${ue}`;
731
+ e.current.style.transition = `${s}${w}`, o && r.fadeContent && (o.style.transition = `opacity ${r.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
732
732
  if (e.current) {
733
733
  if (e.current.style.transform = t === "bottom" ? "translateY(0px)" : "translateX(0px)", !r.isAbsolute)
734
- e.current.style[c] = `${d}px`;
735
- else if (e.current.style[c] !== `${d}px`) {
736
- const w = e.current.style.transition;
737
- e.current.style.transition = u, e.current.style[c] = `${d}px`, e.current.style.transition = w;
734
+ e.current.style[f] = `${l}px`;
735
+ else if (e.current.style[f] !== `${l}px`) {
736
+ const y = e.current.style.transition;
737
+ e.current.style.transition = s, e.current.style[f] = `${l}px`, e.current.style.transition = y;
738
738
  }
739
- i.current && d && (i.current.style.opacity = "1", t === "left" ? i.current.style.transform = `translateY(-50%) translateX(${d}px)` : t === "right" ? i.current.style.transform = `translateY(-50%) translateX(-${d}px)` : t === "bottom" && (i.current.style.transform = `translateX(-50%) translateY(-${d}px)`)), o && r.fadeContent && setTimeout(() => {
739
+ i.current && l && (i.current.style.opacity = "1", t === "left" ? i.current.style.transform = `translateY(-50%) translateX(${l}px)` : t === "right" ? i.current.style.transform = `translateY(-50%) translateX(-${l}px)` : t === "bottom" && (i.current.style.transform = `translateX(-50%) translateY(-${l}px)`)), o && r.fadeContent && setTimeout(() => {
740
740
  o.style.opacity = "1";
741
- }, f), s();
741
+ }, u), c();
742
742
  }
743
743
  });
744
744
  }), setTimeout(() => {
745
745
  }, 0);
746
- }, ke = ({
746
+ }, Fe = ({
747
747
  ref: e,
748
748
  options: t,
749
749
  side: r,
750
750
  toggleRef: i,
751
- afterApply: s
751
+ afterApply: c
752
752
  }) => {
753
- const o = be(e);
754
- let f;
755
- r === "left" || r === "right" ? (f = "width", o && t.sidebarWidthPx && (o.style.minWidth = `${t.sidebarWidthPx}px`)) : r === "bottom" ? (f = "height", o && t.sidebarHeightPx && (o.style.minHeight = `${t.sidebarHeightPx}px`)) : Ee(r), requestAnimationFrame(() => {
753
+ const o = ve(e);
754
+ let u;
755
+ r === "left" || r === "right" ? (u = "width", o && t.sidebarWidthPx && (o.style.minWidth = `${t.sidebarWidthPx}px`)) : r === "bottom" ? (u = "height", o && t.sidebarHeightPx && (o.style.minHeight = `${t.sidebarHeightPx}px`)) : Oe(r), requestAnimationFrame(() => {
756
756
  if (!e.current) return;
757
- const c = `transform ${t.transitionMs}ms ${ue}`, d = t.isAbsolute ? "" : `, ${f} ${t.transitionMs}ms ${ue}`;
758
- e.current.style.transition = `${c}${d}`, o && t.fadeContent && (o.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
759
- e.current && (r === "left" ? (e.current.style.transform = "translateX(-100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "right" ? (e.current.style.transform = "translateX(100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "bottom" && (e.current.style.transform = "translateY(100%)", t.isAbsolute || (e.current.style.height = "0px")), i.current && (i.current.style.opacity = "1", r === "left" || r === "right" ? i.current.style.transform = "translateY(-50%)" : r === "bottom" && (i.current.style.transform = "translateX(-50%)")), o && t.fadeContent && (o.style.opacity = "0"), s());
757
+ const f = `transform ${t.transitionMs}ms ${ue}`, l = t.isAbsolute ? "" : `, ${u} ${t.transitionMs}ms ${ue}`;
758
+ e.current.style.transition = `${f}${l}`, o && t.fadeContent && (o.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
759
+ e.current && (r === "left" ? (e.current.style.transform = "translateX(-100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "right" ? (e.current.style.transform = "translateX(100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "bottom" && (e.current.style.transform = "translateY(100%)", t.isAbsolute || (e.current.style.height = "0px")), i.current && (i.current.style.opacity = "1", r === "left" || r === "right" ? i.current.style.transform = "translateY(-50%)" : r === "bottom" && (i.current.style.transform = "translateX(-50%)")), o && t.fadeContent && (o.style.opacity = "0"), c());
760
760
  });
761
761
  });
762
762
  }, Ne = ({
@@ -765,85 +765,85 @@ const At = 300, Pt = 40, Mt = 20, It = 320, Be = window.innerHeight, Ct = !0, _t
765
765
  toggleRef: r,
766
766
  afterApply: i
767
767
  }) => {
768
- const s = be(e), o = t.transitionMs ? t.transitionMs / 2 : 0;
769
- s && t.fadeContent && (s.style.opacity = "0"), s && t.midAnchorPointPx && (s.style.minHeight = `${t.sidebarHeightPx}px`), requestAnimationFrame(() => {
768
+ const c = ve(e), o = t.transitionMs ? t.transitionMs / 2 : 0;
769
+ c && t.fadeContent && (c.style.opacity = "0"), c && t.midAnchorPointPx && (c.style.minHeight = `${t.sidebarHeightPx}px`), requestAnimationFrame(() => {
770
770
  if (!e.current) return;
771
- const f = `transform ${t.transitionMs}ms ${ue}`, c = t.isAbsolute ? "" : `, height ${t.transitionMs}ms ${ue}`;
772
- e.current.style.transition = `${f}${c}`, s && t.fadeContent && (s.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
771
+ const u = `transform ${t.transitionMs}ms ${ue}`, f = t.isAbsolute ? "" : `, height ${t.transitionMs}ms ${ue}`;
772
+ e.current.style.transition = `${u}${f}`, c && t.fadeContent && (c.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
773
773
  if (!e.current) return;
774
- const d = t.midAnchorPointPx ?? 0, u = t.sidebarHeightPx ?? 0, T = u - d;
775
- if (e.current.style.transform = `translateY(${T}px)`, !t.isAbsolute)
776
- e.current.style.height = `${u}px`;
777
- else if (e.current.style.height !== `${u}px`) {
778
- const w = e.current.style.transition;
779
- e.current.style.transition = f, e.current.style.height = `${u}px`, e.current.style.transition = w;
774
+ const l = t.midAnchorPointPx ?? 0, s = t.sidebarHeightPx ?? 0, w = s - l;
775
+ if (e.current.style.transform = `translateY(${w}px)`, !t.isAbsolute)
776
+ e.current.style.height = `${s}px`;
777
+ else if (e.current.style.height !== `${s}px`) {
778
+ const y = e.current.style.transition;
779
+ e.current.style.transition = u, e.current.style.height = `${s}px`, e.current.style.transition = y;
780
780
  }
781
- r.current && (r.current.style.opacity = "1", r.current.style.transform = `translateX(-50%) translateY(-${d}px)`), s && t.fadeContent && setTimeout(() => {
782
- s.style.opacity = "1";
781
+ r.current && (r.current.style.opacity = "1", r.current.style.transform = `translateX(-50%) translateY(-${l}px)`), c && t.fadeContent && setTimeout(() => {
782
+ c.style.opacity = "1";
783
783
  }, o), i();
784
784
  });
785
785
  }), setTimeout(() => {
786
786
  }, 0);
787
- }, Fe = ({
787
+ }, He = ({
788
788
  ref: e,
789
789
  toggleRef: t,
790
790
  options: r,
791
791
  translateX: i
792
792
  }) => {
793
793
  !e.current || i === null || (e.current.style.transition = "none", requestAnimationFrame(() => {
794
- const s = be(e);
794
+ const c = ve(e);
795
795
  if (e.current) {
796
- if (s && r.fadeContent && (s.style.opacity = "0"), s && r.sidebarWidthPx && (s.style.minWidth = `${r.sidebarWidthPx}px`), !r.isAbsolute) {
796
+ if (c && r.fadeContent && (c.style.opacity = "0"), c && r.sidebarWidthPx && (c.style.minWidth = `${r.sidebarWidthPx}px`), !r.isAbsolute) {
797
797
  const o = `${r.sidebarWidthPx}px`;
798
798
  e.current.style.width !== o && (e.current.style.width = o);
799
799
  }
800
800
  e.current.style.transform = `translateX(${i}px)`, t.current && (t.current.style.opacity = "0", t.current.style.transform = `translateY(-50%) translateX(${i}px)`);
801
801
  }
802
802
  }));
803
- }, ir = ({
803
+ }, or = ({
804
804
  ref: e,
805
805
  toggleRef: t,
806
806
  options: r,
807
807
  translateY: i
808
808
  }) => {
809
809
  !e.current || i === null || (e.current.style.transition = "none", requestAnimationFrame(() => {
810
- const s = be(e);
810
+ const c = ve(e);
811
811
  if (e.current) {
812
- if (s && r.fadeContent && (s.style.opacity = "0"), s && r.sidebarHeightPx && (s.style.minHeight = `${r.sidebarHeightPx}px`), !r.isAbsolute) {
812
+ if (c && r.fadeContent && (c.style.opacity = "0"), c && r.sidebarHeightPx && (c.style.minHeight = `${r.sidebarHeightPx}px`), !r.isAbsolute) {
813
813
  const o = `${r.sidebarHeightPx}px`;
814
814
  e.current.style.height !== o && (e.current.style.height = o);
815
815
  }
816
816
  e.current.style.transform = `translateY(${i}px)`, t.current && (t.current.style.opacity = "0", t.current.style.transform = `translateX(-50%) translateY(${i}px)`);
817
817
  }
818
818
  }));
819
- }, Se = ({ refs: e, clientX: t, clientY: r, touchId: i, isMouse: s }) => {
819
+ }, pe = ({ refs: e, clientX: t, clientY: r, touchId: i, isMouse: c }) => {
820
820
  e.draggingRef.current = {
821
821
  startX: t,
822
822
  startY: r,
823
823
  activeTouchId: i,
824
- isMouse: s,
824
+ isMouse: c,
825
825
  isActivated: !1
826
826
  }, e.currentXRef.current = t, e.prevXRef.current = t;
827
- }, He = ({
827
+ }, Ge = ({
828
828
  refs: e,
829
829
  clientX: t,
830
830
  clientY: r,
831
831
  touchId: i,
832
- isMouse: s
832
+ isMouse: c
833
833
  }) => {
834
834
  e.draggingRef.current = {
835
835
  startX: t,
836
836
  startY: r,
837
837
  activeTouchId: i,
838
- isMouse: s,
838
+ isMouse: c,
839
839
  isActivated: !1
840
840
  }, e.currentYRef.current = r, e.prevYRef.current = r;
841
- }, nt = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
841
+ }, it = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
842
842
  e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null, t(null), r();
843
- }, or = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
843
+ }, ar = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
844
844
  e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null, t(null);
845
845
  }, de = (e) => e instanceof Element ? !!e.closest("input, textarea, [contenteditable='true']") : !1;
846
- function Ge(e) {
846
+ function Ue(e) {
847
847
  let t = e instanceof HTMLElement ? e : null;
848
848
  for (; t; ) {
849
849
  const r = getComputedStyle(t);
@@ -868,148 +868,149 @@ const Ae = (e, t) => {
868
868
  }, Me = (e, t, r) => {
869
869
  const {
870
870
  globalOptions: i,
871
- setLeftSidebarOptions: s,
871
+ setLeftSidebarOptions: c,
872
872
  setRightSidebarOptions: o,
873
- setBottomSidebarOptionsById: f
873
+ setBottomSidebarOptionsById: u
874
874
  } = ee(), {
875
- sidebarWidthPx: c,
876
- sidebarHeightPx: d,
877
- transitionMs: u,
878
- edgeActivationWidthPx: T,
879
- dragActivationDeltaPx: w,
880
- showOverlay: b,
875
+ sidebarWidthPx: f,
876
+ sidebarHeightPx: l,
877
+ transitionMs: s,
878
+ edgeActivationWidthPx: w,
879
+ dragActivationDeltaPx: y,
880
+ showOverlay: h,
881
881
  isAbsolute: S,
882
- overlayBackgroundColor: I,
882
+ overlayBackgroundColor: C,
883
883
  toggleIconColor: p,
884
- toggleIconSizePx: M,
885
- toggleIconEdgeDistancePx: _,
886
- showToggle: C,
887
- mediaQueryWidth: Y,
884
+ toggleIconSizePx: P,
885
+ toggleIconEdgeDistancePx: L,
886
+ showToggle: I,
887
+ mediaQueryWidth: $,
888
888
  swipeBarZIndex: j,
889
- toggleZIndex: $,
889
+ toggleZIndex: B,
890
890
  overlayZIndex: k,
891
891
  fadeContent: v,
892
- fadeContentTransitionMs: y,
893
- swipeToOpen: O,
894
- swipeToClose: P,
895
- midAnchorPoint: V,
892
+ fadeContentTransitionMs: x,
893
+ swipeToOpen: E,
894
+ swipeToClose: M,
895
+ midAnchorPoint: q,
896
896
  midAnchorPointPx: D,
897
- disabled: q,
898
- closeSidebarOnOverlayClick: G,
897
+ disabled: V,
898
+ closeSidebarOnOverlayClick: U,
899
899
  resetMetaOnClose: H
900
- } = t, F = Je(() => {
901
- const U = d ?? i.sidebarHeightPx;
900
+ } = t, N = Ke(() => {
901
+ const Z = l ?? i.sidebarHeightPx;
902
902
  return {
903
- sidebarWidthPx: c ?? i.sidebarWidthPx,
904
- sidebarHeightPx: U,
905
- transitionMs: u ?? i.transitionMs,
906
- edgeActivationWidthPx: T ?? i.edgeActivationWidthPx,
907
- dragActivationDeltaPx: w ?? i.dragActivationDeltaPx,
908
- showOverlay: b ?? i.showOverlay,
903
+ sidebarWidthPx: f ?? i.sidebarWidthPx,
904
+ sidebarHeightPx: Z,
905
+ transitionMs: s ?? i.transitionMs,
906
+ edgeActivationWidthPx: w ?? i.edgeActivationWidthPx,
907
+ dragActivationDeltaPx: y ?? i.dragActivationDeltaPx,
908
+ showOverlay: h ?? i.showOverlay,
909
909
  isAbsolute: S ?? i.isAbsolute,
910
- overlayBackgroundColor: I ?? i.overlayBackgroundColor,
910
+ overlayBackgroundColor: C ?? i.overlayBackgroundColor,
911
911
  toggleIconColor: p ?? i.toggleIconColor,
912
- toggleIconSizePx: M ?? i.toggleIconSizePx,
913
- toggleIconEdgeDistancePx: _ ?? i.toggleIconEdgeDistancePx,
914
- showToggle: C ?? i.showToggle,
915
- mediaQueryWidth: Y ?? i.mediaQueryWidth,
912
+ toggleIconSizePx: P ?? i.toggleIconSizePx,
913
+ toggleIconEdgeDistancePx: L ?? i.toggleIconEdgeDistancePx,
914
+ showToggle: I ?? i.showToggle,
915
+ mediaQueryWidth: $ ?? i.mediaQueryWidth,
916
916
  swipeBarZIndex: j ?? i.swipeBarZIndex,
917
- toggleZIndex: $ ?? i.toggleZIndex,
917
+ toggleZIndex: B ?? i.toggleZIndex,
918
918
  overlayZIndex: k ?? i.overlayZIndex,
919
919
  fadeContent: v ?? i.fadeContent,
920
- fadeContentTransitionMs: y ?? i.fadeContentTransitionMs,
921
- swipeToOpen: O ?? i.swipeToOpen,
922
- swipeToClose: P ?? i.swipeToClose,
923
- midAnchorPoint: V ?? i.midAnchorPoint,
924
- midAnchorPointPx: D ?? i.midAnchorPointPx ?? Math.floor(U / 3),
925
- disabled: q ?? i.disabled,
926
- closeSidebarOnOverlayClick: G ?? i.closeSidebarOnOverlayClick,
920
+ fadeContentTransitionMs: x ?? i.fadeContentTransitionMs,
921
+ swipeToOpen: E ?? i.swipeToOpen,
922
+ swipeToClose: M ?? i.swipeToClose,
923
+ midAnchorPoint: q ?? i.midAnchorPoint,
924
+ midAnchorPointPx: D ?? i.midAnchorPointPx ?? Math.floor(Z / 3),
925
+ disabled: V ?? i.disabled,
926
+ closeSidebarOnOverlayClick: U ?? i.closeSidebarOnOverlayClick,
927
927
  resetMetaOnClose: H ?? i.resetMetaOnClose
928
928
  };
929
929
  }, [
930
- c,
931
- d,
932
- u,
933
- T,
930
+ f,
931
+ l,
932
+ s,
934
933
  w,
935
- b,
934
+ y,
935
+ h,
936
936
  S,
937
- I,
938
- p,
939
- M,
940
- _,
941
937
  C,
938
+ p,
939
+ P,
940
+ L,
941
+ I,
942
942
  i,
943
- Y,
944
- j,
945
943
  $,
944
+ j,
945
+ B,
946
946
  k,
947
947
  v,
948
- y,
949
- O,
950
- P,
951
- V,
952
- D,
948
+ x,
949
+ E,
950
+ M,
953
951
  q,
954
- G,
952
+ D,
953
+ V,
954
+ U,
955
955
  H
956
956
  ]);
957
- return z(() => {
958
- e === "left" ? s(F) : e === "right" ? o(F) : e === "bottom" ? f(r ?? "primary", F) : Ee(e);
957
+ return G(() => {
958
+ e === "left" ? c(N) : e === "right" ? o(N) : e === "bottom" ? u(r ?? "primary", N) : Oe(e);
959
959
  }, [
960
960
  e,
961
961
  r,
962
- F,
963
- s,
962
+ N,
963
+ c,
964
964
  o,
965
- f
966
- ]), F;
965
+ u
966
+ ]), N;
967
967
  };
968
- function Ie({
968
+ function Ce({
969
969
  isCollapsed: e,
970
970
  setCollapsed: t,
971
971
  closeSidebarOnClick: r = !0,
972
972
  transitionMs: i,
973
- overlayBackgroundColor: s,
973
+ overlayBackgroundColor: c,
974
974
  overlayZIndex: o
975
975
  }) {
976
- return /* @__PURE__ */ E.jsx(
976
+ return /* @__PURE__ */ O.jsx(
977
977
  "div",
978
978
  {
979
+ "aria-hidden": "true",
979
980
  style: {
980
981
  transitionDuration: `${i}ms`,
981
- ...er,
982
- ...e ? {} : tr,
983
- ...s ? { backgroundColor: s } : {},
982
+ ...tr,
983
+ ...e ? {} : rr,
984
+ ...c ? { backgroundColor: c } : {},
984
985
  zIndex: o
985
986
  },
986
- onMouseDown: (f) => {
987
- r && (f.stopPropagation(), t());
987
+ onMouseDown: (u) => {
988
+ r && (u.stopPropagation(), t());
988
989
  }
989
990
  }
990
991
  );
991
992
  }
992
- function Ce({ size: e, color: t }) {
993
- const r = L(null);
994
- return z(() => {
993
+ function Ie({ size: e, color: t }) {
994
+ const r = _(null);
995
+ return G(() => {
995
996
  const i = () => {
996
997
  r.current && (r.current.style.opacity = "1");
997
- }, s = () => {
998
- r.current && (r.current.style.opacity = `${je}`);
998
+ }, c = () => {
999
+ r.current && (r.current.style.opacity = `${ke}`);
999
1000
  };
1000
- r.current && (r.current.addEventListener("mouseenter", i), r.current.addEventListener("mouseleave", s));
1001
- }, []), /* @__PURE__ */ E.jsx(
1001
+ r.current && (r.current.addEventListener("mouseenter", i), r.current.addEventListener("mouseleave", c));
1002
+ }, []), /* @__PURE__ */ O.jsx(
1002
1003
  "div",
1003
1004
  {
1004
1005
  style: {
1005
- ...nr
1006
+ ...ir
1006
1007
  },
1007
- children: /* @__PURE__ */ E.jsxs(
1008
+ children: /* @__PURE__ */ O.jsxs(
1008
1009
  "svg",
1009
1010
  {
1010
1011
  style: {
1011
- transition: `opacity ${kt}ms ease`,
1012
- opacity: `${je}`
1012
+ transition: `opacity ${Ft}ms ease`,
1013
+ opacity: `${ke}`
1013
1014
  },
1014
1015
  ref: r,
1015
1016
  "aria-hidden": "true",
@@ -1018,8 +1019,8 @@ function Ce({ size: e, color: t }) {
1018
1019
  xmlns: "http://www.w3.org/2000/svg",
1019
1020
  width: e,
1020
1021
  children: [
1021
- /* @__PURE__ */ E.jsx("g", { strokeWidth: "0" }),
1022
- /* @__PURE__ */ E.jsx("g", { strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ E.jsx("g", { children: /* @__PURE__ */ E.jsx(
1022
+ /* @__PURE__ */ O.jsx("g", { strokeWidth: "0" }),
1023
+ /* @__PURE__ */ O.jsx("g", { strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ O.jsx("g", { children: /* @__PURE__ */ O.jsx(
1023
1024
  "path",
1024
1025
  {
1025
1026
  clipRule: "evenodd",
@@ -1034,135 +1035,185 @@ function Ce({ size: e, color: t }) {
1034
1035
  }
1035
1036
  );
1036
1037
  }
1037
- function ar({
1038
+ function sr({
1038
1039
  id: e,
1039
1040
  toggleRef: t,
1040
1041
  options: r,
1041
1042
  showToggle: i = !0,
1042
- ToggleComponent: s
1043
+ ToggleComponent: c
1043
1044
  }) {
1044
- var u;
1045
- const { openSidebar: o, closeSidebar: f, bottomSidebars: c } = ee(), d = ((u = c[e]) == null ? void 0 : u.isOpen) ?? !1;
1046
- return i ? /* @__PURE__ */ E.jsx(
1045
+ var s;
1046
+ const { openSidebar: o, closeSidebar: u, bottomSidebars: f } = ee(), l = ((s = f[e]) == null ? void 0 : s.isOpen) ?? !1;
1047
+ return i ? /* @__PURE__ */ O.jsx(
1047
1048
  "div",
1048
1049
  {
1049
1050
  ref: t,
1050
1051
  style: {
1051
- ...rr,
1052
+ ...nr,
1052
1053
  transition: `transform ${r.transitionMs}ms ease, opacity ${r.transitionMs}ms ease`,
1053
1054
  zIndex: r.toggleZIndex
1054
1055
  },
1055
- children: (!d || d && !r.showOverlay) && /* @__PURE__ */ E.jsx(
1056
+ children: (!l || l && !r.showOverlay) && /* @__PURE__ */ O.jsx(
1056
1057
  "button",
1057
1058
  {
1058
1059
  type: "button",
1060
+ "aria-expanded": l,
1061
+ "aria-controls": `swipebar-bottom-${e}`,
1062
+ "aria-label": l ? "Close bottom sidebar" : "Open bottom sidebar",
1059
1063
  onClick: () => {
1060
- r.disabled || (d ? f("bottom", { id: e }) : o("bottom", { id: e }));
1064
+ r.disabled || (l ? u("bottom", { id: e }) : o("bottom", { id: e }));
1061
1065
  },
1062
1066
  disabled: r.disabled,
1063
1067
  style: {
1064
1068
  marginBottom: `${r.toggleIconEdgeDistancePx}px`,
1065
1069
  // Rotate icon: -90deg points up when closed, 90deg points down when open
1066
- transform: d ? "rotate(90deg)" : "rotate(-90deg)"
1070
+ transform: l ? "rotate(90deg)" : "rotate(-90deg)"
1067
1071
  },
1068
- children: s ?? /* @__PURE__ */ E.jsx(Ce, { size: r.toggleIconSizePx, color: r.toggleIconColor })
1072
+ children: c ?? /* @__PURE__ */ O.jsx(Ie, { size: r.toggleIconSizePx, color: r.toggleIconColor })
1069
1073
  }
1070
1074
  )
1071
1075
  }
1072
1076
  ) : null;
1073
1077
  }
1078
+ const cr = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
1079
+ function lr(e) {
1080
+ return Array.from(e.querySelectorAll(cr)).filter(
1081
+ (t) => !t.closest("[inert]")
1082
+ );
1083
+ }
1084
+ function _e({
1085
+ sidebarRef: e,
1086
+ triggerRef: t,
1087
+ isOpen: r,
1088
+ onClose: i,
1089
+ transitionMs: c
1090
+ }) {
1091
+ const o = _(null);
1092
+ G(() => {
1093
+ var f;
1094
+ if (r) {
1095
+ o.current = document.activeElement;
1096
+ const l = setTimeout(() => {
1097
+ e.current && (e.current.setAttribute("tabindex", "-1"), e.current.focus());
1098
+ }, c);
1099
+ return () => clearTimeout(l);
1100
+ }
1101
+ const u = o.current;
1102
+ if (u) {
1103
+ const l = ((f = t.current) == null ? void 0 : f.querySelector("button")) ?? u;
1104
+ requestAnimationFrame(() => {
1105
+ l.focus();
1106
+ }), o.current = null;
1107
+ }
1108
+ }, [r, e, t, c]), G(() => {
1109
+ if (!r) return;
1110
+ function u(f) {
1111
+ if (f.key === "Escape") {
1112
+ if (!e.current) return;
1113
+ e.current.contains(document.activeElement) && (f.preventDefault(), i());
1114
+ return;
1115
+ }
1116
+ if (f.key !== "Tab" || !e.current) return;
1117
+ const l = lr(e.current);
1118
+ if (l.length === 0) return;
1119
+ const s = l[0], w = l[l.length - 1];
1120
+ f.shiftKey ? document.activeElement === s && (f.preventDefault(), w.focus()) : document.activeElement === w && (f.preventDefault(), s.focus());
1121
+ }
1122
+ return document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u);
1123
+ }, [r, e, i]);
1124
+ }
1074
1125
  function fe(e = Te) {
1075
- const t = `(max-width: ${Math.min(e, Te)}px)`, r = () => typeof window > "u" || typeof window.matchMedia > "u" ? !1 : window.matchMedia(t).matches, [i, s] = Q(r);
1076
- return z(() => {
1126
+ const t = `(max-width: ${Math.min(e, Te)}px)`, r = () => typeof window > "u" || typeof window.matchMedia > "u" ? !1 : window.matchMedia(t).matches, [i, c] = Q(r);
1127
+ return G(() => {
1077
1128
  if (typeof window > "u" || typeof window.matchMedia > "u")
1078
1129
  return;
1079
- const o = window.matchMedia(t), f = () => s(o.matches);
1080
- return f(), o.addEventListener("change", f), () => o.removeEventListener("change", f);
1130
+ const o = window.matchMedia(t), u = () => c(o.matches);
1131
+ return u(), o.addEventListener("change", u), () => o.removeEventListener("change", u);
1081
1132
  }, [t]), i;
1082
1133
  }
1083
- const Ue = ({
1134
+ const Ze = ({
1084
1135
  refs: e,
1085
1136
  callbacks: t,
1086
1137
  currentY: r,
1087
1138
  preventDefault: i,
1088
- lockPane: s,
1139
+ lockPane: c,
1089
1140
  options: o,
1090
- scrollableAncestor: f,
1091
- initialScrollTop: c
1141
+ scrollableAncestor: u,
1142
+ initialScrollTop: f
1092
1143
  }) => {
1093
1144
  if (!e.draggingRef.current) return;
1094
- const d = r - e.draggingRef.current.startY;
1095
- if (!e.draggingRef.current.isActivated && Math.abs(d) >= o.dragActivationDeltaPx) {
1096
- if (f && t.getIsOpen()) {
1097
- if (f.scrollTop !== c) {
1145
+ const l = r - e.draggingRef.current.startY;
1146
+ if (!e.draggingRef.current.isActivated && Math.abs(l) >= o.dragActivationDeltaPx) {
1147
+ if (u && t.getIsOpen()) {
1148
+ if (u.scrollTop !== f) {
1098
1149
  e.draggingRef.current = null, t.dragSidebar(null);
1099
1150
  return;
1100
1151
  }
1101
- const { scrollTop: p, scrollHeight: M, clientHeight: _ } = f, C = p > 1, Y = p + _ < M - 1;
1102
- if (d > 0 && C || d < 0 && Y) {
1152
+ const { scrollTop: p, scrollHeight: P, clientHeight: L } = u, I = p > 1, $ = p + L < P - 1;
1153
+ if (l > 0 && I || l < 0 && $) {
1103
1154
  e.draggingRef.current = null, t.dragSidebar(null);
1104
1155
  return;
1105
1156
  }
1106
1157
  }
1107
- e.draggingRef.current.isActivated = !0, s();
1158
+ e.draggingRef.current.isActivated = !0, c();
1108
1159
  }
1109
1160
  if (!e.draggingRef.current.isActivated) return;
1110
1161
  e.prevYRef.current = e.currentYRef.current, e.currentYRef.current = r;
1111
- const u = t.getIsOpen(), T = window.innerHeight;
1112
- let w = !1;
1113
- if ((u || e.draggingRef.current.startY >= T - o.edgeActivationWidthPx) && (w = !0), !w) {
1162
+ const s = t.getIsOpen(), w = window.innerHeight;
1163
+ let y = !1;
1164
+ if ((s || e.draggingRef.current.startY >= w - o.edgeActivationWidthPx) && (y = !0), !y) {
1114
1165
  e.draggingRef.current = null, t.dragSidebar(null);
1115
1166
  return;
1116
1167
  }
1117
1168
  i();
1118
- const b = o.sidebarHeightPx, S = o.midAnchorPointPx, I = o.midAnchorPoint && !o.swipeToOpen && S < b;
1119
- if (u)
1120
- if (I) {
1169
+ const h = o.sidebarHeightPx, S = o.midAnchorPointPx, C = o.midAnchorPoint && !o.swipeToOpen && S < h;
1170
+ if (s)
1171
+ if (C) {
1121
1172
  const p = t.getBottomAnchorState();
1122
1173
  if (p === "open") {
1123
- const M = Math.max(
1174
+ const P = Math.max(
1124
1175
  0,
1125
- Math.min(b, d - o.dragActivationDeltaPx)
1176
+ Math.min(h, l - o.dragActivationDeltaPx)
1126
1177
  );
1127
- t.dragSidebar(M);
1178
+ t.dragSidebar(P);
1128
1179
  } else if (p === "midAnchor") {
1129
- const M = b - S, _ = Math.max(
1180
+ const P = h - S, L = Math.max(
1130
1181
  0,
1131
1182
  Math.min(
1132
- b,
1133
- M + d - o.dragActivationDeltaPx
1183
+ h,
1184
+ P + l - o.dragActivationDeltaPx
1134
1185
  )
1135
1186
  );
1136
- t.dragSidebar(_);
1187
+ t.dragSidebar(L);
1137
1188
  }
1138
1189
  } else {
1139
1190
  const p = Math.max(
1140
1191
  0,
1141
- Math.min(b, d - o.dragActivationDeltaPx)
1192
+ Math.min(h, l - o.dragActivationDeltaPx)
1142
1193
  );
1143
1194
  t.dragSidebar(p);
1144
1195
  }
1145
- else if (e.draggingRef.current.startY >= T - o.edgeActivationWidthPx)
1146
- if (I) {
1147
- const p = b - S, M = Math.max(
1196
+ else if (e.draggingRef.current.startY >= w - o.edgeActivationWidthPx)
1197
+ if (C) {
1198
+ const p = h - S, P = Math.max(
1148
1199
  p,
1149
1200
  Math.min(
1150
- b,
1151
- b + d + o.dragActivationDeltaPx
1201
+ h,
1202
+ h + l + o.dragActivationDeltaPx
1152
1203
  )
1153
1204
  );
1154
- t.dragSidebar(M);
1205
+ t.dragSidebar(P);
1155
1206
  } else {
1156
1207
  const p = Math.max(
1157
1208
  0,
1158
1209
  Math.min(
1159
- b,
1160
- b + d + o.dragActivationDeltaPx
1210
+ h,
1211
+ h + l + o.dragActivationDeltaPx
1161
1212
  )
1162
1213
  );
1163
1214
  t.dragSidebar(p);
1164
1215
  }
1165
- }, Ze = ({
1216
+ }, ze = ({
1166
1217
  refs: e,
1167
1218
  callbacks: t,
1168
1219
  options: r,
@@ -1173,127 +1224,127 @@ const Ue = ({
1173
1224
  e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null;
1174
1225
  return;
1175
1226
  }
1176
- const s = e.currentYRef.current ?? e.draggingRef.current.startY, o = e.prevYRef.current ?? e.draggingRef.current.startY, f = e.draggingRef.current.startY, c = t.getIsOpen(), d = window.innerHeight;
1227
+ const c = e.currentYRef.current ?? e.draggingRef.current.startY, o = e.prevYRef.current ?? e.draggingRef.current.startY, u = e.draggingRef.current.startY, f = t.getIsOpen(), l = window.innerHeight;
1177
1228
  e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null, i();
1178
- const u = s < o, T = s >= o, w = f >= d - r.edgeActivationWidthPx, b = r.midAnchorPointPx, S = r.sidebarHeightPx, I = r.midAnchorPoint && !r.swipeToOpen && b < S;
1179
- if (c)
1180
- if (I) {
1181
- const p = t.getBottomAnchorState(), M = S - b;
1229
+ const s = c < o, w = c >= o, y = u >= l - r.edgeActivationWidthPx, h = r.midAnchorPointPx, S = r.sidebarHeightPx, C = r.midAnchorPoint && !r.swipeToOpen && h < S;
1230
+ if (f)
1231
+ if (C) {
1232
+ const p = t.getBottomAnchorState(), P = S - h;
1182
1233
  if (p === "open") {
1183
- const _ = Math.max(0, s - f);
1184
- T ? _ > M ? t.closeSidebar() : t.openToMidAnchor() : _ < M ? t.openSidebarFully() : t.closeSidebar(), t.dragSidebar(null);
1234
+ const L = Math.max(0, c - u);
1235
+ w ? L > P ? t.closeSidebar() : t.openToMidAnchor() : L < P ? t.openSidebarFully() : t.closeSidebar(), t.dragSidebar(null);
1185
1236
  } else if (p === "midAnchor") {
1186
- const _ = S - b, C = Math.max(
1237
+ const L = S - h, I = Math.max(
1187
1238
  0,
1188
- Math.min(S, _ + (s - f))
1239
+ Math.min(S, L + (c - u))
1189
1240
  );
1190
- u ? C < M ? t.openSidebarFully() : t.openToMidAnchor() : t.closeSidebar(), t.dragSidebar(null);
1241
+ s ? I < P ? t.openSidebarFully() : t.openToMidAnchor() : t.closeSidebar(), t.dragSidebar(null);
1191
1242
  }
1192
1243
  } else
1193
- T ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null);
1194
- else w && u ? (I ? t.openToMidAnchor() : t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
1244
+ w ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null);
1245
+ else y && s ? (C ? t.openToMidAnchor() : t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
1195
1246
  };
1196
- function sr(e, t) {
1247
+ function ur(e, t) {
1197
1248
  var k, v;
1198
1249
  const r = fe(e.mediaQueryWidth), {
1199
1250
  lockedSidebar: i,
1200
- setLockedSidebar: s,
1251
+ setLockedSidebar: c,
1201
1252
  bottomSidebars: o,
1202
- openSidebar: f,
1203
- openSidebarFully: c,
1204
- closeSidebar: d,
1205
- dragSidebar: u,
1206
- openSidebarToMidAnchor: T,
1207
- activeBottomDragIdRef: w,
1208
- bottomFocusStackRef: b
1209
- } = ee(), S = ((k = o[t]) == null ? void 0 : k.isOpen) ?? !1, I = ((v = o[t]) == null ? void 0 : v.anchorState) ?? "closed", p = L(null), M = L(null), _ = L(null), C = L(null), Y = L(0), j = L(null), $ = L(I);
1210
- z(() => {
1211
- $.current = I;
1212
- }, [I]), z(() => {
1253
+ openSidebar: u,
1254
+ openSidebarFully: f,
1255
+ closeSidebar: l,
1256
+ dragSidebar: s,
1257
+ openSidebarToMidAnchor: w,
1258
+ activeBottomDragIdRef: y,
1259
+ bottomFocusStackRef: h
1260
+ } = ee(), S = ((k = o[t]) == null ? void 0 : k.isOpen) ?? !1, C = ((v = o[t]) == null ? void 0 : v.anchorState) ?? "closed", p = _(null), P = _(null), L = _(null), I = _(null), $ = _(0), j = _(null), B = _(C);
1261
+ G(() => {
1262
+ B.current = C;
1263
+ }, [C]), G(() => {
1213
1264
  if (!r || i && i !== "bottom" || e.disabled) return;
1214
- const y = {
1265
+ const x = {
1215
1266
  getIsOpen: () => S,
1216
- openSidebar: () => f("bottom", { id: t }),
1217
- openSidebarFully: () => c("bottom", { id: t }),
1218
- closeSidebar: () => d("bottom", { id: t }),
1219
- dragSidebar: (n) => u("bottom", n, { id: t }),
1220
- getBottomAnchorState: () => $.current,
1221
- openToMidAnchor: () => T("bottom", { id: t })
1222
- }, O = {
1267
+ openSidebar: () => u("bottom", { id: t }),
1268
+ openSidebarFully: () => f("bottom", { id: t }),
1269
+ closeSidebar: () => l("bottom", { id: t }),
1270
+ dragSidebar: (n) => s("bottom", n, { id: t }),
1271
+ getBottomAnchorState: () => B.current,
1272
+ openToMidAnchor: () => w("bottom", { id: t })
1273
+ }, E = {
1223
1274
  draggingRef: p,
1224
- currentYRef: M,
1225
- prevYRef: _
1226
- }, P = () => w.current !== null && w.current !== t, V = () => {
1227
- const n = b.current;
1275
+ currentYRef: P,
1276
+ prevYRef: L
1277
+ }, M = () => y.current !== null && y.current !== t, q = () => {
1278
+ const n = h.current;
1228
1279
  return n.length === 0 ? !0 : n[n.length - 1] === t;
1229
1280
  }, D = () => {
1230
- if (P()) {
1281
+ if (M()) {
1231
1282
  p.current = null;
1232
1283
  return;
1233
1284
  }
1234
- w.current = t, s("bottom");
1235
- const n = C.current;
1285
+ y.current = t, c("bottom");
1286
+ const n = I.current;
1236
1287
  n && (j.current = n.style.overflowY, n.style.overflowY = "hidden");
1237
- }, q = () => {
1238
- w.current === t && (w.current = null);
1239
- const n = C.current;
1288
+ }, V = () => {
1289
+ y.current === t && (y.current = null);
1290
+ const n = I.current;
1240
1291
  n && j.current !== null && (n.style.overflowY = j.current, j.current = null);
1241
1292
  };
1242
- function G(n) {
1243
- var N;
1244
- if (i && i !== "bottom" || P() || !V() || de(n.target) || n.changedTouches.length === 0) return;
1245
- const h = n.changedTouches[0], R = window.innerHeight, x = y.getIsOpen(), Z = h.clientY >= R - e.edgeActivationWidthPx;
1246
- x && !e.swipeToClose || !x && !e.swipeToOpen || (x || Z) && (C.current = Ge(n.target), Y.current = ((N = C.current) == null ? void 0 : N.scrollTop) ?? 0, He({
1247
- refs: O,
1248
- clientX: h.clientX,
1249
- clientY: h.clientY,
1250
- touchId: h.identifier,
1293
+ function U(n) {
1294
+ var F;
1295
+ if (i && i !== "bottom" || M() || !q() || de(n.target) || n.changedTouches.length === 0) return;
1296
+ const m = n.changedTouches[0], T = window.innerHeight, R = x.getIsOpen(), z = m.clientY >= T - e.edgeActivationWidthPx;
1297
+ R && !e.swipeToClose || !R && !e.swipeToOpen || (R || z) && (I.current = Ue(n.target), $.current = ((F = I.current) == null ? void 0 : F.scrollTop) ?? 0, Ge({
1298
+ refs: E,
1299
+ clientX: m.clientX,
1300
+ clientY: m.clientY,
1301
+ touchId: m.identifier,
1251
1302
  isMouse: !1
1252
1303
  }));
1253
1304
  }
1254
1305
  function H(n) {
1255
1306
  if (i && i !== "bottom") return;
1256
- if (P()) {
1307
+ if (M()) {
1257
1308
  p.current = null;
1258
1309
  return;
1259
1310
  }
1260
1311
  if (!p.current || p.current.isMouse) return;
1261
- const h = p.current.activeTouchId, R = Ae(n.changedTouches, h);
1262
- R && Ue({
1263
- refs: O,
1264
- callbacks: y,
1265
- currentY: R.clientY,
1312
+ const m = p.current.activeTouchId, T = Ae(n.changedTouches, m);
1313
+ T && Ze({
1314
+ refs: E,
1315
+ callbacks: x,
1316
+ currentY: T.clientY,
1266
1317
  preventDefault: () => n.preventDefault(),
1267
1318
  lockPane: D,
1268
1319
  options: e,
1269
- scrollableAncestor: C.current,
1270
- initialScrollTop: Y.current
1320
+ scrollableAncestor: I.current,
1321
+ initialScrollTop: $.current
1271
1322
  });
1272
1323
  }
1273
- function F(n) {
1324
+ function N(n) {
1274
1325
  if (i && i !== "bottom" || !p.current || p.current.isMouse) return;
1275
- const h = p.current.activeTouchId;
1276
- Pe(n.changedTouches, h) && Ze({
1277
- refs: O,
1278
- callbacks: y,
1326
+ const m = p.current.activeTouchId;
1327
+ Pe(n.changedTouches, m) && ze({
1328
+ refs: E,
1329
+ callbacks: x,
1279
1330
  options: e,
1280
- onDragEnd: q
1331
+ onDragEnd: V
1281
1332
  });
1282
1333
  }
1283
- function U() {
1284
- i && i !== "bottom" || !p.current || p.current.isMouse || (q(), or({
1285
- refs: O,
1286
- dragSidebar: y.dragSidebar,
1334
+ function Z() {
1335
+ i && i !== "bottom" || !p.current || p.current.isMouse || (V(), ar({
1336
+ refs: E,
1337
+ dragSidebar: x.dragSidebar,
1287
1338
  onDeactivate: () => {
1288
1339
  }
1289
1340
  }));
1290
1341
  }
1291
1342
  function oe(n) {
1292
- var Z;
1293
- if (i && i !== "bottom" || P() || !V() || de(n.target) || n.button !== 0) return;
1294
- const h = window.innerHeight, R = y.getIsOpen(), x = n.clientY >= h - e.edgeActivationWidthPx;
1295
- R && !e.swipeToClose || !R && !e.swipeToOpen || (R || x) && (C.current = Ge(n.target), Y.current = ((Z = C.current) == null ? void 0 : Z.scrollTop) ?? 0, He({
1296
- refs: O,
1343
+ var z;
1344
+ if (i && i !== "bottom" || M() || !q() || de(n.target) || n.button !== 0) return;
1345
+ const m = window.innerHeight, T = x.getIsOpen(), R = n.clientY >= m - e.edgeActivationWidthPx;
1346
+ T && !e.swipeToClose || !T && !e.swipeToOpen || (T || R) && (I.current = Ue(n.target), $.current = ((z = I.current) == null ? void 0 : z.scrollTop) ?? 0, Ge({
1347
+ refs: E,
1297
1348
  clientX: n.clientX,
1298
1349
  clientY: n.clientY,
1299
1350
  touchId: null,
@@ -1302,96 +1353,108 @@ function sr(e, t) {
1302
1353
  }
1303
1354
  function ne(n) {
1304
1355
  if (!(i && i !== "bottom")) {
1305
- if (P()) {
1356
+ if (M()) {
1306
1357
  p.current = null;
1307
1358
  return;
1308
1359
  }
1309
- !p.current || !p.current.isMouse || Ue({
1310
- refs: O,
1311
- callbacks: y,
1360
+ !p.current || !p.current.isMouse || Ze({
1361
+ refs: E,
1362
+ callbacks: x,
1312
1363
  currentY: n.clientY,
1313
1364
  preventDefault: () => n.preventDefault(),
1314
1365
  lockPane: D,
1315
1366
  options: e,
1316
- scrollableAncestor: C.current,
1317
- initialScrollTop: Y.current
1367
+ scrollableAncestor: I.current,
1368
+ initialScrollTop: $.current
1318
1369
  });
1319
1370
  }
1320
1371
  }
1321
1372
  function ae() {
1322
- i && i !== "bottom" || !p.current || !p.current.isMouse || Ze({
1323
- refs: O,
1324
- callbacks: y,
1373
+ i && i !== "bottom" || !p.current || !p.current.isMouse || ze({
1374
+ refs: E,
1375
+ callbacks: x,
1325
1376
  options: e,
1326
- onDragEnd: q
1377
+ onDragEnd: V
1327
1378
  });
1328
1379
  }
1329
- return window.addEventListener("touchstart", G, { passive: !0 }), window.addEventListener("touchmove", H, { passive: !1 }), window.addEventListener("touchend", F, { passive: !0 }), window.addEventListener("touchcancel", U, { passive: !0 }), window.addEventListener("mousedown", oe, { passive: !0 }), window.addEventListener("mousemove", ne, { passive: !1 }), window.addEventListener("mouseup", ae, { passive: !0 }), () => {
1330
- window.removeEventListener("touchstart", G), window.removeEventListener("touchmove", H), window.removeEventListener("touchend", F), window.removeEventListener("touchcancel", U), window.removeEventListener("mousedown", oe), window.removeEventListener("mousemove", ne), window.removeEventListener("mouseup", ae);
1380
+ return window.addEventListener("touchstart", U, { passive: !0 }), window.addEventListener("touchmove", H, { passive: !1 }), window.addEventListener("touchend", N, { passive: !0 }), window.addEventListener("touchcancel", Z, { passive: !0 }), window.addEventListener("mousedown", oe, { passive: !0 }), window.addEventListener("mousemove", ne, { passive: !1 }), window.addEventListener("mouseup", ae, { passive: !0 }), () => {
1381
+ window.removeEventListener("touchstart", U), window.removeEventListener("touchmove", H), window.removeEventListener("touchend", N), window.removeEventListener("touchcancel", Z), window.removeEventListener("mousedown", oe), window.removeEventListener("mousemove", ne), window.removeEventListener("mouseup", ae);
1331
1382
  };
1332
1383
  }, [
1333
1384
  t,
1334
1385
  r,
1335
1386
  S,
1336
- f,
1337
- c,
1338
- d,
1339
1387
  u,
1340
- i,
1388
+ f,
1389
+ l,
1341
1390
  s,
1391
+ i,
1392
+ c,
1342
1393
  e,
1343
- T,
1344
1394
  w,
1345
- b
1395
+ y,
1396
+ h
1346
1397
  ]);
1347
1398
  }
1348
- function mr({
1399
+ function wr({
1349
1400
  id: e = "primary",
1350
1401
  className: t,
1351
1402
  children: r,
1352
1403
  ToggleComponent: i,
1353
- ...s
1404
+ ariaLabel: c,
1405
+ ...o
1354
1406
  }) {
1355
- var I;
1356
- if ((r == null ? void 0 : r.type) === E.Fragment)
1407
+ var P;
1408
+ if ((r == null ? void 0 : r.type) === O.Fragment)
1357
1409
  throw new Error("Fragments is not allowed in SwipeBarBottom");
1358
- const { bottomSidebars: o, closeSidebar: f, registerBottomSidebar: c, unregisterBottomSidebar: d } = ee(), u = L(null), T = L(null);
1359
- z(() => (c(e, { sidebarRef: u, toggleRef: T }), () => d(e)), [e, c, d]);
1360
- const w = Me("bottom", s, e), b = fe(w.mediaQueryWidth);
1361
- sr(w, e);
1362
- const S = ((I = o[e]) == null ? void 0 : I.isOpen) ?? !1;
1363
- return /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
1364
- w.showOverlay && /* @__PURE__ */ E.jsx(
1365
- Ie,
1410
+ const { bottomSidebars: u, closeSidebar: f, registerBottomSidebar: l, unregisterBottomSidebar: s } = ee(), w = _(null), y = _(null);
1411
+ G(() => (l(e, { sidebarRef: w, toggleRef: y }), () => s(e)), [e, l, s]);
1412
+ const h = Me("bottom", o, e), S = fe(h.mediaQueryWidth);
1413
+ ur(h, e);
1414
+ const C = ((P = u[e]) == null ? void 0 : P.isOpen) ?? !1, p = Y(() => f("bottom", { id: e }), [f, e]);
1415
+ return _e({
1416
+ sidebarRef: w,
1417
+ triggerRef: y,
1418
+ isOpen: C,
1419
+ onClose: p,
1420
+ transitionMs: h.transitionMs
1421
+ }), /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
1422
+ h.showOverlay && /* @__PURE__ */ O.jsx(
1423
+ Ce,
1366
1424
  {
1367
- isCollapsed: !S,
1425
+ isCollapsed: !C,
1368
1426
  setCollapsed: () => f("bottom", { id: e }),
1369
- closeSidebarOnClick: w.closeSidebarOnOverlayClick,
1370
- transitionMs: w.transitionMs,
1371
- overlayBackgroundColor: w.overlayBackgroundColor,
1372
- overlayZIndex: w.overlayZIndex
1427
+ closeSidebarOnClick: h.closeSidebarOnOverlayClick,
1428
+ transitionMs: h.transitionMs,
1429
+ overlayBackgroundColor: h.overlayBackgroundColor,
1430
+ overlayZIndex: h.overlayZIndex
1373
1431
  }
1374
1432
  ),
1375
- /* @__PURE__ */ E.jsx(
1376
- ar,
1433
+ /* @__PURE__ */ O.jsx(
1434
+ sr,
1377
1435
  {
1378
1436
  id: e,
1379
- toggleRef: T,
1380
- options: w,
1381
- showToggle: w.showToggle,
1437
+ toggleRef: y,
1438
+ options: h,
1439
+ showToggle: h.showToggle,
1382
1440
  ToggleComponent: i
1383
1441
  }
1384
1442
  ),
1385
- /* @__PURE__ */ E.jsx(
1443
+ /* @__PURE__ */ O.jsx(
1386
1444
  "div",
1387
1445
  {
1388
- ref: u,
1446
+ ref: w,
1447
+ id: `swipebar-bottom-${e}`,
1448
+ role: "dialog",
1449
+ "aria-modal": C,
1450
+ "aria-label": c ?? "Bottom sidebar",
1451
+ inert: !C,
1389
1452
  style: {
1390
- ...Qt,
1391
1453
  ...Jt,
1392
- ...w.isAbsolute || b ? Kt : {},
1393
- ...t ? {} : { backgroundColor: Oe },
1394
- zIndex: w.swipeBarZIndex
1454
+ ...Kt,
1455
+ ...h.isAbsolute || S ? er : {},
1456
+ ...t ? {} : { backgroundColor: Ee },
1457
+ zIndex: h.swipeBarZIndex
1395
1458
  },
1396
1459
  className: t,
1397
1460
  children: r
@@ -1399,71 +1462,74 @@ function mr({
1399
1462
  )
1400
1463
  ] });
1401
1464
  }
1402
- function cr({ options: e, showToggle: t = !0, ToggleComponent: r }) {
1403
- const { openSidebar: i, leftToggleRef: s, isLeftOpen: o, closeSidebar: f } = ee();
1404
- return t ? /* @__PURE__ */ E.jsx(
1465
+ function dr({ options: e, showToggle: t = !0, ToggleComponent: r }) {
1466
+ const { openSidebar: i, leftToggleRef: c, isLeftOpen: o, closeSidebar: u } = ee();
1467
+ return t ? /* @__PURE__ */ O.jsx(
1405
1468
  "div",
1406
1469
  {
1407
- ref: s,
1470
+ ref: c,
1408
1471
  style: {
1409
- ...rt,
1472
+ ...nt,
1410
1473
  transition: `transform ${e.transitionMs}ms ease, opacity ${e.transitionMs}ms ease`,
1411
1474
  left: 0,
1412
1475
  zIndex: e.toggleZIndex
1413
1476
  },
1414
- children: (!o || o && !e.showOverlay) && /* @__PURE__ */ E.jsx(
1477
+ children: (!o || o && !e.showOverlay) && /* @__PURE__ */ O.jsx(
1415
1478
  "button",
1416
1479
  {
1417
1480
  type: "button",
1481
+ "aria-expanded": o,
1482
+ "aria-controls": "swipebar-left",
1483
+ "aria-label": o ? "Close left sidebar" : "Open left sidebar",
1418
1484
  onClick: () => {
1419
- e.disabled || (o ? f("left") : i("left"));
1485
+ e.disabled || (o ? u("left") : i("left"));
1420
1486
  },
1421
1487
  disabled: e.disabled,
1422
1488
  style: {
1423
1489
  marginLeft: `${e.toggleIconEdgeDistancePx}px`,
1424
1490
  ...o ? { transform: "rotate(180deg)" } : {}
1425
1491
  },
1426
- children: r ?? /* @__PURE__ */ E.jsx(Ce, { size: e.toggleIconSizePx, color: e.toggleIconColor })
1492
+ children: r ?? /* @__PURE__ */ O.jsx(Ie, { size: e.toggleIconSizePx, color: e.toggleIconColor })
1427
1493
  }
1428
1494
  )
1429
1495
  }
1430
1496
  ) : null;
1431
1497
  }
1432
- const ze = ({
1498
+ const qe = ({
1433
1499
  refs: e,
1434
1500
  callbacks: t,
1435
1501
  currentX: r,
1436
1502
  preventDefault: i,
1437
- lockPane: s,
1503
+ lockPane: c,
1438
1504
  options: o
1439
1505
  }) => {
1440
1506
  if (!e.draggingRef.current) return;
1441
- const f = r - e.draggingRef.current.startX;
1442
- if (!e.draggingRef.current.isActivated && Math.abs(f) >= o.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, s()), !e.draggingRef.current.isActivated) return;
1507
+ const u = r - e.draggingRef.current.startX;
1508
+ if (!e.draggingRef.current.isActivated && Math.abs(u) >= o.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, c()), !e.draggingRef.current.isActivated) return;
1443
1509
  e.prevXRef.current = e.currentXRef.current, e.currentXRef.current = r;
1444
- const c = t.getIsOpen();
1445
- let d = !1;
1446
- if ((c || e.draggingRef.current.startX <= o.edgeActivationWidthPx) && (d = !0), !d) {
1510
+ const f = t.getIsOpen();
1511
+ let l = !1;
1512
+ if ((f || e.draggingRef.current.startX <= o.edgeActivationWidthPx) && (l = !0), !l) {
1447
1513
  e.draggingRef.current = null, t.dragSidebar(null);
1448
1514
  return;
1449
1515
  }
1450
1516
  i();
1451
- const u = o.sidebarWidthPx;
1452
- if (c) {
1453
- const T = Math.min(
1517
+ const s = o.sidebarWidthPx;
1518
+ if (f) {
1519
+ const w = Math.min(
1454
1520
  0,
1455
- Math.max(-u, f + o.dragActivationDeltaPx)
1521
+ Math.max(-s, u + o.dragActivationDeltaPx)
1456
1522
  );
1457
- t.dragSidebar(T);
1523
+ t.dragSidebar(w);
1458
1524
  } else if (e.draggingRef.current.startX <= o.edgeActivationWidthPx) {
1459
- const T = Math.min(
1525
+ const w = Math.min(
1460
1526
  0,
1461
1527
  Math.max(
1462
- -u,
1463
- -u + f - o.dragActivationDeltaPx
1528
+ -s,
1529
+ -s + u - o.dragActivationDeltaPx
1464
1530
  )
1465
1531
  );
1466
- t.dragSidebar(T);
1532
+ t.dragSidebar(w);
1467
1533
  }
1468
1534
  }, Ve = ({ refs: e, callbacks: t, options: r }) => {
1469
1535
  if (!e.draggingRef.current) return;
@@ -1471,76 +1537,76 @@ const ze = ({
1471
1537
  e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
1472
1538
  return;
1473
1539
  }
1474
- const i = e.currentXRef.current ?? e.draggingRef.current.startX, s = e.prevXRef.current ?? e.draggingRef.current.startX, o = e.draggingRef.current.startX, f = t.getIsOpen();
1540
+ const i = e.currentXRef.current ?? e.draggingRef.current.startX, c = e.prevXRef.current ?? e.draggingRef.current.startX, o = e.draggingRef.current.startX, u = t.getIsOpen();
1475
1541
  e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
1476
- const c = i >= s, d = i < s, u = o <= r.edgeActivationWidthPx;
1477
- f ? (d ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : u && c ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
1542
+ const f = i >= c, l = i < c, s = o <= r.edgeActivationWidthPx;
1543
+ u ? (l ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : s && f ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
1478
1544
  };
1479
- function lr(e) {
1545
+ function fr(e) {
1480
1546
  const t = fe(e.mediaQueryWidth), {
1481
1547
  lockedSidebar: r,
1482
1548
  setLockedSidebar: i,
1483
- isLeftOpen: s,
1549
+ isLeftOpen: c,
1484
1550
  openSidebar: o,
1485
- closeSidebar: f,
1486
- dragSidebar: c,
1487
- leftSidebarRef: d
1488
- } = ee(), u = L(null), T = L(null), w = L(null);
1489
- z(() => {
1551
+ closeSidebar: u,
1552
+ dragSidebar: f,
1553
+ leftSidebarRef: l
1554
+ } = ee(), s = _(null), w = _(null), y = _(null);
1555
+ G(() => {
1490
1556
  if (!t || r && r !== "left" || e.disabled) return;
1491
- const b = {
1492
- getIsOpen: () => s,
1557
+ const h = {
1558
+ getIsOpen: () => c,
1493
1559
  openSidebar: () => o("left"),
1494
- closeSidebar: () => f("left"),
1495
- dragSidebar: (v) => c("left", v)
1560
+ closeSidebar: () => u("left"),
1561
+ dragSidebar: (v) => f("left", v)
1496
1562
  }, S = {
1497
- draggingRef: u,
1498
- currentXRef: T,
1499
- prevXRef: w
1500
- }, I = () => i("left"), p = () => i(null);
1501
- function M(v) {
1563
+ draggingRef: s,
1564
+ currentXRef: w,
1565
+ prevXRef: y
1566
+ }, C = () => i("left"), p = () => i(null);
1567
+ function P(v) {
1502
1568
  if (r && r !== "left" || de(v.target) || v.changedTouches.length === 0) return;
1503
- const y = v.changedTouches[0], O = b.getIsOpen(), P = y.clientX <= e.edgeActivationWidthPx;
1504
- O && !e.swipeToClose || !O && !e.swipeToOpen || (O || P) && Se({
1569
+ const x = v.changedTouches[0], E = h.getIsOpen(), M = x.clientX <= e.edgeActivationWidthPx;
1570
+ E && !e.swipeToClose || !E && !e.swipeToOpen || (E || M) && pe({
1505
1571
  refs: S,
1506
- clientX: y.clientX,
1507
- clientY: y.clientY,
1508
- touchId: y.identifier,
1572
+ clientX: x.clientX,
1573
+ clientY: x.clientY,
1574
+ touchId: x.identifier,
1509
1575
  isMouse: !1
1510
1576
  });
1511
1577
  }
1512
- function _(v) {
1513
- if (r && r !== "left" || !u.current || u.current.isMouse) return;
1514
- const y = u.current.activeTouchId, O = Ae(v.changedTouches, y);
1515
- O && ze({
1578
+ function L(v) {
1579
+ if (r && r !== "left" || !s.current || s.current.isMouse) return;
1580
+ const x = s.current.activeTouchId, E = Ae(v.changedTouches, x);
1581
+ E && qe({
1516
1582
  refs: S,
1517
- callbacks: b,
1518
- currentX: O.clientX,
1583
+ callbacks: h,
1584
+ currentX: E.clientX,
1519
1585
  preventDefault: () => v.preventDefault(),
1520
- lockPane: I,
1586
+ lockPane: C,
1521
1587
  options: e
1522
1588
  });
1523
1589
  }
1524
- function C(v) {
1525
- if (r && r !== "left" || !u.current || u.current.isMouse) return;
1526
- const y = u.current.activeTouchId;
1527
- Pe(v.changedTouches, y) && Ve({
1590
+ function I(v) {
1591
+ if (r && r !== "left" || !s.current || s.current.isMouse) return;
1592
+ const x = s.current.activeTouchId;
1593
+ Pe(v.changedTouches, x) && Ve({
1528
1594
  refs: S,
1529
- callbacks: b,
1595
+ callbacks: h,
1530
1596
  options: e
1531
1597
  });
1532
1598
  }
1533
- function Y() {
1534
- r && r !== "left" || !u.current || u.current.isMouse || nt({
1599
+ function $() {
1600
+ r && r !== "left" || !s.current || s.current.isMouse || it({
1535
1601
  refs: S,
1536
- dragSidebar: b.dragSidebar,
1602
+ dragSidebar: h.dragSidebar,
1537
1603
  onDeactivate: p
1538
1604
  });
1539
1605
  }
1540
1606
  function j(v) {
1541
1607
  if (r && r !== "left" || de(v.target) || v.button !== 0) return;
1542
- const y = b.getIsOpen(), O = v.clientX <= e.edgeActivationWidthPx;
1543
- y && !e.swipeToClose || !y && !e.swipeToOpen || (y || O) && Se({
1608
+ const x = h.getIsOpen(), E = v.clientX <= e.edgeActivationWidthPx;
1609
+ x && !e.swipeToClose || !x && !e.swipeToOpen || (x || E) && pe({
1544
1610
  refs: S,
1545
1611
  clientX: v.clientX,
1546
1612
  clientY: v.clientY,
@@ -1548,77 +1614,91 @@ function lr(e) {
1548
1614
  isMouse: !0
1549
1615
  });
1550
1616
  }
1551
- function $(v) {
1552
- r && r !== "left" || !u.current || !u.current.isMouse || ze({
1617
+ function B(v) {
1618
+ r && r !== "left" || !s.current || !s.current.isMouse || qe({
1553
1619
  refs: S,
1554
- callbacks: b,
1620
+ callbacks: h,
1555
1621
  currentX: v.clientX,
1556
1622
  preventDefault: () => v.preventDefault(),
1557
- lockPane: I,
1623
+ lockPane: C,
1558
1624
  options: e
1559
1625
  });
1560
1626
  }
1561
1627
  function k() {
1562
- r && r !== "left" || !u.current || !u.current.isMouse || Ve({
1628
+ r && r !== "left" || !s.current || !s.current.isMouse || Ve({
1563
1629
  refs: S,
1564
- callbacks: b,
1630
+ callbacks: h,
1565
1631
  options: e
1566
1632
  });
1567
1633
  }
1568
- return window.addEventListener("touchstart", M, { passive: !0 }), window.addEventListener("touchmove", _, { passive: !1 }), window.addEventListener("touchend", C, { passive: !0 }), window.addEventListener("touchcancel", Y, { passive: !0 }), window.addEventListener("mousedown", j, { passive: !0 }), window.addEventListener("mousemove", $, { passive: !1 }), window.addEventListener("mouseup", k, { passive: !0 }), () => {
1569
- window.removeEventListener("touchstart", M), window.removeEventListener("touchmove", _), window.removeEventListener("touchend", C), window.removeEventListener("touchcancel", Y), window.removeEventListener("mousedown", j), window.removeEventListener("mousemove", $), window.removeEventListener("mouseup", k);
1634
+ return window.addEventListener("touchstart", P, { passive: !0 }), window.addEventListener("touchmove", L, { passive: !1 }), window.addEventListener("touchend", I, { passive: !0 }), window.addEventListener("touchcancel", $, { passive: !0 }), window.addEventListener("mousedown", j, { passive: !0 }), window.addEventListener("mousemove", B, { passive: !1 }), window.addEventListener("mouseup", k, { passive: !0 }), () => {
1635
+ window.removeEventListener("touchstart", P), window.removeEventListener("touchmove", L), window.removeEventListener("touchend", I), window.removeEventListener("touchcancel", $), window.removeEventListener("mousedown", j), window.removeEventListener("mousemove", B), window.removeEventListener("mouseup", k);
1570
1636
  };
1571
1637
  }, [
1572
1638
  t,
1573
- s,
1639
+ c,
1574
1640
  o,
1641
+ u,
1575
1642
  f,
1576
- c,
1577
1643
  r,
1578
1644
  i,
1579
- d,
1645
+ l,
1580
1646
  e
1581
1647
  ]);
1582
1648
  }
1583
- function vr({
1649
+ function pr({
1584
1650
  className: e,
1585
1651
  children: t,
1586
1652
  ToggleComponent: r,
1587
- ...i
1653
+ ariaLabel: i,
1654
+ ...c
1588
1655
  }) {
1589
- if ((t == null ? void 0 : t.type) === E.Fragment)
1656
+ if ((t == null ? void 0 : t.type) === O.Fragment)
1590
1657
  throw new Error("Fragments is not allowed in SwipeBarLeft");
1591
- const { isLeftOpen: s, closeSidebar: o, leftSidebarRef: f } = ee(), c = Me("left", i), d = fe(c.mediaQueryWidth);
1592
- return lr(c), /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
1593
- c.showOverlay && /* @__PURE__ */ E.jsx(
1594
- Ie,
1658
+ const { isLeftOpen: o, closeSidebar: u, leftSidebarRef: f, leftToggleRef: l } = ee(), s = Me("left", c), w = fe(s.mediaQueryWidth);
1659
+ fr(s);
1660
+ const y = Y(() => u("left"), [u]);
1661
+ return _e({
1662
+ sidebarRef: f,
1663
+ triggerRef: l,
1664
+ isOpen: o,
1665
+ onClose: y,
1666
+ transitionMs: s.transitionMs
1667
+ }), /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
1668
+ s.showOverlay && /* @__PURE__ */ O.jsx(
1669
+ Ce,
1595
1670
  {
1596
- isCollapsed: !s,
1597
- setCollapsed: () => o("left"),
1598
- closeSidebarOnClick: c.closeSidebarOnOverlayClick,
1599
- transitionMs: c.transitionMs,
1600
- overlayBackgroundColor: c.overlayBackgroundColor,
1601
- overlayZIndex: c.overlayZIndex
1671
+ isCollapsed: !o,
1672
+ setCollapsed: () => u("left"),
1673
+ closeSidebarOnClick: s.closeSidebarOnOverlayClick,
1674
+ transitionMs: s.transitionMs,
1675
+ overlayBackgroundColor: s.overlayBackgroundColor,
1676
+ overlayZIndex: s.overlayZIndex
1602
1677
  }
1603
1678
  ),
1604
- /* @__PURE__ */ E.jsx(
1605
- cr,
1679
+ /* @__PURE__ */ O.jsx(
1680
+ dr,
1606
1681
  {
1607
- options: c,
1608
- showToggle: c.showToggle,
1682
+ options: s,
1683
+ showToggle: s.showToggle,
1609
1684
  ToggleComponent: r
1610
1685
  }
1611
1686
  ),
1612
- /* @__PURE__ */ E.jsx(
1687
+ /* @__PURE__ */ O.jsx(
1613
1688
  "div",
1614
1689
  {
1615
1690
  ref: f,
1691
+ id: "swipebar-left",
1692
+ role: "dialog",
1693
+ "aria-modal": o,
1694
+ "aria-label": i ?? "Left sidebar",
1695
+ inert: !o,
1616
1696
  style: {
1617
- ...tt,
1618
- ...Zt,
1619
- ...c.isAbsolute || d ? Vt : {},
1620
- ...e ? {} : { backgroundColor: Oe },
1621
- zIndex: c.swipeBarZIndex
1697
+ ...rt,
1698
+ ...zt,
1699
+ ...s.isAbsolute || w ? Vt : {},
1700
+ ...e ? {} : { backgroundColor: Ee },
1701
+ zIndex: s.swipeBarZIndex
1622
1702
  },
1623
1703
  className: e,
1624
1704
  children: t
@@ -1626,26 +1706,29 @@ function vr({
1626
1706
  )
1627
1707
  ] });
1628
1708
  }
1629
- function ur({ options: e, showToggle: t = !0, ToggleComponent: r }) {
1630
- const { openSidebar: i, rightToggleRef: s, isRightOpen: o, closeSidebar: f } = ee();
1709
+ function gr({ options: e, showToggle: t = !0, ToggleComponent: r }) {
1710
+ const { openSidebar: i, rightToggleRef: c, isRightOpen: o, closeSidebar: u } = ee();
1631
1711
  return t ? (
1632
1712
  // 1px wide container
1633
- /* @__PURE__ */ E.jsx(
1713
+ /* @__PURE__ */ O.jsx(
1634
1714
  "div",
1635
1715
  {
1636
- ref: s,
1716
+ ref: c,
1637
1717
  style: {
1638
- ...rt,
1718
+ ...nt,
1639
1719
  transition: `transform ${e.transitionMs}ms ease, opacity ${e.transitionMs}ms ease`,
1640
1720
  right: 0,
1641
1721
  zIndex: e.toggleZIndex
1642
1722
  },
1643
- children: (!o || o && !e.showOverlay) && /* @__PURE__ */ E.jsx(
1723
+ children: (!o || o && !e.showOverlay) && /* @__PURE__ */ O.jsx(
1644
1724
  "button",
1645
1725
  {
1646
1726
  type: "button",
1727
+ "aria-expanded": o,
1728
+ "aria-controls": "swipebar-right",
1729
+ "aria-label": o ? "Close right sidebar" : "Open right sidebar",
1647
1730
  onClick: () => {
1648
- e.disabled || (o ? f("right") : i("right"));
1731
+ e.disabled || (o ? u("right") : i("right"));
1649
1732
  },
1650
1733
  disabled: e.disabled,
1651
1734
  style: {
@@ -1653,125 +1736,125 @@ function ur({ options: e, showToggle: t = !0, ToggleComponent: r }) {
1653
1736
  // reverse because we are using the same icon for both left and right
1654
1737
  ...o ? {} : { transform: "rotate(180deg)" }
1655
1738
  },
1656
- children: r ?? /* @__PURE__ */ E.jsx(Ce, { size: e.toggleIconSizePx, color: e.toggleIconColor })
1739
+ children: r ?? /* @__PURE__ */ O.jsx(Ie, { size: e.toggleIconSizePx, color: e.toggleIconColor })
1657
1740
  }
1658
1741
  )
1659
1742
  }
1660
1743
  )
1661
1744
  ) : null;
1662
1745
  }
1663
- const qe = ({
1746
+ const Qe = ({
1664
1747
  refs: e,
1665
1748
  callbacks: t,
1666
1749
  currentX: r,
1667
1750
  preventDefault: i,
1668
- lockPane: s,
1751
+ lockPane: c,
1669
1752
  options: o
1670
1753
  }) => {
1671
1754
  if (!e.draggingRef.current) return;
1672
- const f = window.innerWidth, c = r - e.draggingRef.current.startX, d = e.draggingRef.current.startX >= f - o.edgeActivationWidthPx, u = e.draggingRef.current.isActivated;
1673
- if (!u && Math.abs(c) >= o.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, s()), !u) return;
1755
+ const u = window.innerWidth, f = r - e.draggingRef.current.startX, l = e.draggingRef.current.startX >= u - o.edgeActivationWidthPx, s = e.draggingRef.current.isActivated;
1756
+ if (!s && Math.abs(f) >= o.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, c()), !s) return;
1674
1757
  e.prevXRef.current = e.currentXRef.current, e.currentXRef.current = r;
1675
- const T = t.getIsOpen();
1676
- let w = !1;
1677
- if ((T || d) && (w = !0), !w) {
1758
+ const w = t.getIsOpen();
1759
+ let y = !1;
1760
+ if ((w || l) && (y = !0), !y) {
1678
1761
  e.draggingRef.current = null, t.dragSidebar(null);
1679
1762
  return;
1680
1763
  }
1681
1764
  i();
1682
- const b = o.sidebarWidthPx;
1683
- if (T) {
1765
+ const h = o.sidebarWidthPx;
1766
+ if (w) {
1684
1767
  const S = Math.max(
1685
1768
  0,
1686
- Math.min(b, c - o.dragActivationDeltaPx)
1769
+ Math.min(h, f - o.dragActivationDeltaPx)
1687
1770
  );
1688
1771
  t.dragSidebar(S);
1689
1772
  } else {
1690
1773
  const S = Math.max(
1691
1774
  0,
1692
1775
  Math.min(
1693
- b,
1694
- b + c + o.dragActivationDeltaPx
1776
+ h,
1777
+ h + f + o.dragActivationDeltaPx
1695
1778
  )
1696
1779
  );
1697
1780
  t.dragSidebar(S);
1698
1781
  }
1699
- }, Qe = ({ refs: e, callbacks: t, options: r }) => {
1782
+ }, Je = ({ refs: e, callbacks: t, options: r }) => {
1700
1783
  if (!e.draggingRef.current) return;
1701
1784
  if (!e.draggingRef.current.isActivated) {
1702
1785
  e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
1703
1786
  return;
1704
1787
  }
1705
- const i = e.currentXRef.current ?? e.draggingRef.current.startX, s = e.prevXRef.current ?? e.draggingRef.current.startX, o = e.draggingRef.current.startX, f = t.getIsOpen(), c = window.innerWidth;
1788
+ const i = e.currentXRef.current ?? e.draggingRef.current.startX, c = e.prevXRef.current ?? e.draggingRef.current.startX, o = e.draggingRef.current.startX, u = t.getIsOpen(), f = window.innerWidth;
1706
1789
  e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
1707
- const d = i > s, u = i < s, T = o >= c - r.edgeActivationWidthPx;
1708
- f ? (d ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : T && u ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
1790
+ const l = i > c, s = i < c, w = o >= f - r.edgeActivationWidthPx;
1791
+ u ? (l ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : w && s ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
1709
1792
  };
1710
- function dr(e) {
1793
+ function hr(e) {
1711
1794
  const t = fe(e.mediaQueryWidth), {
1712
1795
  lockedSidebar: r,
1713
1796
  setLockedSidebar: i,
1714
- isRightOpen: s,
1797
+ isRightOpen: c,
1715
1798
  openSidebar: o,
1716
- closeSidebar: f,
1717
- dragSidebar: c,
1718
- rightSidebarRef: d
1719
- } = ee(), u = L(null), T = L(null), w = L(null);
1720
- z(() => {
1799
+ closeSidebar: u,
1800
+ dragSidebar: f,
1801
+ rightSidebarRef: l
1802
+ } = ee(), s = _(null), w = _(null), y = _(null);
1803
+ G(() => {
1721
1804
  if (!t || r && r !== "right" || e.disabled) return;
1722
- const b = {
1723
- getIsOpen: () => s,
1805
+ const h = {
1806
+ getIsOpen: () => c,
1724
1807
  openSidebar: () => o("right"),
1725
- closeSidebar: () => f("right"),
1726
- dragSidebar: (v) => c("right", v)
1808
+ closeSidebar: () => u("right"),
1809
+ dragSidebar: (v) => f("right", v)
1727
1810
  }, S = {
1728
- draggingRef: u,
1729
- currentXRef: T,
1730
- prevXRef: w
1731
- }, I = () => i("right"), p = () => i(null);
1732
- function M(v) {
1811
+ draggingRef: s,
1812
+ currentXRef: w,
1813
+ prevXRef: y
1814
+ }, C = () => i("right"), p = () => i(null);
1815
+ function P(v) {
1733
1816
  if (r && r !== "right" || de(v.target) || v.changedTouches.length === 0) return;
1734
- const y = v.changedTouches[0], O = window.innerWidth, P = b.getIsOpen(), V = y.clientX >= O - e.edgeActivationWidthPx;
1735
- P && !e.swipeToClose || !P && !e.swipeToOpen || (P || V) && Se({
1817
+ const x = v.changedTouches[0], E = window.innerWidth, M = h.getIsOpen(), q = x.clientX >= E - e.edgeActivationWidthPx;
1818
+ M && !e.swipeToClose || !M && !e.swipeToOpen || (M || q) && pe({
1736
1819
  refs: S,
1737
- clientX: y.clientX,
1738
- clientY: y.clientY,
1739
- touchId: y.identifier,
1820
+ clientX: x.clientX,
1821
+ clientY: x.clientY,
1822
+ touchId: x.identifier,
1740
1823
  isMouse: !1
1741
1824
  });
1742
1825
  }
1743
- function _(v) {
1744
- if (r && r !== "right" || !u.current || u.current.isMouse) return;
1745
- const y = u.current.activeTouchId, O = Ae(v.changedTouches, y);
1746
- O && qe({
1826
+ function L(v) {
1827
+ if (r && r !== "right" || !s.current || s.current.isMouse) return;
1828
+ const x = s.current.activeTouchId, E = Ae(v.changedTouches, x);
1829
+ E && Qe({
1747
1830
  refs: S,
1748
- callbacks: b,
1749
- currentX: O.clientX,
1831
+ callbacks: h,
1832
+ currentX: E.clientX,
1750
1833
  preventDefault: () => v.preventDefault(),
1751
- lockPane: I,
1834
+ lockPane: C,
1752
1835
  options: e
1753
1836
  });
1754
1837
  }
1755
- function C(v) {
1756
- if (r && r !== "right" || !u.current || u.current.isMouse) return;
1757
- const y = u.current.activeTouchId;
1758
- Pe(v.changedTouches, y) && Qe({
1838
+ function I(v) {
1839
+ if (r && r !== "right" || !s.current || s.current.isMouse) return;
1840
+ const x = s.current.activeTouchId;
1841
+ Pe(v.changedTouches, x) && Je({
1759
1842
  refs: S,
1760
- callbacks: b,
1843
+ callbacks: h,
1761
1844
  options: e
1762
1845
  });
1763
1846
  }
1764
- function Y() {
1765
- r && r !== "right" || !u.current || u.current.isMouse || nt({
1847
+ function $() {
1848
+ r && r !== "right" || !s.current || s.current.isMouse || it({
1766
1849
  refs: S,
1767
- dragSidebar: b.dragSidebar,
1850
+ dragSidebar: h.dragSidebar,
1768
1851
  onDeactivate: p
1769
1852
  });
1770
1853
  }
1771
1854
  function j(v) {
1772
1855
  if (r && r !== "right" || de(v.target) || v.button !== 0) return;
1773
- const y = window.innerWidth, O = b.getIsOpen(), P = v.clientX >= y - e.edgeActivationWidthPx;
1774
- O && !e.swipeToClose || !O && !e.swipeToOpen || (O || P) && Se({
1856
+ const x = window.innerWidth, E = h.getIsOpen(), M = v.clientX >= x - e.edgeActivationWidthPx;
1857
+ E && !e.swipeToClose || !E && !e.swipeToOpen || (E || M) && pe({
1775
1858
  refs: S,
1776
1859
  clientX: v.clientX,
1777
1860
  clientY: v.clientY,
@@ -1779,77 +1862,91 @@ function dr(e) {
1779
1862
  isMouse: !0
1780
1863
  });
1781
1864
  }
1782
- function $(v) {
1783
- r && r !== "right" || !u.current || !u.current.isMouse || qe({
1865
+ function B(v) {
1866
+ r && r !== "right" || !s.current || !s.current.isMouse || Qe({
1784
1867
  refs: S,
1785
- callbacks: b,
1868
+ callbacks: h,
1786
1869
  currentX: v.clientX,
1787
1870
  preventDefault: () => v.preventDefault(),
1788
- lockPane: I,
1871
+ lockPane: C,
1789
1872
  options: e
1790
1873
  });
1791
1874
  }
1792
1875
  function k() {
1793
- r && r !== "right" || !u.current || !u.current.isMouse || Qe({
1876
+ r && r !== "right" || !s.current || !s.current.isMouse || Je({
1794
1877
  refs: S,
1795
- callbacks: b,
1878
+ callbacks: h,
1796
1879
  options: e
1797
1880
  });
1798
1881
  }
1799
- return window.addEventListener("touchstart", M, { passive: !0 }), window.addEventListener("touchmove", _, { passive: !1 }), window.addEventListener("touchend", C, { passive: !0 }), window.addEventListener("touchcancel", Y, { passive: !0 }), window.addEventListener("mousedown", j, { passive: !0 }), window.addEventListener("mousemove", $, { passive: !1 }), window.addEventListener("mouseup", k, { passive: !0 }), () => {
1800
- window.removeEventListener("touchstart", M), window.removeEventListener("touchmove", _), window.removeEventListener("touchend", C), window.removeEventListener("touchcancel", Y), window.removeEventListener("mousedown", j), window.removeEventListener("mousemove", $), window.removeEventListener("mouseup", k);
1882
+ return window.addEventListener("touchstart", P, { passive: !0 }), window.addEventListener("touchmove", L, { passive: !1 }), window.addEventListener("touchend", I, { passive: !0 }), window.addEventListener("touchcancel", $, { passive: !0 }), window.addEventListener("mousedown", j, { passive: !0 }), window.addEventListener("mousemove", B, { passive: !1 }), window.addEventListener("mouseup", k, { passive: !0 }), () => {
1883
+ window.removeEventListener("touchstart", P), window.removeEventListener("touchmove", L), window.removeEventListener("touchend", I), window.removeEventListener("touchcancel", $), window.removeEventListener("mousedown", j), window.removeEventListener("mousemove", B), window.removeEventListener("mouseup", k);
1801
1884
  };
1802
1885
  }, [
1803
1886
  t,
1804
- s,
1887
+ c,
1805
1888
  o,
1889
+ u,
1806
1890
  f,
1807
- c,
1808
1891
  r,
1809
1892
  i,
1810
- d,
1893
+ l,
1811
1894
  e
1812
1895
  ]);
1813
1896
  }
1814
- function br({
1897
+ function Sr({
1815
1898
  className: e,
1816
1899
  children: t,
1817
1900
  ToggleComponent: r,
1818
- ...i
1901
+ ariaLabel: i,
1902
+ ...c
1819
1903
  }) {
1820
- if ((t == null ? void 0 : t.type) === E.Fragment)
1904
+ if ((t == null ? void 0 : t.type) === O.Fragment)
1821
1905
  throw new Error("Fragments is not allowed in SwipeBarRight");
1822
- const { isRightOpen: s, closeSidebar: o, rightSidebarRef: f } = ee(), c = Me("right", i), d = fe(c.mediaQueryWidth);
1823
- return dr(c), /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
1824
- c.showOverlay && /* @__PURE__ */ E.jsx(
1825
- Ie,
1906
+ const { isRightOpen: o, closeSidebar: u, rightSidebarRef: f, rightToggleRef: l } = ee(), s = Me("right", c), w = fe(s.mediaQueryWidth);
1907
+ hr(s);
1908
+ const y = Y(() => u("right"), [u]);
1909
+ return _e({
1910
+ sidebarRef: f,
1911
+ triggerRef: l,
1912
+ isOpen: o,
1913
+ onClose: y,
1914
+ transitionMs: s.transitionMs
1915
+ }), /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
1916
+ s.showOverlay && /* @__PURE__ */ O.jsx(
1917
+ Ce,
1826
1918
  {
1827
- isCollapsed: !s,
1828
- setCollapsed: () => o("right"),
1829
- closeSidebarOnClick: c.closeSidebarOnOverlayClick,
1830
- transitionMs: c.transitionMs,
1831
- overlayBackgroundColor: c.overlayBackgroundColor,
1832
- overlayZIndex: c.overlayZIndex
1919
+ isCollapsed: !o,
1920
+ setCollapsed: () => u("right"),
1921
+ closeSidebarOnClick: s.closeSidebarOnOverlayClick,
1922
+ transitionMs: s.transitionMs,
1923
+ overlayBackgroundColor: s.overlayBackgroundColor,
1924
+ overlayZIndex: s.overlayZIndex
1833
1925
  }
1834
1926
  ),
1835
- /* @__PURE__ */ E.jsx(
1836
- ur,
1927
+ /* @__PURE__ */ O.jsx(
1928
+ gr,
1837
1929
  {
1838
- options: c,
1839
- showToggle: c.showToggle,
1930
+ options: s,
1931
+ showToggle: s.showToggle,
1840
1932
  ToggleComponent: r
1841
1933
  }
1842
1934
  ),
1843
- /* @__PURE__ */ E.jsx(
1935
+ /* @__PURE__ */ O.jsx(
1844
1936
  "div",
1845
1937
  {
1846
1938
  ref: f,
1939
+ id: "swipebar-right",
1940
+ role: "dialog",
1941
+ "aria-modal": o,
1942
+ "aria-label": i ?? "Right sidebar",
1943
+ inert: !o,
1847
1944
  style: {
1848
- ...tt,
1849
- ...zt,
1850
- ...c.isAbsolute || d ? qt : {},
1851
- ...e ? {} : { backgroundColor: Oe },
1852
- zIndex: c.swipeBarZIndex
1945
+ ...rt,
1946
+ ...qt,
1947
+ ...s.isAbsolute || w ? Qt : {},
1948
+ ...e ? {} : { backgroundColor: Ee },
1949
+ zIndex: s.swipeBarZIndex
1853
1950
  },
1854
1951
  className: e,
1855
1952
  children: t
@@ -1858,14 +1955,14 @@ function br({
1858
1955
  ] });
1859
1956
  }
1860
1957
  export {
1861
- Ie as Overlay,
1862
- mr as SwipeBarBottom,
1863
- vr as SwipeBarLeft,
1864
- hr as SwipeBarProvider,
1865
- br as SwipeBarRight,
1866
- ar as ToggleBottom,
1867
- cr as ToggleLeft,
1868
- ur as ToggleRight,
1958
+ Ce as Overlay,
1959
+ wr as SwipeBarBottom,
1960
+ pr as SwipeBarLeft,
1961
+ vr as SwipeBarProvider,
1962
+ Sr as SwipeBarRight,
1963
+ sr as ToggleBottom,
1964
+ dr as ToggleLeft,
1965
+ gr as ToggleRight,
1869
1966
  fe as useMediaQuery,
1870
1967
  ee as useSwipeBarContext
1871
1968
  };