etudes 23.3.0 → 23.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/etudes.js CHANGED
@@ -1,4 +1,4 @@
1
- import Bs, { Fragment as Do, cloneElement as Hs, Children as An, isValidElement as Mn, forwardRef as Te, useRef as we, useEffect as Ee, useLayoutEffect as Ae, useState as Oe, useCallback as he, useMemo as gt, Suspense as Ys } from "react";
1
+ import Bs, { Fragment as Do, cloneElement as Hs, Children as An, isValidElement as Mn, forwardRef as Te, useRef as xe, useEffect as Ee, useLayoutEffect as Ae, useState as Oe, useCallback as he, useMemo as gt, Suspense as Ys } from "react";
2
2
  function Bo(e) {
3
3
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
4
  }
@@ -599,7 +599,7 @@ function Ws(e, r) {
599
599
  if (i && !a) {
600
600
  const c = r instanceof Array ? r : [r], u = c.length;
601
601
  for (let d = 0; d < u; d++) {
602
- const g = be.from(c[d]);
602
+ const g = we.from(c[d]);
603
603
  if (!g) continue;
604
604
  const m = i.x >= g.left && i.x <= g.right, b = i.y >= g.top && i.y <= g.bottom;
605
605
  if (m && b) return !0;
@@ -608,7 +608,7 @@ function Ws(e, r) {
608
608
  } else if (!i && a) {
609
609
  const c = e instanceof Array ? e : [e], u = c.length;
610
610
  for (let d = 0; d < u; d++) {
611
- const g = be.from(c[d]);
611
+ const g = we.from(c[d]);
612
612
  if (!g) continue;
613
613
  const m = a.x >= g.left && a.x <= g.right, b = a.y >= g.top && a.y <= g.bottom;
614
614
  if (m && b) return !0;
@@ -621,7 +621,7 @@ function Ws(e, r) {
621
621
  const c = [
622
622
  ...e instanceof Array ? e : [e],
623
623
  ...r instanceof Array ? r : [r]
624
- ], u = be.intersecting.apply(null, c);
624
+ ], u = we.intersecting.apply(null, c);
625
625
  return u ? u.width * u.height !== 0 : !1;
626
626
  }
627
627
  }
@@ -719,7 +719,7 @@ var Ce;
719
719
  }
720
720
  e.isZero = A;
721
721
  })(Ce || (Ce = {}));
722
- var be;
722
+ var we;
723
723
  ((e) => {
724
724
  e.zero = r();
725
725
  function r(w = 0, P = 0, E = 0, M = 0) {
@@ -773,11 +773,11 @@ var be;
773
773
  e.size = a;
774
774
  function c(w, P = {}) {
775
775
  try {
776
- if (w == null) return;
776
+ if (w == null) return e.zero;
777
777
  if (U(w)) return w;
778
778
  if (Ot(w)) return c(document.documentElement || document.body.parentNode || document.body, P);
779
779
  const E = w instanceof Array ? w : [w], M = E.length, H = P.reference || window, q = u(), re = Ot(H) ? q : c(P.reference);
780
- if (!q || !re) return;
780
+ if (!q || !re) return e.zero;
781
781
  let Q;
782
782
  for (let F = 0; F < M; F++) {
783
783
  const z = E[F], B = z.getBoundingClientRect(), ne = r({
@@ -788,10 +788,9 @@ var be;
788
788
  });
789
789
  Q = Q ? I(Q, ne) : ne;
790
790
  }
791
- return Q;
791
+ return Q ?? e.zero;
792
792
  } catch (E) {
793
- console.error(E);
794
- return;
793
+ return console.error(E), e.zero;
795
794
  }
796
795
  }
797
796
  e.from = c;
@@ -801,27 +800,26 @@ var be;
801
800
  }
802
801
  e.fromViewport = u;
803
802
  function d(w, P = {}) {
804
- if (w)
805
- return Ot(w) ? c(Array.from(document.body.children)) : c(Array.from(w.children), {
806
- overflow: P.overflow,
807
- reference: P.reference || w
808
- });
803
+ return w ? Ot(w) ? c(Array.from(document.body.children)) : c(Array.from(w.children), {
804
+ overflow: P.overflow,
805
+ reference: P.reference || w
806
+ }) : e.zero;
809
807
  }
810
808
  e.fromChildrenOf = d;
811
809
  function g(w, P, E = {}) {
812
- if (!P) return;
810
+ if (!P) return e.zero;
813
811
  const M = Array.from(P.children);
814
812
  return w <= 0 ? r() : w >= M.length ? c(M, { reference: E.reference, overflow: !1 }) : (M.splice(w), c(M, { reference: E.reference || P, overflow: !1 }));
815
813
  }
816
814
  e.fromChildrenBefore = g;
817
815
  function m(w, P, E = {}) {
818
- if (!P) return;
816
+ if (!P) return e.zero;
819
817
  const M = Array.from(P.children);
820
818
  return w < 0 ? c(M, { reference: E.reference, overflow: !1 }) : w >= M.length - 1 ? r() : (M.splice(0, M.length - w - 1), c(M, { reference: E.reference || P, overflow: !1 }));
821
819
  }
822
820
  e.fromChildrenAfter = m;
823
821
  function b(w, P, E = {}) {
824
- if (!P) return;
822
+ if (!P) return e.zero;
825
823
  const M = P.children[w];
826
824
  return c(M, {
827
825
  overflow: E.overflow,
@@ -844,8 +842,7 @@ var be;
844
842
  }
845
843
  return r(E);
846
844
  } catch (P) {
847
- console.error(P);
848
- return;
845
+ return console.error(P), e.zero;
849
846
  }
850
847
  }
851
848
  e.intersecting = T;
@@ -911,12 +908,12 @@ var be;
911
908
  return w.top === 0 && w.right === 0 && w.bottom === 0 && w.left === 0 && w.width === 0 && w.height === 0;
912
909
  }
913
910
  e.isZero = Y;
914
- })(be || (be = {}));
911
+ })(we || (we = {}));
915
912
  function Ot(e) {
916
913
  return e === window;
917
914
  }
918
915
  function Se(e) {
919
- const r = we(e);
916
+ const r = xe(e);
920
917
  return Ee(() => {
921
918
  r.current = e;
922
919
  }, [e]), r;
@@ -924,7 +921,7 @@ function Se(e) {
924
921
  function Js(e, { onChange: r }) {
925
922
  const i = Se(r);
926
923
  Ae(() => {
927
- const a = e.current;
924
+ const a = e?.current;
928
925
  if (!a) return;
929
926
  const c = new IntersectionObserver((u) => {
930
927
  for (const d of u)
@@ -936,12 +933,12 @@ function Js(e, { onChange: r }) {
936
933
  return c.observe(a), () => {
937
934
  c.disconnect();
938
935
  };
939
- }, [e.current]);
936
+ }, [e?.current]);
940
937
  }
941
938
  function vr(e, { onResize: r }) {
942
939
  const i = Se(r);
943
940
  Ae(() => {
944
- const a = e.current;
941
+ const a = e?.current;
945
942
  if (!a) return;
946
943
  const c = new ResizeObserver(() => {
947
944
  i.current?.(a);
@@ -949,13 +946,13 @@ function vr(e, { onResize: r }) {
949
946
  return c.observe(a), () => {
950
947
  c.disconnect();
951
948
  };
952
- }, [e.current]);
949
+ }, [e?.current]);
953
950
  }
954
951
  function Zs() {
955
952
  const [e, r] = Oe(Ce.zero);
956
953
  return Ae(() => {
957
954
  const i = () => {
958
- const a = be.size(be.fromViewport());
955
+ const a = we.size(we.fromViewport());
959
956
  r(a);
960
957
  };
961
958
  return window.addEventListener("resize", i), i(), () => {
@@ -964,20 +961,20 @@ function Zs() {
964
961
  }, []), e;
965
962
  }
966
963
  function et(e) {
967
- const [r, i] = Oe(be.zero), a = Zs();
964
+ const [r, i] = Oe(we.zero), a = Zs();
968
965
  return vr(e, {
969
966
  onResize: (c) => {
970
- const u = be.from(c);
971
- u && i(u);
967
+ const u = we.from(c);
968
+ i(u);
972
969
  }
973
970
  }), Js(e, {
974
971
  onChange: (c) => {
975
- const u = be.from(c);
976
- u && i(u);
972
+ const u = we.from(c);
973
+ i(u);
977
974
  }
978
975
  }), Ae(() => {
979
- const c = e.current, u = be.from(c);
980
- u && i(u);
976
+ const c = e?.current, u = we.from(c);
977
+ i(u);
981
978
  }, [Ce.toString(a)]), r;
982
979
  }
983
980
  var sn;
@@ -1028,7 +1025,7 @@ var sn;
1028
1025
  }
1029
1026
  })(sn || (sn = {}));
1030
1027
  function Qs({ src: e, srcSet: r, sizes: i }, { onLoadStart: a, onLoadComplete: c, onLoadError: u } = {}) {
1031
- const d = we(void 0), g = Se(a), m = Se(c), b = Se(u);
1028
+ const d = xe(void 0), g = Se(a), m = Se(c), b = Se(u);
1032
1029
  Ae(() => {
1033
1030
  let T = !1;
1034
1031
  const _ = (A) => {
@@ -1149,7 +1146,7 @@ const Jo = /* @__PURE__ */ Te(({
1149
1146
  }, _) => {
1150
1147
  const I = (P) => {
1151
1148
  C(P ? P.width / P.height : NaN);
1152
- }, j = we(null), A = _ ?? j, [S, C] = Oe(NaN), G = isNaN(i) ? S : i, J = et(A), U = J.width / J.height, Y = Ce.make(
1149
+ }, j = xe(null), A = _ ?? j, [S, C] = Oe(NaN), G = isNaN(i) ? S : i, J = et(A), U = J.width / J.height, Y = Ce.make(
1153
1150
  U > 1 ? Math.max(J.width, J.height * G) : Math.max(J.width, Math.max(J.height, J.width / G) * G),
1154
1151
  U > 1 ? Math.max(J.height, Math.max(J.width, J.height * G) / G) : Math.max(J.height, J.width / G)
1155
1152
  ), w = Le(e, {
@@ -1273,7 +1270,7 @@ const Zo = /* @__PURE__ */ Te(({
1273
1270
  onTimeUpdate: C,
1274
1271
  ...G
1275
1272
  }, J) => {
1276
- const U = we(null), Y = J ?? U, w = na(d, {
1273
+ const U = xe(null), Y = J ?? U, w = na(d, {
1277
1274
  onLoadStart: T,
1278
1275
  onLoadComplete: _,
1279
1276
  onLoadError: I
@@ -1360,7 +1357,7 @@ const Qo = /* @__PURE__ */ Te(({
1360
1357
  }, w) => {
1361
1358
  const P = (B) => {
1362
1359
  q(B ? B.width / B.height : NaN), U?.(B);
1363
- }, E = w ?? we(null), M = et(E), [H, q] = Oe(NaN), re = isNaN(a) ? H : a, Q = M.width / M.height, F = Ce.make(
1360
+ }, E = w ?? xe(null), M = et(E), [H, q] = Oe(NaN), re = isNaN(a) ? H : a, Q = M.width / M.height, F = Ce.make(
1364
1361
  Q > 1 ? Math.max(M.width, M.height * re) : Math.max(M.width, Math.max(M.height, M.width / re) * re),
1365
1362
  Q > 1 ? Math.max(M.height, Math.max(M.width, M.height * re) / re) : Math.max(M.height, M.width / re)
1366
1363
  ), z = Le(r, {
@@ -1997,9 +1994,9 @@ function ua() {
1997
1994
  p.push(V ? O : null);
1998
1995
  }
1999
1996
  var L = (function(X) {
2000
- for (var oe, te, le, ve = [], xe = 0; xe < X.length; xe++) {
2001
- var de = X[xe], ye = X[oe];
2002
- if (de && xe !== oe) if (ye) {
1997
+ for (var oe, te, le, ve = [], be = 0; be < X.length; be++) {
1998
+ var de = X[be], ye = X[oe];
1999
+ if (de && be !== oe) if (ye) {
2003
2000
  var Re = k(de), Pe = k(ye);
2004
2001
  if (Re !== de.ownerDocument) if (Pe !== de.ownerDocument) if (Re !== Pe) {
2005
2002
  ve = ve.length ? ve : K(ye);
@@ -2012,15 +2009,15 @@ function ua() {
2012
2009
  var Jt = [De[Ue - 1], De[Ue], ve[Ue]];
2013
2010
  if (Jt[0]) for (var St = Jt[0].lastChild; St; ) {
2014
2011
  if (St === Jt[1]) {
2015
- oe = xe, ve = De;
2012
+ oe = be, ve = De;
2016
2013
  break;
2017
2014
  }
2018
2015
  if (St === Jt[2]) break;
2019
2016
  St = St.previousSibling;
2020
2017
  }
2021
- } else le = ye, (parseInt(Y(te = de).getComputedStyle(te).zIndex, 10) || 0) >= (parseInt(Y(le).getComputedStyle(le).zIndex, 10) || 0) && (oe = xe);
2022
- else oe = xe;
2023
- } else oe = xe;
2018
+ } else le = ye, (parseInt(Y(te = de).getComputedStyle(te).zIndex, 10) || 0) >= (parseInt(Y(le).getComputedStyle(le).zIndex, 10) || 0) && (oe = be);
2019
+ else oe = be;
2020
+ } else oe = be;
2024
2021
  }
2025
2022
  return oe;
2026
2023
  })(p);
@@ -2064,8 +2061,8 @@ function ua() {
2064
2061
  if (!(te = te || O.getRect(oe))) return !!O.options.drop.checker && O.options.drop.checker($, V, le, O, oe, L, X);
2065
2062
  var ve = O.options.drop.overlap;
2066
2063
  if (ve === "pointer") {
2067
- var xe = nt(L, X, "drag"), de = jr($);
2068
- de.x += xe.x, de.y += xe.y;
2064
+ var be = nt(L, X, "drag"), de = jr($);
2065
+ de.x += be.x, de.y += be.y;
2069
2066
  var ye = de.x > te.left && de.x < te.right, Re = de.y > te.top && de.y < te.bottom;
2070
2067
  le = ye && Re;
2071
2068
  }
@@ -3000,8 +2997,8 @@ function ua() {
3000
2997
  p(te, $, v), p(te, $, N, !0);
3001
2998
  }
3002
2999
  }
3003
- var le = s[$], ve = yt(le, (function(xe) {
3004
- return xe.selector === y && xe.context === O;
3000
+ var le = s[$], ve = yt(le, (function(be) {
3001
+ return be.selector === y && be.context === O;
3005
3002
  }));
3006
3003
  ve || (ve = { selector: y, context: O, listeners: [] }, le.push(ve)), ve.listeners.push({ func: V, options: X });
3007
3004
  }, removeDelegate: function(y, O, $, V, L) {
@@ -3010,10 +3007,10 @@ function ua() {
3010
3007
  for (X = te.length - 1; X >= 0; X--) {
3011
3008
  var ve = te[X];
3012
3009
  if (ve.selector === y && ve.context === O) {
3013
- for (var xe = ve.listeners, de = xe.length - 1; de >= 0; de--) {
3014
- var ye = xe[de];
3010
+ for (var be = ve.listeners, de = be.length - 1; de >= 0; de--) {
3011
+ var ye = be[de];
3015
3012
  if (ye.func === V && Kt(ye.options, oe)) {
3016
- xe.splice(de, 1), xe.length || (te.splice(X, 1), h(O, $, v), h(O, $, N, !0)), le = !0;
3013
+ be.splice(de, 1), be.length || (te.splice(X, 1), h(O, $, v), h(O, $, N, !0)), le = !0;
3017
3014
  break;
3018
3015
  }
3019
3016
  }
@@ -3046,10 +3043,10 @@ function ua() {
3046
3043
  }
3047
3044
  return;
3048
3045
  }
3049
- for (var xe = wt(V), de = 0; de < te.length; de++) {
3046
+ for (var be = wt(V), de = 0; de < te.length; de++) {
3050
3047
  var ye = te[de];
3051
- if (ye.func === $ && Kt(ye.options, xe)) {
3052
- y.removeEventListener(O, $, f.supportsOptions ? xe : xe.capture), te.splice(de, 1), te.length === 0 && (delete X.events[O], oe = !0);
3048
+ if (ye.func === $ && Kt(ye.options, be)) {
3049
+ y.removeEventListener(O, $, f.supportsOptions ? be : be.capture), te.splice(de, 1), te.length === 0 && (delete X.events[O], oe = !0);
3053
3050
  break;
3054
3051
  }
3055
3052
  }
@@ -3061,8 +3058,8 @@ function ua() {
3061
3058
  function v(y, O) {
3062
3059
  for (var $ = wt(O), V = new is(y), L = s[y.type], X = Mr(y)[0], oe = X; E.element(oe); ) {
3063
3060
  for (var te = 0; te < L.length; te++) {
3064
- var le = L[te], ve = le.selector, xe = le.context;
3065
- if (R(oe, ve) && ie(xe, X) && ie(xe, oe)) {
3061
+ var le = L[te], ve = le.selector, be = le.context;
3062
+ if (R(oe, ve) && ie(be, X) && ie(be, oe)) {
3066
3063
  var de = le.listeners;
3067
3064
  V.currentTarget = oe;
3068
3065
  for (var ye = 0; ye < de.length; ye++) {
@@ -3160,8 +3157,8 @@ function ua() {
3160
3157
  }
3161
3158
  }
3162
3159
  for (var le = 0; le < v.length; le++) {
3163
- var ve = v[le], xe = ve[0], de = ve[1], ye = ve[2];
3164
- ve[3][n](xe, o, de, ye);
3160
+ var ve = v[le], be = ve[0], de = ve[1], ye = ve[2];
3161
+ ve[3][n](be, o, de, ye);
3165
3162
  }
3166
3163
  };
3167
3164
  }
@@ -3588,8 +3585,8 @@ function ua() {
3588
3585
  (te = E.func(oe) ? oe($, V, t._proxy, O, L) : oe) && v.push({ x: (E.number(te.x) ? te.x : $) + O.x, y: (E.number(te.y) ? te.y : V) + O.y, range: E.number(te.range) ? te.range : l.range, source: oe, index: L, offset: O });
3589
3586
  }
3590
3587
  for (var le = { target: null, inRange: !1, distance: 0, range: 0, delta: { x: 0, y: 0 } }, ve = 0; ve < v.length; ve++) {
3591
- var xe = v[ve], de = xe.range, ye = xe.x - h.x, Re = xe.y - h.y, Pe = rt(ye, Re), Ve = Pe <= de;
3592
- de === 1 / 0 && le.inRange && le.range !== 1 / 0 && (Ve = !1), le.target && !(Ve ? le.inRange && de !== 1 / 0 ? Pe / de < le.distance / le.range : de === 1 / 0 && le.range !== 1 / 0 || Pe < le.distance : !le.inRange && Pe < le.distance) || (le.target = xe, le.distance = Pe, le.range = de, le.inRange = Ve, le.delta.x = ye, le.delta.y = Re);
3588
+ var be = v[ve], de = be.range, ye = be.x - h.x, Re = be.y - h.y, Pe = rt(ye, Re), Ve = Pe <= de;
3589
+ de === 1 / 0 && le.inRange && le.range !== 1 / 0 && (Ve = !1), le.target && !(Ve ? le.inRange && de !== 1 / 0 ? Pe / de < le.distance / le.range : de === 1 / 0 && le.range !== 1 / 0 || Pe < le.distance : !le.inRange && Pe < le.distance) || (le.target = be, le.distance = Pe, le.range = de, le.inRange = Ve, le.delta.x = ye, le.delta.y = Re);
3593
3590
  }
3594
3591
  return le.inRange && (o.x = le.target.x, o.y = le.target.y), s.closest = le, le;
3595
3592
  }, defaults: { range: 1 / 0, targets: null, offset: null, offsetWithOrigin: !0, origin: null, relativePoints: null, endOnly: !1, enabled: !1 } }, Ps = We(ir, "snap"), Wt = { start: function(n) {
@@ -3801,13 +3798,13 @@ function ua() {
3801
3798
  }, preventDefault: function() {
3802
3799
  } };
3803
3800
  })({ page: { x: X.x, y: X.y }, client: { x: X.x, y: X.y }, timeStamp: f.now() });
3804
- V = (function(te, le, ve, xe, de) {
3801
+ V = (function(te, le, ve, be, de) {
3805
3802
  var ye = te.interactions.new({ pointerType: "reflow" }), Re = { interaction: ye, event: de, pointer: de, eventTarget: ve, phase: "reflow" };
3806
- ye.interactable = le, ye.element = ve, ye.prevEvent = de, ye.updatePointer(de, de, ve, !0), kr(ye.coords.delta), qn(ye.prepared, xe), ye._doPhase(Re);
3803
+ ye.interactable = le, ye.element = ve, ye.prevEvent = de, ye.updatePointer(de, de, ve, !0), kr(ye.coords.delta), qn(ye.prepared, be), ye._doPhase(Re);
3807
3804
  var Pe = te.window, Ve = Pe.Promise, De = Ve ? new Ve((function(Ue) {
3808
3805
  ye._reflowResolve = Ue;
3809
3806
  })) : void 0;
3810
- return ye._reflowPromise = De, ye.start(xe, le, ve), ye._interacting ? (ye.move(Re), ye.end(de)) : (ye.stop(), ye._reflowResolve()), ye.removePointer(de, de), De;
3807
+ return ye._reflowPromise = De, ye.start(be, le, ve), ye._interacting ? (ye.move(Re), ye.end(de)) : (ye.stop(), ye._reflowResolve()), ye.removePointer(de, de), De;
3811
3808
  })(f, s, O, l, oe);
3812
3809
  }
3813
3810
  v && v.push(V);
@@ -3877,7 +3874,7 @@ function Lt(e, {
3877
3874
  onDragEnd: u,
3878
3875
  ...d
3879
3876
  }) {
3880
- const g = we(r), [m, b] = Oe(!1), [T, _] = Oe(!1), [I, j] = Oe(r), A = Se(a), S = Se(c), C = Se(u), G = Se(i);
3877
+ const g = xe(r), [m, b] = Oe(!1), [T, _] = Oe(!1), [I, j] = Oe(r), A = Se(a), S = Se(c), C = Se(u), G = Se(i);
3881
3878
  return pa(e, {
3882
3879
  onDragStart: (w) => {
3883
3880
  b(!0), _(!1), A.current?.(w);
@@ -3917,7 +3914,7 @@ const ti = /* @__PURE__ */ Te(({
3917
3914
  onImageSizeChange: _,
3918
3915
  ...I
3919
3916
  }, j) => {
3920
- const A = he((M, H, q) => M - H * r, [r]), S = we(null), C = et(S), G = Go({ src: i }, {
3917
+ const A = he((M, H, q) => M - H * r, [r]), S = xe(null), C = et(S), G = Go({ src: i }, {
3921
3918
  onLoadStart: m,
3922
3919
  onLoadComplete: b,
3923
3920
  onLoadError: T
@@ -3929,11 +3926,11 @@ const ti = /* @__PURE__ */ Te(({
3929
3926
  });
3930
3927
  Ee(() => {
3931
3928
  if (Y || !G) return;
3932
- const M = ga(e, G, be.size(C), a);
3929
+ const M = ga(e, G, we.size(C), a);
3933
3930
  M !== w && P(M), e !== J && U(e);
3934
3931
  }, [e, G, C.width, C.height, a]), Ee(() => {
3935
3932
  if (!Y || !G) return;
3936
- const M = ma(w, G, be.size(C), a);
3933
+ const M = ma(w, G, we.size(C), a);
3937
3934
  J !== M && U(M);
3938
3935
  }, [w, G, C.width, C.height, a]), Ee(() => {
3939
3936
  c?.(J, Y), u?.(J / 360, Y);
@@ -4003,7 +4000,7 @@ const ri = /* @__PURE__ */ Te(({
4003
4000
  onPositionChange: G,
4004
4001
  ...J
4005
4002
  }, U) => {
4006
- const Y = we(null), w = et(Y), [P, E] = Oe(), [M, H] = Oe(!1), re = he(() => {
4003
+ const Y = xe(null), w = et(Y), [P, E] = Oe(), [M, H] = Oe(!1), re = he(() => {
4007
4004
  if (!P) return 0;
4008
4005
  const { width: R, height: k } = P;
4009
4006
  return k === 0 ? 0 : R / k;
@@ -4069,7 +4066,7 @@ const ri = /* @__PURE__ */ Te(({
4069
4066
  */
4070
4067
  Track: jt
4071
4068
  });
4072
- function va({ autoDimension: e = "width", panoramaRect: r = be.zero, aspectRatio: i = 0, reticleWidth: a = 0 }) {
4069
+ function va({ autoDimension: e = "width", panoramaRect: r = we.zero, aspectRatio: i = 0, reticleWidth: a = 0 }) {
4073
4070
  return {
4074
4071
  root: {
4075
4072
  ...e === "width" ? {
@@ -4230,7 +4227,7 @@ function wa({
4230
4227
  maxWidth: m = 200,
4231
4228
  threshold: b = 100
4232
4229
  }) {
4233
- const T = we(null), _ = we(void 0), I = et(T), j = he(() => {
4230
+ const T = xe(null), _ = xe(void 0), I = et(T), j = he(() => {
4234
4231
  const C = window.document.createElement("span");
4235
4232
  C.className = se(r), C.innerHTML = g, C.role = "tooltip";
4236
4233
  const G = a ?? (T.current ? Na(T.current, b) : "tl"), J = Ea(C), U = Ta({ alignment: G, arrowSize: Ce.make(u, c), gap: d, maxDialogWidth: m, fullDialogWidth: J.width, targetWidth: I.width }), Y = ce(i, U.dialog);
@@ -4265,18 +4262,8 @@ function Ea(e) {
4265
4262
  return window.document.body.removeChild(r), Ce.make(i.width, i.height);
4266
4263
  }
4267
4264
  function Na(e, r) {
4268
- const i = be.fromViewport(), a = be.intersecting(e);
4269
- if (a) {
4270
- const c = a.left - i.left < r, u = i.right - a.right < r, d = a.top - i.top < r, g = i.bottom - a.bottom < r;
4271
- if (c && d) return "br";
4272
- if (c && g) return "tr";
4273
- if (u && d) return "bl";
4274
- if (u && g) return "tl";
4275
- if (c) return "cr";
4276
- if (u) return "cl";
4277
- if (g) return "tc";
4278
- }
4279
- return "tc";
4265
+ const i = we.fromViewport(), a = we.intersecting(e), c = a.left - i.left < r, u = i.right - a.right < r, d = a.top - i.top < r, g = i.bottom - a.bottom < r;
4266
+ return c && d ? "br" : c && g ? "tr" : u && d ? "bl" : u && g ? "tl" : c ? "cr" : u ? "cl" : "tc";
4280
4267
  }
4281
4268
  function Sa({ alignment: e, arrowSize: r, fullDialogWidth: i, gap: a, maxDialogWidth: c, targetWidth: u }) {
4282
4269
  const d = Math.min(i, c), g = u > d;
@@ -4441,9 +4428,9 @@ process.env.NODE_ENV === "development" && (wa.displayName = "WithTooltip");
4441
4428
  function Fl(e, { element: r, isEnabled: i = !0 } = {}) {
4442
4429
  Ae(() => {
4443
4430
  if (!i) return;
4444
- const a = r ?? window.document.documentElement, c = a.className;
4431
+ const a = r ?? window.document.documentElement, c = a.classList;
4445
4432
  return a.classList.add(e), () => {
4446
- a.className = c;
4433
+ c.contains(e) || a.classList.remove(e);
4447
4434
  };
4448
4435
  }, [e, r, i]);
4449
4436
  }
@@ -4498,7 +4485,7 @@ function Pa(e, {
4498
4485
  onDragMove: c,
4499
4486
  onDragEnd: u
4500
4487
  }) {
4501
- const d = we(void 0), g = we(void 0), m = Se(a), b = Se(c), T = Se(u), _ = he((A) => {
4488
+ const d = xe(void 0), g = xe(void 0), m = Se(a), b = Se(c), T = Se(u), _ = he((A) => {
4502
4489
  if (!d.current) return;
4503
4490
  const S = _e.make(A.clientX, A.clientY), C = _e.subtract(S, g.current ?? d.current);
4504
4491
  g.current = S, b.current?.(C, S, d.current);
@@ -4554,7 +4541,7 @@ function Ia(e, {
4554
4541
  shouldInvokeInitially: i = !1,
4555
4542
  onInterval: a
4556
4543
  }, c = []) {
4557
- const u = we(void 0), d = Se(a), g = he(() => {
4544
+ const u = xe(void 0), d = Se(a), g = he(() => {
4558
4545
  clearInterval(u.current), u.current = void 0;
4559
4546
  }, []), m = he(() => {
4560
4547
  g(), !(e < 0) && (i && d.current(), u.current = setInterval(() => {
@@ -4659,7 +4646,7 @@ function Gl() {
4659
4646
  }, [e]);
4660
4647
  }
4661
4648
  function ql(e, r = []) {
4662
- const i = Se(e), a = we(void 0), c = we(!1);
4649
+ const i = Se(e), a = xe(void 0), c = xe(!1);
4663
4650
  Ae(() => {
4664
4651
  const u = () => {
4665
4652
  const g = Ra();
@@ -4675,9 +4662,7 @@ function ql(e, r = []) {
4675
4662
  }, [...r]);
4676
4663
  }
4677
4664
  function Ra() {
4678
- const e = be.fromViewport(), r = be.clone(e, { x: 0, y: 0 }), i = be.from(window, { overflow: !0 });
4679
- if (!i) return;
4680
- const a = be.clone(r, { x: i.width - e.width, y: i.height - e.height }), c = _e.make(e.left / a.left, e.top / a.top);
4665
+ const e = we.fromViewport(), r = we.clone(e, { x: 0, y: 0 }), i = we.from(window, { overflow: !0 }), a = we.clone(r, { x: i.width - e.width, y: i.height - e.height }), c = _e.make(e.left / a.left, e.top / a.top);
4681
4666
  return {
4682
4667
  minPos: _e.make(r.left, r.top),
4683
4668
  maxPos: _e.make(a.left, a.top),
@@ -4686,7 +4671,7 @@ function Ra() {
4686
4671
  };
4687
4672
  }
4688
4673
  function za(e) {
4689
- const r = we(void 0);
4674
+ const r = xe(void 0);
4690
4675
  return Ee(() => {
4691
4676
  r.current = e;
4692
4677
  }, [e]), r.current;
@@ -4732,9 +4717,9 @@ function ci(e) {
4732
4717
  const [r, i] = Oe(Ce.zero);
4733
4718
  return vr(e, {
4734
4719
  onResize: (a) => {
4735
- const c = be.from(a);
4720
+ const c = we.from(a);
4736
4721
  if (!c) return;
4737
- const u = be.size(c);
4722
+ const u = we.size(c);
4738
4723
  i((d) => Ce.isEqual(d, u) ? d : u);
4739
4724
  }
4740
4725
  }), r;
@@ -4774,7 +4759,7 @@ function Ql(e, {
4774
4759
  autoStarts: r = !0,
4775
4760
  onTimeout: i
4776
4761
  }, a = []) {
4777
- const c = we(void 0), u = Se(i), d = he(() => {
4762
+ const c = xe(void 0), u = Se(i), d = he(() => {
4778
4763
  c.current !== void 0 && (clearTimeout(c.current), c.current = void 0);
4779
4764
  }, []), g = he(() => {
4780
4765
  d(), !(e < 0) && (c.current = setTimeout(() => {
@@ -4985,7 +4970,7 @@ const fi = /* @__PURE__ */ Te(({
4985
4970
  ItemComponent: U,
4986
4971
  ...Y
4987
4972
  }, w) => {
4988
- const P = Ga(g ?? {}, d), E = Ka(a ?? [], d), M = qa({ orientation: c }), H = d.map(() => we(null)), q = H.map(ci), re = (D, R) => (P[R]?.indexOf(D) ?? -1) >= 0, Q = (D) => E.indexOf(D) >= 0, F = (D) => {
4973
+ const P = Ga(g ?? {}, d), E = Ka(a ?? [], d), M = qa({ orientation: c }), H = d.map(() => xe(null)), q = H.map(ci), re = (D, R) => (P[R]?.indexOf(D) ?? -1) >= 0, Q = (D) => E.indexOf(D) >= 0, F = (D) => {
4989
4974
  let R;
4990
4975
  Q(D) ? R = (k) => k.filter((K) => K !== D) : i ? R = (k) => [D] : R = (k) => [...k.filter((K) => K !== D), D], ne(E, R(E));
4991
4976
  }, z = (D, R) => {
@@ -5271,7 +5256,7 @@ const Wa = /* @__PURE__ */ Te(({
5271
5256
  ItemComponent: b,
5272
5257
  ...T
5273
5258
  }, _) => {
5274
- const I = we(void 0), j = we(null), A = we(void 0), S = we(void 0), C = we(void 0), G = 1e3, J = Se(d), U = Se(g), Y = Se(m), w = we(!1), P = we(!1), E = Ca(), [M, H] = Oe(Oo(j, c)), [q, re] = Oe(!1), Q = Qa({ scrollSnapEnabled: E || !q, orientation: c }), F = e > 0, z = he(() => {
5259
+ const I = xe(void 0), j = xe(null), A = xe(void 0), S = xe(void 0), C = xe(void 0), G = 1e3, J = Se(d), U = Se(g), Y = Se(m), w = xe(!1), P = xe(!1), E = Ca(), [M, H] = Oe(Oo(j, c)), [q, re] = Oe(!1), Q = Qa({ scrollSnapEnabled: E || !q, orientation: c }), F = e > 0, z = he(() => {
5275
5260
  C.current !== void 0 && (clearTimeout(C.current), C.current = void 0);
5276
5261
  }, []), B = he(() => {
5277
5262
  z(), C.current = setTimeout(() => {
@@ -5371,8 +5356,7 @@ function Oo(e, r) {
5371
5356
  function Za(e, r, i) {
5372
5357
  const a = r?.current, c = a?.children[e];
5373
5358
  if (!c) return 0;
5374
- const u = be.intersecting(c, a);
5375
- if (!u) return 0;
5359
+ const u = we.intersecting(c, a);
5376
5360
  switch (i) {
5377
5361
  case "horizontal":
5378
5362
  return Math.max(0, Math.min(1, Math.round((u.width / a.clientWidth + Number.EPSILON) * 1e3) / 1e3));
@@ -5433,7 +5417,7 @@ const pi = /* @__PURE__ */ Te(({
5433
5417
  onChange: T,
5434
5418
  ..._
5435
5419
  }, I) => {
5436
- const j = tc(b, g), A = we([]), S = ec(), C = Le(e, {
5420
+ const j = tc(b, g), A = xe([]), S = ec(), C = Le(e, {
5437
5421
  field: pn
5438
5422
  }), G = (w) => {
5439
5423
  w < 0 ? A.current[0]?.focus() : w >= g ? A.current[g - 1]?.focus() : A.current[w]?.focus();
@@ -5810,7 +5794,7 @@ const mi = /* @__PURE__ */ Te(({
5810
5794
  ToggleComponent: q,
5811
5795
  ...re
5812
5796
  }, Q) => {
5813
- const F = we(null), z = et(F), B = I.length, ne = uc(I, j, A, m), ie = T ?? (S === "vertical" ? z.height : z.width), ae = ie * ne + _ * (ne - 1), D = cc(C, I), [R, k] = Oe(u ?? !0), K = fc({ isCollapsed: R, collectionPadding: c, isInverted: d, maxVisibleItems: j, menuLength: ae, numItems: B, orientation: S }), Z = Le(e, {
5797
+ const F = xe(null), z = et(F), B = I.length, ne = uc(I, j, A, m), ie = T ?? (S === "vertical" ? z.height : z.width), ae = ie * ne + _ * (ne - 1), D = cc(C, I), [R, k] = Oe(u ?? !0), K = fc({ isCollapsed: R, collectionPadding: c, isInverted: d, maxVisibleItems: j, menuLength: ae, numItems: B, orientation: S }), Z = Le(e, {
5814
5798
  collapseIcon: Or,
5815
5799
  collection: bn,
5816
5800
  expandIcon: Pr,
@@ -7249,7 +7233,7 @@ const Mo = "base-", fl = /* @__PURE__ */ Te(({
7249
7233
  verticalSpacing: g = 0,
7250
7234
  ...m
7251
7235
  }, b) => {
7252
- const T = we(null), [_, I] = Oe(NaN), [j, A] = Oe(NaN), [S, C] = Oe(NaN), [G, J] = Oe(NaN), U = () => be.from(T.current)?.width ?? 0, Y = () => be.from(T.current)?.height ?? 0, w = () => {
7236
+ const T = xe(null), [_, I] = Oe(NaN), [j, A] = Oe(NaN), [S, C] = Oe(NaN), [G, J] = Oe(NaN), U = () => we.from(T.current).width, Y = () => we.from(T.current).height, w = () => {
7253
7237
  const H = T.current;
7254
7238
  if (!H) return;
7255
7239
  const q = H.children, re = d;
@@ -7264,7 +7248,7 @@ const Mo = "base-", fl = /* @__PURE__ */ Te(({
7264
7248
  const ne = zo(B, d), [ie, ae] = Ro(Q, ne);
7265
7249
  B.role = "gridcell", B.style.position = "absolute", B.style.width = `calc(${100 / re * ne}% - ${a * (re - 1) / re * ne}px + ${a * (ne - 1)}px)`, B.style.height = "", B.style.left = `calc(${100 / re * ie}% - ${a * (re - 1) / re * ie}px + ${a * ie}px)`, B.style.top = `${ae + (ae === 0 ? 0 : g)}px`;
7266
7250
  for (let D = 0; D < ne; D++)
7267
- Q[ie + D] = ae + (ae === 0 ? 0 : g) + (be.from(B)?.height ?? 0);
7251
+ Q[ie + D] = ae + (ae === 0 ? 0 : g) + we.from(B).height;
7268
7252
  if (e && ie + ne === re) {
7269
7253
  const D = Ct(Q);
7270
7254
  for (let R = 0; R < re; R++)
@@ -7282,7 +7266,7 @@ const Mo = "base-", fl = /* @__PURE__ */ Te(({
7282
7266
  const ne = zo(B, d), [ie, ae] = Ro(Q, ne);
7283
7267
  B.style.position = "absolute", B.style.width = "", B.style.height = `calc(${100 / re * ne}% - ${g * (re - 1) / re * ne}px + ${g * (ne - 1)}px)`, B.style.top = `calc(${100 / re * ie}% - ${g * (re - 1) / re * ie}px + ${g * ie}px)`, B.style.left = `${ae + (ae === 0 ? 0 : a)}px`;
7284
7268
  for (let D = 0; D < ne; D++)
7285
- Q[ie + D] = ae + (ae === 0 ? 0 : a) + (be.from(B)?.width ?? 0);
7269
+ Q[ie + D] = ae + (ae === 0 ? 0 : a) + we.from(B).width;
7286
7270
  if (e && ie + ne === re) {
7287
7271
  const D = Ct(Q);
7288
7272
  for (let R = 0; R < re; R++)
@@ -7295,7 +7279,7 @@ const Mo = "base-", fl = /* @__PURE__ */ Te(({
7295
7279
  B instanceof HTMLElement && (B.style.top = `calc(${F}px - ${B.style.top} - ${B.getBoundingClientRect().height}px)`);
7296
7280
  }
7297
7281
  }, P = he((H) => {
7298
- const q = be.size(be.from(H) ?? be.zero), re = U(), Q = Y();
7282
+ const q = we.size(we.from(H)), re = U(), Q = Y();
7299
7283
  (_ !== re || j !== Q || q.width !== S || q.height !== G) && (w(), C(q.width), J(q.height));
7300
7284
  }, [e, a, c, d, g, u]);
7301
7285
  vr(T, {
@@ -7388,7 +7372,7 @@ const Ni = /* @__PURE__ */ Te(({
7388
7372
  onChange: I,
7389
7373
  ...j
7390
7374
  }, A) => {
7391
- const S = we(null), C = et(S), G = we(null), J = we(null), [U, Y] = Oe(T ?? [m, g]), w = wl(m, g, _), [P, E] = U.map((K) => at(K, m, g, b, C, d, c, a)), M = E - P, H = Le(e, {
7375
+ const S = xe(null), C = et(S), G = xe(null), J = xe(null), [U, Y] = Oe(T ?? [m, g]), w = wl(m, g, _), [P, E] = U.map((K) => at(K, m, g, b, C, d, c, a)), M = E - P, H = Le(e, {
7392
7376
  gutter: Nn,
7393
7377
  highlight: Sn,
7394
7378
  knob: At,
@@ -7397,10 +7381,10 @@ const Ni = /* @__PURE__ */ Te(({
7397
7381
  }), q = he((K, Z, W) => {
7398
7382
  const fe = b === "horizontal" ? Z : W, ge = at(m, m, g, b, C, d, c, a), ue = at(U[1], m, g, b, C, d, c, a), Ne = at(K, m, g, b, C, d, c, a) + fe;
7399
7383
  return Lo(Math.max(ge, Math.min(ue, Ne)), m, g, b, C, d, c, a);
7400
- }, [d, c, a, m, g, b, U[1], be.toString(C)]), re = he((K, Z, W) => {
7384
+ }, [d, c, a, m, g, b, U[1], we.toString(C)]), re = he((K, Z, W) => {
7401
7385
  const fe = b === "horizontal" ? Z : W, ge = at(U[0], m, g, b, C, d, c, a), ue = at(g, m, g, b, C, d, c, a), Ne = at(K, m, g, b, C, d, c, a) + fe;
7402
7386
  return Lo(Math.max(ge, Math.min(ue, Ne)), m, g, b, C, d, c, a);
7403
- }, [d, c, a, m, g, b, U[0], be.toString(C)]), { isDragging: Q, isReleasing: F, value: z, setValue: B } = Lt(G, {
7387
+ }, [d, c, a, m, g, b, U[0], we.toString(C)]), { isDragging: Q, isReleasing: F, value: z, setValue: B } = Lt(G, {
7404
7388
  initialValue: T?.[0] ?? m,
7405
7389
  transform: q
7406
7390
  }), { isDragging: ne, isReleasing: ie, value: ae, setValue: D } = Lt(J, {
@@ -7733,8 +7717,8 @@ const _i = /* @__PURE__ */ Te(({
7733
7717
  onChange: S,
7734
7718
  ...C
7735
7719
  }, G) => {
7736
- const J = we(null), U = we(null), Y = he((ne, ie, ae) => {
7737
- const D = be.from(J.current) ?? be.zero, R = a ? 1 - ne : ne;
7720
+ const J = xe(null), U = xe(null), Y = he((ne, ie, ae) => {
7721
+ const D = we.from(J.current), R = a ? 1 - ne : ne;
7738
7722
  switch (b) {
7739
7723
  case "horizontal": {
7740
7724
  const k = i ? D.width - g : D.width, K = R * k + ie, Z = Math.max(0, Math.min(1, K / k));
@@ -7749,7 +7733,7 @@ const _i = /* @__PURE__ */ Te(({
7749
7733
  }
7750
7734
  }, [J.current, i, a, g, u, b]), w = he((ne) => {
7751
7735
  if (!c) return;
7752
- const ie = be.from(J.current) ?? be.zero, ae = be.fromViewport();
7736
+ const ie = we.from(J.current), ae = we.fromViewport();
7753
7737
  switch (b) {
7754
7738
  case "horizontal": {
7755
7739
  const D = (ne.clientX + ae.left - ie.left) / ie.width, R = a ? 1 - D : D;
@@ -7981,7 +7965,7 @@ const Ti = /* @__PURE__ */ Te(({
7981
7965
  onPositionChange: G,
7982
7966
  ...J
7983
7967
  }, U) => {
7984
- const Y = we(null), w = we(null), P = et(Y), [E, M] = Oe(i), H = he((k, K, Z) => {
7968
+ const Y = xe(null), w = xe(null), P = et(Y), [E, M] = Oe(i), H = he((k, K, Z) => {
7985
7969
  const W = c ? Qe(k) : k;
7986
7970
  switch (_) {
7987
7971
  case "horizontal": {
@@ -8002,7 +7986,7 @@ const Ti = /* @__PURE__ */ Te(({
8002
7986
  onDragEnd: A
8003
7987
  }), z = he((k) => {
8004
7988
  if (!u) return;
8005
- const K = be.fromViewport();
7989
+ const K = we.fromViewport();
8006
7990
  switch (_) {
8007
7991
  case "horizontal": {
8008
7992
  const Z = (k.clientX + K.left - P.left) / P.width, W = c ? Qe(Z) : Z, fe = kt(W, I);
@@ -8324,7 +8308,7 @@ const Pi = /* @__PURE__ */ Te(({
8324
8308
  onChange: d,
8325
8309
  ...g
8326
8310
  }, m) => {
8327
- const b = we(null), T = ci(b), _ = Le(r, {
8311
+ const b = xe(null), T = ci(b), _ = Le(r, {
8328
8312
  knob: $n,
8329
8313
  track: jn
8330
8314
  }), I = Pl({ isOn: a }), j = Il({ isOn: a, isInverted: i, orientation: c, knobSize: T });