@ukpc-lib/react 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/GlobalMenu/components/MenuItem.d.ts +5 -1
- package/dist/components/GlobalMenu/index.d.ts +3 -3
- package/dist/components/index.cjs +5 -5
- package/dist/components/index.js +310 -308
- package/package.json +1 -1
- package/web-components-bundle/global-menu/index.cjs +6 -6
- package/web-components-bundle/global-menu/index.js +364 -360
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as B, Fragment as Fi, jsx as w } from "react/jsx-runtime";
|
|
2
2
|
import * as D from "react";
|
|
3
|
-
import zi, { useState as
|
|
3
|
+
import zi, { useState as K, useRef as Et, useEffect as Xt, createContext as Dt, useLayoutEffect as Wi, useContext as W, useInsertionEffect as kr, useCallback as Cr, useMemo as be, forwardRef as Vr, createElement as _i, useId as Er } from "react";
|
|
4
4
|
import { C as Mr, g as Or, R as Dr, Q as Lr, p as Rr, l as Br } from "../interceptor.const-3d8c3adc.js";
|
|
5
5
|
import { a as lh, b as ch } from "../interceptor.const-3d8c3adc.js";
|
|
6
6
|
import { Link as Nr, useLocation as jr } from "react-router-dom";
|
|
@@ -154,7 +154,7 @@ function nh({
|
|
|
154
154
|
...i,
|
|
155
155
|
color: (o == null ? void 0 : o.color) || "black",
|
|
156
156
|
backgroundColor: (o == null ? void 0 : o.bgColor) || "black"
|
|
157
|
-
}, [l, c] =
|
|
157
|
+
}, [l, c] = K(!1), u = () => {
|
|
158
158
|
window.location.href = `${n}/authentication/logout?callbackUrl=${window.location.href}`;
|
|
159
159
|
};
|
|
160
160
|
return /* @__PURE__ */ B(Hi, { styles: [Gr], style: { zIndex: 1202 }, children: [
|
|
@@ -204,7 +204,7 @@ function Yr({
|
|
|
204
204
|
setShowConfirmModal: e,
|
|
205
205
|
primaryColor: n = "#009d4f"
|
|
206
206
|
}) {
|
|
207
|
-
const [i, s] =
|
|
207
|
+
const [i, s] = K(!1), o = Et(null), r = Et(null), [a, l] = K(!1), [c, u] = K(!1), h = {
|
|
208
208
|
backgroundColor: a ? n : "transparent"
|
|
209
209
|
}, d = {
|
|
210
210
|
backgroundColor: c ? n : "transparent"
|
|
@@ -332,29 +332,29 @@ function oe(t, e, n) {
|
|
|
332
332
|
if (typeof t != "function")
|
|
333
333
|
throw new TypeError(xo);
|
|
334
334
|
e = Mn(e) || 0, ue(n) && (u = !!n.leading, h = "maxWait" in n, o = h ? wo(Mn(n.maxWait) || 0, e) : o, d = "trailing" in n ? !!n.trailing : d);
|
|
335
|
-
function f(
|
|
336
|
-
var k = i,
|
|
337
|
-
return i = s = void 0, c =
|
|
335
|
+
function f(T) {
|
|
336
|
+
var k = i, A = s;
|
|
337
|
+
return i = s = void 0, c = T, r = t.apply(A, k), r;
|
|
338
338
|
}
|
|
339
|
-
function p(
|
|
340
|
-
return c =
|
|
339
|
+
function p(T) {
|
|
340
|
+
return c = T, a = setTimeout(y, e), u ? f(T) : r;
|
|
341
341
|
}
|
|
342
|
-
function m(
|
|
343
|
-
var k =
|
|
344
|
-
return h ? So(C, o -
|
|
342
|
+
function m(T) {
|
|
343
|
+
var k = T - l, A = T - c, C = e - k;
|
|
344
|
+
return h ? So(C, o - A) : C;
|
|
345
345
|
}
|
|
346
|
-
function v(
|
|
347
|
-
var k =
|
|
348
|
-
return l === void 0 || k >= e || k < 0 || h &&
|
|
346
|
+
function v(T) {
|
|
347
|
+
var k = T - l, A = T - c;
|
|
348
|
+
return l === void 0 || k >= e || k < 0 || h && A >= o;
|
|
349
349
|
}
|
|
350
350
|
function y() {
|
|
351
|
-
var
|
|
352
|
-
if (v(
|
|
353
|
-
return b(
|
|
354
|
-
a = setTimeout(y, m(
|
|
351
|
+
var T = Ve();
|
|
352
|
+
if (v(T))
|
|
353
|
+
return b(T);
|
|
354
|
+
a = setTimeout(y, m(T));
|
|
355
355
|
}
|
|
356
|
-
function b(
|
|
357
|
-
return a = void 0, d && i ? f(
|
|
356
|
+
function b(T) {
|
|
357
|
+
return a = void 0, d && i ? f(T) : (i = s = void 0, r);
|
|
358
358
|
}
|
|
359
359
|
function g() {
|
|
360
360
|
a !== void 0 && clearTimeout(a), c = 0, i = l = s = a = void 0;
|
|
@@ -362,9 +362,9 @@ function oe(t, e, n) {
|
|
|
362
362
|
function x() {
|
|
363
363
|
return a === void 0 ? r : b(Ve());
|
|
364
364
|
}
|
|
365
|
-
function
|
|
366
|
-
var
|
|
367
|
-
if (i = arguments, s = this, l =
|
|
365
|
+
function S() {
|
|
366
|
+
var T = Ve(), k = v(T);
|
|
367
|
+
if (i = arguments, s = this, l = T, k) {
|
|
368
368
|
if (a === void 0)
|
|
369
369
|
return p(l);
|
|
370
370
|
if (h)
|
|
@@ -372,7 +372,7 @@ function oe(t, e, n) {
|
|
|
372
372
|
}
|
|
373
373
|
return a === void 0 && (a = setTimeout(y, e)), r;
|
|
374
374
|
}
|
|
375
|
-
return
|
|
375
|
+
return S.cancel = g, S.flush = x, S;
|
|
376
376
|
}
|
|
377
377
|
var To = "Expected a function";
|
|
378
378
|
function Ao(t, e, n) {
|
|
@@ -462,7 +462,7 @@ var Co = /* @__PURE__ */ Object.freeze({
|
|
|
462
462
|
addClasses: Qi,
|
|
463
463
|
removeClasses: Zi,
|
|
464
464
|
classNamesToQuery: Ji
|
|
465
|
-
}), st = qi, Ee = Ki, Vo = $i, rt = Qi, ot = Zi,
|
|
465
|
+
}), st = qi, Ee = Ki, Vo = $i, rt = Qi, ot = Zi, z = Ji, te = (
|
|
466
466
|
/** @class */
|
|
467
467
|
function() {
|
|
468
468
|
function t(e, n) {
|
|
@@ -499,12 +499,12 @@ var Co = /* @__PURE__ */ Object.freeze({
|
|
|
499
499
|
}, this.drag = function(s) {
|
|
500
500
|
var o, r, a, l, c, u, h, d, f, p, m;
|
|
501
501
|
if (!(!i.draggedAxis || !i.contentWrapperEl)) {
|
|
502
|
-
var v, y = i.axis[i.draggedAxis].track, b = (r = (o = y.rect) === null || o === void 0 ? void 0 : o[i.axis[i.draggedAxis].sizeAttr]) !== null && r !== void 0 ? r : 0, g = i.axis[i.draggedAxis].scrollbar, x = (l = (a = i.contentWrapperEl) === null || a === void 0 ? void 0 : a[i.axis[i.draggedAxis].scrollSizeAttr]) !== null && l !== void 0 ? l : 0,
|
|
502
|
+
var v, y = i.axis[i.draggedAxis].track, b = (r = (o = y.rect) === null || o === void 0 ? void 0 : o[i.axis[i.draggedAxis].sizeAttr]) !== null && r !== void 0 ? r : 0, g = i.axis[i.draggedAxis].scrollbar, x = (l = (a = i.contentWrapperEl) === null || a === void 0 ? void 0 : a[i.axis[i.draggedAxis].scrollSizeAttr]) !== null && l !== void 0 ? l : 0, S = parseInt((u = (c = i.elStyles) === null || c === void 0 ? void 0 : c[i.axis[i.draggedAxis].sizeAttr]) !== null && u !== void 0 ? u : "0px", 10);
|
|
503
503
|
s.preventDefault(), s.stopPropagation(), i.draggedAxis === "y" ? v = s.pageY : v = s.pageX;
|
|
504
|
-
var
|
|
505
|
-
|
|
506
|
-
var k =
|
|
507
|
-
i.draggedAxis === "x" && i.isRtl && (
|
|
504
|
+
var T = v - ((d = (h = y.rect) === null || h === void 0 ? void 0 : h[i.axis[i.draggedAxis].offsetAttr]) !== null && d !== void 0 ? d : 0) - i.axis[i.draggedAxis].dragOffset;
|
|
505
|
+
T = i.draggedAxis === "x" && i.isRtl ? ((p = (f = y.rect) === null || f === void 0 ? void 0 : f[i.axis[i.draggedAxis].sizeAttr]) !== null && p !== void 0 ? p : 0) - g.size - T : T;
|
|
506
|
+
var k = T / (b - g.size), A = k * (x - S);
|
|
507
|
+
i.draggedAxis === "x" && i.isRtl && (A = !((m = t.getRtlHelpers()) === null || m === void 0) && m.isScrollingToNegative ? -A : A), i.contentWrapperEl[i.axis[i.draggedAxis].scrollOffsetAttr] = A;
|
|
508
508
|
}
|
|
509
509
|
}, this.onEndDrag = function(s) {
|
|
510
510
|
var o = Ee(i.el), r = st(i.el);
|
|
@@ -578,7 +578,7 @@ var Co = /* @__PURE__ */ Object.freeze({
|
|
|
578
578
|
Xi && (this.initDOM(), this.rtlHelpers = t.getRtlHelpers(), this.scrollbarWidth = this.getScrollbarWidth(), this.recalculate(), this.initListeners());
|
|
579
579
|
}, t.prototype.initDOM = function() {
|
|
580
580
|
var e, n;
|
|
581
|
-
this.wrapperEl = this.el.querySelector(
|
|
581
|
+
this.wrapperEl = this.el.querySelector(z(this.classNames.wrapper)), this.contentWrapperEl = this.options.scrollableNode || this.el.querySelector(z(this.classNames.contentWrapper)), this.contentEl = this.options.contentNode || this.el.querySelector(z(this.classNames.contentEl)), this.offsetEl = this.el.querySelector(z(this.classNames.offset)), this.maskEl = this.el.querySelector(z(this.classNames.mask)), this.placeholderEl = this.findChild(this.wrapperEl, z(this.classNames.placeholder)), this.heightAutoObserverWrapperEl = this.el.querySelector(z(this.classNames.heightAutoObserverWrapperEl)), this.heightAutoObserverEl = this.el.querySelector(z(this.classNames.heightAutoObserverEl)), this.axis.x.track.el = this.findChild(this.el, "".concat(z(this.classNames.track)).concat(z(this.classNames.horizontal))), this.axis.y.track.el = this.findChild(this.el, "".concat(z(this.classNames.track)).concat(z(this.classNames.vertical))), this.axis.x.scrollbar.el = ((e = this.axis.x.track.el) === null || e === void 0 ? void 0 : e.querySelector(z(this.classNames.scrollbar))) || null, this.axis.y.scrollbar.el = ((n = this.axis.y.track.el) === null || n === void 0 ? void 0 : n.querySelector(z(this.classNames.scrollbar))) || null, this.options.autoHide || (rt(this.axis.x.scrollbar.el, this.classNames.visible), rt(this.axis.y.scrollbar.el, this.classNames.visible));
|
|
582
582
|
}, t.prototype.initListeners = function() {
|
|
583
583
|
var e = this, n, i = st(this.el);
|
|
584
584
|
if (this.el.addEventListener("mouseenter", this.onMouseEnter), this.el.addEventListener("pointerdown", this.onPointerEvent, !0), this.el.addEventListener("mousemove", this.onMouseMove), this.el.addEventListener("mouseleave", this.onMouseLeave), (n = this.contentWrapperEl) === null || n === void 0 || n.addEventListener("scroll", this.onScroll), i.addEventListener("resize", this.onWindowResize), !!this.contentEl) {
|
|
@@ -712,15 +712,15 @@ var Co = /* @__PURE__ */ Object.freeze({
|
|
|
712
712
|
autoHide: !0
|
|
713
713
|
}, t.getOptions = Vo, t.helpers = Co, t;
|
|
714
714
|
}()
|
|
715
|
-
),
|
|
716
|
-
return
|
|
715
|
+
), U = function() {
|
|
716
|
+
return U = Object.assign || function(e) {
|
|
717
717
|
for (var n, i = 1, s = arguments.length; i < s; i++) {
|
|
718
718
|
n = arguments[i];
|
|
719
719
|
for (var o in n)
|
|
720
720
|
Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o]);
|
|
721
721
|
}
|
|
722
722
|
return e;
|
|
723
|
-
},
|
|
723
|
+
}, U.apply(this, arguments);
|
|
724
724
|
};
|
|
725
725
|
function Eo(t, e) {
|
|
726
726
|
var n = {};
|
|
@@ -736,10 +736,10 @@ var ts = D.forwardRef(function(t, e) {
|
|
|
736
736
|
Object.keys(o).forEach(function(f) {
|
|
737
737
|
Object.prototype.hasOwnProperty.call(te.defaultOptions, f) ? c[f] = o[f] : u[f] = o[f];
|
|
738
738
|
});
|
|
739
|
-
var h =
|
|
739
|
+
var h = U(U({}, te.defaultOptions.classNames), c.classNames), d = U(U({}, s), { className: "".concat(h.contentWrapper).concat(s.className ? " ".concat(s.className) : ""), tabIndex: 0, role: "region", "aria-label": c.ariaLabel || te.defaultOptions.ariaLabel });
|
|
740
740
|
return D.useEffect(function() {
|
|
741
741
|
var f;
|
|
742
|
-
return a.current = d.ref ? d.ref.current : a.current, r.current && (f = new te(r.current,
|
|
742
|
+
return a.current = d.ref ? d.ref.current : a.current, r.current && (f = new te(r.current, U(U(U({}, c), a.current && {
|
|
743
743
|
scrollableNode: a.current
|
|
744
744
|
}), l.current && {
|
|
745
745
|
contentNode: l.current
|
|
@@ -748,7 +748,7 @@ var ts = D.forwardRef(function(t, e) {
|
|
|
748
748
|
};
|
|
749
749
|
}, []), D.createElement(
|
|
750
750
|
"div",
|
|
751
|
-
|
|
751
|
+
U({ "data-simplebar": "init", ref: r }, u),
|
|
752
752
|
D.createElement(
|
|
753
753
|
"div",
|
|
754
754
|
{ className: h.wrapper },
|
|
@@ -762,7 +762,7 @@ var ts = D.forwardRef(function(t, e) {
|
|
|
762
762
|
{ className: h.mask },
|
|
763
763
|
D.createElement("div", { className: h.offset }, typeof n == "function" ? n({
|
|
764
764
|
scrollableNodeRef: a,
|
|
765
|
-
scrollableNodeProps:
|
|
765
|
+
scrollableNodeProps: U(U({}, d), { ref: a }),
|
|
766
766
|
contentNodeRef: l,
|
|
767
767
|
contentNodeProps: {
|
|
768
768
|
className: h.contentEl,
|
|
@@ -770,7 +770,7 @@ var ts = D.forwardRef(function(t, e) {
|
|
|
770
770
|
}
|
|
771
771
|
}) : D.createElement(
|
|
772
772
|
"div",
|
|
773
|
-
|
|
773
|
+
U({}, d),
|
|
774
774
|
D.createElement("div", { className: h.contentEl }, n)
|
|
775
775
|
))
|
|
776
776
|
),
|
|
@@ -795,7 +795,7 @@ const es = Dt({
|
|
|
795
795
|
reducedMotion: "never"
|
|
796
796
|
}), xe = Dt({}), en = Dt(null), we = typeof document < "u", Mo = we ? Wi : Xt, ns = Dt({ strict: !1 }), nn = (t) => t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), Oo = "framerAppearId", is = "data-" + nn(Oo);
|
|
797
797
|
function Do(t, e, n, i) {
|
|
798
|
-
const { visualElement: s } =
|
|
798
|
+
const { visualElement: s } = W(xe), o = W(ns), r = W(en), a = W(es).reducedMotion, l = Et();
|
|
799
799
|
i = i || o.renderer, !l.current && i && (l.current = i(t, {
|
|
800
800
|
visualState: e,
|
|
801
801
|
parent: s,
|
|
@@ -863,7 +863,7 @@ function Ro(t, e) {
|
|
|
863
863
|
return t.inherit !== !1 ? e : {};
|
|
864
864
|
}
|
|
865
865
|
function Bo(t) {
|
|
866
|
-
const { initial: e, animate: n } = Ro(t,
|
|
866
|
+
const { initial: e, animate: n } = Ro(t, W(xe));
|
|
867
867
|
return be(() => ({ initial: e, animate: n }), [Ln(e), Ln(n)]);
|
|
868
868
|
}
|
|
869
869
|
function Ln(t) {
|
|
@@ -906,13 +906,13 @@ function Io({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVis
|
|
|
906
906
|
function o(a, l) {
|
|
907
907
|
let c;
|
|
908
908
|
const u = {
|
|
909
|
-
...
|
|
909
|
+
...W(es),
|
|
910
910
|
...a,
|
|
911
911
|
layoutId: Fo(a)
|
|
912
912
|
}, { isStatic: h } = u, d = Bo(a), f = i(a, h);
|
|
913
913
|
if (!h && we) {
|
|
914
914
|
d.visualElement = Do(s, f, u, e);
|
|
915
|
-
const p =
|
|
915
|
+
const p = W(os), m = W(ns).strict;
|
|
916
916
|
d.visualElement && (c = d.visualElement.loadFeatures(
|
|
917
917
|
// Note: Pass the full new combined props to correctly re-render dynamic feature components.
|
|
918
918
|
u,
|
|
@@ -932,7 +932,7 @@ function Io({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVis
|
|
|
932
932
|
return r[jo] = s, r;
|
|
933
933
|
}
|
|
934
934
|
function Fo({ layoutId: t }) {
|
|
935
|
-
const e =
|
|
935
|
+
const e = W(rs).id;
|
|
936
936
|
return e && t !== void 0 ? e + "-" + t : t;
|
|
937
937
|
}
|
|
938
938
|
function zo(t) {
|
|
@@ -1024,7 +1024,7 @@ const qt = [
|
|
|
1024
1024
|
function as(t, { layout: e, layoutId: n }) {
|
|
1025
1025
|
return bt.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!he[t] || t === "opacity");
|
|
1026
1026
|
}
|
|
1027
|
-
const
|
|
1027
|
+
const _ = (t) => !!(t && t.getVelocity), Uo = {
|
|
1028
1028
|
x: "translateX",
|
|
1029
1029
|
y: "translateY",
|
|
1030
1030
|
z: "translateZ",
|
|
@@ -1059,47 +1059,47 @@ const $t = (t) => ({
|
|
|
1059
1059
|
test: (e) => Kt(e) && e.endsWith(t) && e.split(" ").length === 1,
|
|
1060
1060
|
parse: parseFloat,
|
|
1061
1061
|
transform: (e) => `${e}${t}`
|
|
1062
|
-
}), at = $t("deg"),
|
|
1063
|
-
|
|
1064
|
-
parse: (t) =>
|
|
1065
|
-
transform: (t) =>
|
|
1062
|
+
}), at = $t("deg"), Q = $t("%"), P = $t("px"), Ko = $t("vh"), $o = $t("vw"), Bn = {
|
|
1063
|
+
...Q,
|
|
1064
|
+
parse: (t) => Q.parse(t) / 100,
|
|
1065
|
+
transform: (t) => Q.transform(t * 100)
|
|
1066
1066
|
}, Nn = {
|
|
1067
1067
|
...xt,
|
|
1068
1068
|
transform: Math.round
|
|
1069
1069
|
}, hs = {
|
|
1070
1070
|
// Border props
|
|
1071
|
-
borderWidth:
|
|
1072
|
-
borderTopWidth:
|
|
1073
|
-
borderRightWidth:
|
|
1074
|
-
borderBottomWidth:
|
|
1075
|
-
borderLeftWidth:
|
|
1076
|
-
borderRadius:
|
|
1077
|
-
radius:
|
|
1078
|
-
borderTopLeftRadius:
|
|
1079
|
-
borderTopRightRadius:
|
|
1080
|
-
borderBottomRightRadius:
|
|
1081
|
-
borderBottomLeftRadius:
|
|
1071
|
+
borderWidth: P,
|
|
1072
|
+
borderTopWidth: P,
|
|
1073
|
+
borderRightWidth: P,
|
|
1074
|
+
borderBottomWidth: P,
|
|
1075
|
+
borderLeftWidth: P,
|
|
1076
|
+
borderRadius: P,
|
|
1077
|
+
radius: P,
|
|
1078
|
+
borderTopLeftRadius: P,
|
|
1079
|
+
borderTopRightRadius: P,
|
|
1080
|
+
borderBottomRightRadius: P,
|
|
1081
|
+
borderBottomLeftRadius: P,
|
|
1082
1082
|
// Positioning props
|
|
1083
|
-
width:
|
|
1084
|
-
maxWidth:
|
|
1085
|
-
height:
|
|
1086
|
-
maxHeight:
|
|
1087
|
-
size:
|
|
1088
|
-
top:
|
|
1089
|
-
right:
|
|
1090
|
-
bottom:
|
|
1091
|
-
left:
|
|
1083
|
+
width: P,
|
|
1084
|
+
maxWidth: P,
|
|
1085
|
+
height: P,
|
|
1086
|
+
maxHeight: P,
|
|
1087
|
+
size: P,
|
|
1088
|
+
top: P,
|
|
1089
|
+
right: P,
|
|
1090
|
+
bottom: P,
|
|
1091
|
+
left: P,
|
|
1092
1092
|
// Spacing props
|
|
1093
|
-
padding:
|
|
1094
|
-
paddingTop:
|
|
1095
|
-
paddingRight:
|
|
1096
|
-
paddingBottom:
|
|
1097
|
-
paddingLeft:
|
|
1098
|
-
margin:
|
|
1099
|
-
marginTop:
|
|
1100
|
-
marginRight:
|
|
1101
|
-
marginBottom:
|
|
1102
|
-
marginLeft:
|
|
1093
|
+
padding: P,
|
|
1094
|
+
paddingTop: P,
|
|
1095
|
+
paddingRight: P,
|
|
1096
|
+
paddingBottom: P,
|
|
1097
|
+
paddingLeft: P,
|
|
1098
|
+
margin: P,
|
|
1099
|
+
marginTop: P,
|
|
1100
|
+
marginRight: P,
|
|
1101
|
+
marginBottom: P,
|
|
1102
|
+
marginLeft: P,
|
|
1103
1103
|
// Transform props
|
|
1104
1104
|
rotate: at,
|
|
1105
1105
|
rotateX: at,
|
|
@@ -1112,19 +1112,19 @@ const $t = (t) => ({
|
|
|
1112
1112
|
skew: at,
|
|
1113
1113
|
skewX: at,
|
|
1114
1114
|
skewY: at,
|
|
1115
|
-
distance:
|
|
1116
|
-
translateX:
|
|
1117
|
-
translateY:
|
|
1118
|
-
translateZ:
|
|
1119
|
-
x:
|
|
1120
|
-
y:
|
|
1121
|
-
z:
|
|
1122
|
-
perspective:
|
|
1123
|
-
transformPerspective:
|
|
1115
|
+
distance: P,
|
|
1116
|
+
translateX: P,
|
|
1117
|
+
translateY: P,
|
|
1118
|
+
translateZ: P,
|
|
1119
|
+
x: P,
|
|
1120
|
+
y: P,
|
|
1121
|
+
z: P,
|
|
1122
|
+
perspective: P,
|
|
1123
|
+
transformPerspective: P,
|
|
1124
1124
|
opacity: zt,
|
|
1125
1125
|
originX: Bn,
|
|
1126
1126
|
originY: Bn,
|
|
1127
|
-
originZ:
|
|
1127
|
+
originZ: P,
|
|
1128
1128
|
// Misc
|
|
1129
1129
|
zIndex: Nn,
|
|
1130
1130
|
// SVG
|
|
@@ -1162,7 +1162,7 @@ const ln = () => ({
|
|
|
1162
1162
|
});
|
|
1163
1163
|
function ds(t, e, n) {
|
|
1164
1164
|
for (const i in e)
|
|
1165
|
-
!
|
|
1165
|
+
!_(e[i]) && !as(i, n) && (t[i] = e[i]);
|
|
1166
1166
|
}
|
|
1167
1167
|
function Qo({ transformTemplate: t }, e, n) {
|
|
1168
1168
|
return be(() => {
|
|
@@ -1230,7 +1230,7 @@ function na(t, e, n) {
|
|
|
1230
1230
|
return i;
|
|
1231
1231
|
}
|
|
1232
1232
|
function jn(t, e, n) {
|
|
1233
|
-
return typeof t == "string" ? t :
|
|
1233
|
+
return typeof t == "string" ? t : P.transform(e + n * t);
|
|
1234
1234
|
}
|
|
1235
1235
|
function ia(t, e, n) {
|
|
1236
1236
|
const i = jn(e, t.x, t.width), s = jn(n, t.y, t.height);
|
|
@@ -1246,8 +1246,8 @@ const sa = {
|
|
|
1246
1246
|
function oa(t, e, n = 1, i = 0, s = !0) {
|
|
1247
1247
|
t.pathLength = 1;
|
|
1248
1248
|
const o = s ? sa : ra;
|
|
1249
|
-
t[o.offset] =
|
|
1250
|
-
const r =
|
|
1249
|
+
t[o.offset] = P.transform(-i);
|
|
1250
|
+
const r = P.transform(e), a = P.transform(n);
|
|
1251
1251
|
t[o.array] = `${r} ${a}`;
|
|
1252
1252
|
}
|
|
1253
1253
|
function cn(t, {
|
|
@@ -1294,7 +1294,7 @@ function la(t = !1) {
|
|
|
1294
1294
|
...na(i, typeof n == "string", t),
|
|
1295
1295
|
...l,
|
|
1296
1296
|
ref: s
|
|
1297
|
-
}, { children: h } = i, d = be(() =>
|
|
1297
|
+
}, { children: h } = i, d = be(() => _(h) ? h.get() : h, [h]);
|
|
1298
1298
|
return _i(n, {
|
|
1299
1299
|
...u,
|
|
1300
1300
|
children: d
|
|
@@ -1339,13 +1339,13 @@ function vs(t, e, n, i) {
|
|
|
1339
1339
|
function hn(t, e) {
|
|
1340
1340
|
const { style: n } = t, i = {};
|
|
1341
1341
|
for (const s in n)
|
|
1342
|
-
(
|
|
1342
|
+
(_(n[s]) || e.style && _(e.style[s]) || as(s, t)) && (i[s] = n[s]);
|
|
1343
1343
|
return i;
|
|
1344
1344
|
}
|
|
1345
1345
|
function ys(t, e) {
|
|
1346
1346
|
const n = hn(t, e);
|
|
1347
1347
|
for (const i in t)
|
|
1348
|
-
if (
|
|
1348
|
+
if (_(t[i]) || _(e[i])) {
|
|
1349
1349
|
const s = qt.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
|
|
1350
1350
|
n[s] = t[i];
|
|
1351
1351
|
}
|
|
@@ -1360,7 +1360,7 @@ function ca(t) {
|
|
|
1360
1360
|
}
|
|
1361
1361
|
const fe = (t) => Array.isArray(t), ua = (t) => !!(t && typeof t == "object" && t.mix && t.toValue), ha = (t) => fe(t) ? t[t.length - 1] || 0 : t;
|
|
1362
1362
|
function ae(t) {
|
|
1363
|
-
const e =
|
|
1363
|
+
const e = _(t) ? t.get() : t;
|
|
1364
1364
|
return ua(e) ? e.toValue() : e;
|
|
1365
1365
|
}
|
|
1366
1366
|
function da({ scrapeMotionValuesFromProps: t, createRenderState: e, onMount: n }, i, s, o) {
|
|
@@ -1371,7 +1371,7 @@ function da({ scrapeMotionValuesFromProps: t, createRenderState: e, onMount: n }
|
|
|
1371
1371
|
return n && (r.mount = (a) => n(i, a, r)), r;
|
|
1372
1372
|
}
|
|
1373
1373
|
const bs = (t) => (e, n) => {
|
|
1374
|
-
const i =
|
|
1374
|
+
const i = W(xe), s = W(en), o = () => da(t, e, i, s);
|
|
1375
1375
|
return n ? o() : ca(o);
|
|
1376
1376
|
};
|
|
1377
1377
|
function fa(t, e, n, i) {
|
|
@@ -1477,7 +1477,7 @@ function ga(t, e) {
|
|
|
1477
1477
|
return h[d] = (p, m = !1, v = !1) => (n || l(), f.schedule(p, m, v)), h;
|
|
1478
1478
|
}, {}), cancel: (h) => ne.forEach((d) => o[d].cancel(h)), state: s, steps: o };
|
|
1479
1479
|
}
|
|
1480
|
-
const { schedule: V, cancel:
|
|
1480
|
+
const { schedule: V, cancel: et, state: N, steps: Me } = ga(typeof requestAnimationFrame < "u" ? requestAnimationFrame : O, !0), va = {
|
|
1481
1481
|
useVisualState: bs({
|
|
1482
1482
|
scrapeMotionValuesFromProps: ys,
|
|
1483
1483
|
createRenderState: ps,
|
|
@@ -1513,7 +1513,7 @@ function ba(t, { forwardMotionProps: e = !1 }, n, i) {
|
|
|
1513
1513
|
Component: t
|
|
1514
1514
|
};
|
|
1515
1515
|
}
|
|
1516
|
-
function
|
|
1516
|
+
function Z(t, e, n, i = { passive: !0 }) {
|
|
1517
1517
|
return t.addEventListener(e, n, i), () => t.removeEventListener(e, n);
|
|
1518
1518
|
}
|
|
1519
1519
|
const xs = (t) => t.pointerType === "mouse" ? typeof t.button != "number" || t.button <= 0 : t.isPrimary !== !1;
|
|
@@ -1526,8 +1526,8 @@ function Pe(t, e = "page") {
|
|
|
1526
1526
|
};
|
|
1527
1527
|
}
|
|
1528
1528
|
const xa = (t) => (e) => xs(e) && t(e, Pe(e));
|
|
1529
|
-
function
|
|
1530
|
-
return
|
|
1529
|
+
function J(t, e, n, i) {
|
|
1530
|
+
return Z(t, e, xa(n), i);
|
|
1531
1531
|
}
|
|
1532
1532
|
const wa = (t, e) => (n) => e(t(n)), ct = (...t) => t.reduce(wa);
|
|
1533
1533
|
function ws(t) {
|
|
@@ -1572,7 +1572,7 @@ function Wn(t, e) {
|
|
|
1572
1572
|
const a = t.getProps();
|
|
1573
1573
|
t.animationState && a.whileHover && t.animationState.setActive("whileHover", e), a[i] && V.update(() => a[i](o, r));
|
|
1574
1574
|
};
|
|
1575
|
-
return
|
|
1575
|
+
return J(t.current, n, s, {
|
|
1576
1576
|
passive: !t.getProps()[i]
|
|
1577
1577
|
});
|
|
1578
1578
|
}
|
|
@@ -1600,7 +1600,7 @@ class Ta extends ft {
|
|
|
1600
1600
|
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
1601
1601
|
}
|
|
1602
1602
|
mount() {
|
|
1603
|
-
this.unmount = ct(
|
|
1603
|
+
this.unmount = ct(Z(this.node.current, "focus", () => this.onFocus()), Z(this.node.current, "blur", () => this.onBlur()));
|
|
1604
1604
|
}
|
|
1605
1605
|
unmount() {
|
|
1606
1606
|
}
|
|
@@ -1618,14 +1618,14 @@ class Aa extends ft {
|
|
|
1618
1618
|
if (this.isPressing)
|
|
1619
1619
|
return;
|
|
1620
1620
|
this.removeEndListeners();
|
|
1621
|
-
const i = this.node.getProps(), o =
|
|
1621
|
+
const i = this.node.getProps(), o = J(window, "pointerup", (a, l) => {
|
|
1622
1622
|
if (!this.checkPressEnd())
|
|
1623
1623
|
return;
|
|
1624
1624
|
const { onTap: c, onTapCancel: u, globalTapTarget: h } = this.node.getProps();
|
|
1625
1625
|
V.update(() => {
|
|
1626
1626
|
!h && !As(this.node.current, a.target) ? u && u(a, l) : c && c(a, l);
|
|
1627
1627
|
});
|
|
1628
|
-
}, { passive: !(i.onTap || i.onPointerUp) }), r =
|
|
1628
|
+
}, { passive: !(i.onTap || i.onPointerUp) }), r = J(window, "pointercancel", (a, l) => this.cancelPress(a, l), { passive: !(i.onTapCancel || i.onPointerCancel) });
|
|
1629
1629
|
this.removeEndListeners = ct(o, r), this.startPress(e, n);
|
|
1630
1630
|
}, this.startAccessiblePress = () => {
|
|
1631
1631
|
const e = (o) => {
|
|
@@ -1637,12 +1637,12 @@ class Aa extends ft {
|
|
|
1637
1637
|
u && V.update(() => u(l, c));
|
|
1638
1638
|
});
|
|
1639
1639
|
};
|
|
1640
|
-
this.removeEndListeners(), this.removeEndListeners =
|
|
1640
|
+
this.removeEndListeners(), this.removeEndListeners = Z(this.node.current, "keyup", r), Oe("down", (a, l) => {
|
|
1641
1641
|
this.startPress(a, l);
|
|
1642
1642
|
});
|
|
1643
|
-
}, n =
|
|
1643
|
+
}, n = Z(this.node.current, "keydown", e), i = () => {
|
|
1644
1644
|
this.isPressing && Oe("cancel", (o, r) => this.cancelPress(o, r));
|
|
1645
|
-
}, s =
|
|
1645
|
+
}, s = Z(this.node.current, "blur", i);
|
|
1646
1646
|
this.removeAccessibleListeners = ct(n, s);
|
|
1647
1647
|
};
|
|
1648
1648
|
}
|
|
@@ -1661,7 +1661,7 @@ class Aa extends ft {
|
|
|
1661
1661
|
i && V.update(() => i(e, n));
|
|
1662
1662
|
}
|
|
1663
1663
|
mount() {
|
|
1664
|
-
const e = this.node.getProps(), n =
|
|
1664
|
+
const e = this.node.getProps(), n = J(e.globalTapTarget ? window : this.node.current, "pointerdown", this.startPointerPress, { passive: !(e.onTapStart || e.onPointerStart) }), i = Z(this.node.current, "focus", this.startAccessiblePress);
|
|
1665
1665
|
this.removeStartListeners = ct(n, i);
|
|
1666
1666
|
}
|
|
1667
1667
|
unmount() {
|
|
@@ -1762,14 +1762,14 @@ function ke(t, e, n) {
|
|
|
1762
1762
|
const i = t.getProps();
|
|
1763
1763
|
return dn(i, e, n !== void 0 ? n : i.custom, La(t), Ra(t));
|
|
1764
1764
|
}
|
|
1765
|
-
let Qt = O,
|
|
1765
|
+
let Qt = O, $ = O;
|
|
1766
1766
|
process.env.NODE_ENV !== "production" && (Qt = (t, e) => {
|
|
1767
1767
|
!t && typeof console < "u" && console.warn(e);
|
|
1768
|
-
},
|
|
1768
|
+
}, $ = (t, e) => {
|
|
1769
1769
|
if (!t)
|
|
1770
1770
|
throw new Error(e);
|
|
1771
1771
|
});
|
|
1772
|
-
const ut = (t) => t * 1e3,
|
|
1772
|
+
const ut = (t) => t * 1e3, tt = (t) => t / 1e3, Ba = {
|
|
1773
1773
|
current: !1
|
|
1774
1774
|
}, ks = (t) => Array.isArray(t) && typeof t[0] == "number";
|
|
1775
1775
|
function Cs(t) {
|
|
@@ -1835,11 +1835,11 @@ const Wa = Zt(0.42, 0, 1, 1), _a = Zt(0, 0, 0.58, 1), Os = Zt(0.42, 0, 0.58, 1),
|
|
|
1835
1835
|
anticipate: Ya
|
|
1836
1836
|
}, Un = (t) => {
|
|
1837
1837
|
if (Array.isArray(t)) {
|
|
1838
|
-
|
|
1838
|
+
$(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
|
|
1839
1839
|
const [e, n, i, s] = t;
|
|
1840
1840
|
return Zt(e, n, i, s);
|
|
1841
1841
|
} else if (typeof t == "string")
|
|
1842
|
-
return
|
|
1842
|
+
return $(_n[t] !== void 0, `Invalid easing type '${t}'`), _n[t];
|
|
1843
1843
|
return t;
|
|
1844
1844
|
}, mn = (t, e) => (n) => !!(Kt(n) && qo.test(n) && n.startsWith(t) || e && Object.prototype.hasOwnProperty.call(n, e)), Ns = (t, e, n) => (i) => {
|
|
1845
1845
|
if (!Kt(i))
|
|
@@ -1875,7 +1875,7 @@ const He = {
|
|
|
1875
1875
|
}, kt = {
|
|
1876
1876
|
test: mn("hsl", "hue"),
|
|
1877
1877
|
parse: Ns("hue", "saturation", "lightness"),
|
|
1878
|
-
transform: ({ hue: t, saturation: e, lightness: n, alpha: i = 1 }) => "hsla(" + Math.round(t) + ", " +
|
|
1878
|
+
transform: ({ hue: t, saturation: e, lightness: n, alpha: i = 1 }) => "hsla(" + Math.round(t) + ", " + Q.transform(Wt(e)) + ", " + Q.transform(Wt(n)) + ", " + Wt(zt.transform(i)) + ")"
|
|
1879
1879
|
}, I = {
|
|
1880
1880
|
test: (t) => yt.test(t) || He.test(t) || kt.test(t),
|
|
1881
1881
|
parse: (t) => yt.test(t) ? yt.parse(t) : kt.test(t) ? kt.parse(t) : He.parse(t),
|
|
@@ -1906,7 +1906,7 @@ const Be = (t, e, n) => {
|
|
|
1906
1906
|
}, $a = [He, yt, kt], Qa = (t) => $a.find((e) => e.test(t));
|
|
1907
1907
|
function Hn(t) {
|
|
1908
1908
|
const e = Qa(t);
|
|
1909
|
-
|
|
1909
|
+
$(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`);
|
|
1910
1910
|
let n = e.parse(t);
|
|
1911
1911
|
return e === kt && (n = Ka(n)), n;
|
|
1912
1912
|
}
|
|
@@ -2015,7 +2015,7 @@ function il(t, e, n) {
|
|
|
2015
2015
|
}
|
|
2016
2016
|
function Xs(t, e, { clamp: n = !0, ease: i, mixer: s } = {}) {
|
|
2017
2017
|
const o = t.length;
|
|
2018
|
-
if (
|
|
2018
|
+
if ($(o === e.length, "Both input and output ranges must be the same length"), o === 1)
|
|
2019
2019
|
return () => e[0];
|
|
2020
2020
|
t[0] > t[o - 1] && (t = [...t].reverse(), e = [...e].reverse());
|
|
2021
2021
|
const r = il(e, i, s), a = r.length, l = (c) => {
|
|
@@ -2075,7 +2075,7 @@ function dl({ duration: t = 800, bounce: e = 0.25, velocity: n = 0, mass: i = 1
|
|
|
2075
2075
|
let s, o;
|
|
2076
2076
|
Qt(t <= ut(Yn), "Spring duration must be 10 seconds or less");
|
|
2077
2077
|
let r = 1 - e;
|
|
2078
|
-
r = ht(ul, hl, r), t = ht(cl, Yn,
|
|
2078
|
+
r = ht(ul, hl, r), t = ht(cl, Yn, tt(t)), r < 1 ? (s = (c) => {
|
|
2079
2079
|
const u = c * r, h = u * t, d = u - n, f = Ge(c, r), p = Math.exp(-h);
|
|
2080
2080
|
return je - d / f * p;
|
|
2081
2081
|
}, o = (c) => {
|
|
@@ -2140,23 +2140,23 @@ function vl(t) {
|
|
|
2140
2140
|
function $s({ keyframes: t, restDelta: e, restSpeed: n, ...i }) {
|
|
2141
2141
|
const s = t[0], o = t[t.length - 1], r = { done: !1, value: s }, { stiffness: a, damping: l, mass: c, duration: u, velocity: h, isResolvedFromDuration: d } = vl({
|
|
2142
2142
|
...i,
|
|
2143
|
-
velocity: -
|
|
2144
|
-
}), f = h || 0, p = l / (2 * Math.sqrt(a * c)), m = o - s, v =
|
|
2143
|
+
velocity: -tt(i.velocity || 0)
|
|
2144
|
+
}), f = h || 0, p = l / (2 * Math.sqrt(a * c)), m = o - s, v = tt(Math.sqrt(a / c)), y = Math.abs(m) < 5;
|
|
2145
2145
|
n || (n = y ? 0.01 : 2), e || (e = y ? 5e-3 : 0.5);
|
|
2146
2146
|
let b;
|
|
2147
2147
|
if (p < 1) {
|
|
2148
2148
|
const g = Ge(v, p);
|
|
2149
2149
|
b = (x) => {
|
|
2150
|
-
const
|
|
2151
|
-
return o -
|
|
2150
|
+
const S = Math.exp(-p * v * x);
|
|
2151
|
+
return o - S * ((f + p * v * m) / g * Math.sin(g * x) + m * Math.cos(g * x));
|
|
2152
2152
|
};
|
|
2153
2153
|
} else if (p === 1)
|
|
2154
2154
|
b = (g) => o - Math.exp(-v * g) * (m + (f + v * m) * g);
|
|
2155
2155
|
else {
|
|
2156
2156
|
const g = v * Math.sqrt(p * p - 1);
|
|
2157
2157
|
b = (x) => {
|
|
2158
|
-
const
|
|
2159
|
-
return o -
|
|
2158
|
+
const S = Math.exp(-p * v * x), T = Math.min(g * x, 300);
|
|
2159
|
+
return o - S * ((f + p * v * m) * Math.sinh(T) + g * m * Math.cosh(T)) / g;
|
|
2160
2160
|
};
|
|
2161
2161
|
}
|
|
2162
2162
|
return {
|
|
@@ -2166,10 +2166,10 @@ function $s({ keyframes: t, restDelta: e, restSpeed: n, ...i }) {
|
|
|
2166
2166
|
if (d)
|
|
2167
2167
|
r.done = g >= u;
|
|
2168
2168
|
else {
|
|
2169
|
-
let
|
|
2170
|
-
g !== 0 && (p < 1 ?
|
|
2171
|
-
const
|
|
2172
|
-
r.done =
|
|
2169
|
+
let S = f;
|
|
2170
|
+
g !== 0 && (p < 1 ? S = Ks(b, g, x) : S = 0);
|
|
2171
|
+
const T = Math.abs(S) <= n, k = Math.abs(o - x) <= e;
|
|
2172
|
+
r.done = T && k;
|
|
2173
2173
|
}
|
|
2174
2174
|
return r.value = r.done ? o : x, r;
|
|
2175
2175
|
}
|
|
@@ -2179,19 +2179,19 @@ function qn({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: i = 3
|
|
|
2179
2179
|
const h = t[0], d = {
|
|
2180
2180
|
done: !1,
|
|
2181
2181
|
value: h
|
|
2182
|
-
}, f = (
|
|
2182
|
+
}, f = (A) => a !== void 0 && A < a || l !== void 0 && A > l, p = (A) => a === void 0 ? l : l === void 0 || Math.abs(a - A) < Math.abs(l - A) ? a : l;
|
|
2183
2183
|
let m = n * e;
|
|
2184
2184
|
const v = h + m, y = r === void 0 ? v : r(v);
|
|
2185
2185
|
y !== v && (m = y - h);
|
|
2186
|
-
const b = (
|
|
2187
|
-
const C = b(
|
|
2188
|
-
d.done = Math.abs(C) <= c, d.value = d.done ? y :
|
|
2186
|
+
const b = (A) => -m * Math.exp(-A / i), g = (A) => y + b(A), x = (A) => {
|
|
2187
|
+
const C = b(A), q = g(A);
|
|
2188
|
+
d.done = Math.abs(C) <= c, d.value = d.done ? y : q;
|
|
2189
2189
|
};
|
|
2190
|
-
let
|
|
2191
|
-
const k = (
|
|
2192
|
-
f(d.value) && (
|
|
2190
|
+
let S, T;
|
|
2191
|
+
const k = (A) => {
|
|
2192
|
+
f(d.value) && (S = A, T = $s({
|
|
2193
2193
|
keyframes: [d.value, p(d.value)],
|
|
2194
|
-
velocity: Ks(g,
|
|
2194
|
+
velocity: Ks(g, A, d.value),
|
|
2195
2195
|
damping: s,
|
|
2196
2196
|
stiffness: o,
|
|
2197
2197
|
restDelta: c,
|
|
@@ -2200,9 +2200,9 @@ function qn({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: i = 3
|
|
|
2200
2200
|
};
|
|
2201
2201
|
return k(0), {
|
|
2202
2202
|
calculatedDuration: null,
|
|
2203
|
-
next: (
|
|
2203
|
+
next: (A) => {
|
|
2204
2204
|
let C = !1;
|
|
2205
|
-
return !
|
|
2205
|
+
return !T && S === void 0 && (C = !0, x(A), k(A)), S !== void 0 && A > S ? T.next(A - S) : (!C && x(A), d);
|
|
2206
2206
|
}
|
|
2207
2207
|
};
|
|
2208
2208
|
}
|
|
@@ -2210,7 +2210,7 @@ const yl = (t) => {
|
|
|
2210
2210
|
const e = ({ timestamp: n }) => t(n);
|
|
2211
2211
|
return {
|
|
2212
2212
|
start: () => V.update(e, !0),
|
|
2213
|
-
stop: () =>
|
|
2213
|
+
stop: () => et(e),
|
|
2214
2214
|
/**
|
|
2215
2215
|
* If we're processing this frame we can use the
|
|
2216
2216
|
* framelocked timestamp to keep things in sync.
|
|
@@ -2244,44 +2244,44 @@ function ge({ autoplay: t = !0, delay: e = 0, driver: n = yl, keyframes: i, type
|
|
|
2244
2244
|
let b;
|
|
2245
2245
|
const g = bl[s] || me;
|
|
2246
2246
|
let x;
|
|
2247
|
-
g !== me && typeof i[0] != "number" && (process.env.NODE_ENV !== "production" &&
|
|
2247
|
+
g !== me && typeof i[0] != "number" && (process.env.NODE_ENV !== "production" && $(i.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${i}`), x = Xs([0, 100], i, {
|
|
2248
2248
|
clamp: !1
|
|
2249
2249
|
}), i = [0, 100]);
|
|
2250
|
-
const
|
|
2251
|
-
let
|
|
2252
|
-
a === "mirror" && (
|
|
2250
|
+
const S = g({ ...d, keyframes: i });
|
|
2251
|
+
let T;
|
|
2252
|
+
a === "mirror" && (T = g({
|
|
2253
2253
|
...d,
|
|
2254
2254
|
keyframes: [...i].reverse(),
|
|
2255
2255
|
velocity: -(d.velocity || 0)
|
|
2256
2256
|
}));
|
|
2257
|
-
let k = "idle",
|
|
2258
|
-
|
|
2259
|
-
const { calculatedDuration:
|
|
2260
|
-
let
|
|
2261
|
-
|
|
2257
|
+
let k = "idle", A = null, C = null, q = null;
|
|
2258
|
+
S.calculatedDuration === null && o && (S.calculatedDuration = $n(S));
|
|
2259
|
+
const { calculatedDuration: nt } = S;
|
|
2260
|
+
let F = 1 / 0, G = 1 / 0;
|
|
2261
|
+
nt !== null && (F = nt + r, G = F * (o + 1) - r);
|
|
2262
2262
|
let j = 0;
|
|
2263
2263
|
const wt = (E) => {
|
|
2264
2264
|
if (C === null)
|
|
2265
2265
|
return;
|
|
2266
|
-
f > 0 && (C = Math.min(C, E)), f < 0 && (C = Math.min(E -
|
|
2267
|
-
const Rt = j - e * (f >= 0 ? 1 : -1), An = f >= 0 ? Rt < 0 : Rt >
|
|
2268
|
-
j = Math.max(Rt, 0), k === "finished" &&
|
|
2269
|
-
let Pn = j, kn =
|
|
2266
|
+
f > 0 && (C = Math.min(C, E)), f < 0 && (C = Math.min(E - G / f, C)), A !== null ? j = A : j = Math.round(E - C) * f;
|
|
2267
|
+
const Rt = j - e * (f >= 0 ? 1 : -1), An = f >= 0 ? Rt < 0 : Rt > G;
|
|
2268
|
+
j = Math.max(Rt, 0), k === "finished" && A === null && (j = G);
|
|
2269
|
+
let Pn = j, kn = S;
|
|
2270
2270
|
if (o) {
|
|
2271
|
-
const Ce = Math.min(j,
|
|
2271
|
+
const Ce = Math.min(j, G) / F;
|
|
2272
2272
|
let Jt = Math.floor(Ce), pt = Ce % 1;
|
|
2273
|
-
!pt && Ce >= 1 && (pt = 1), pt === 1 && Jt--, Jt = Math.min(Jt, o + 1), !!(Jt % 2) && (a === "reverse" ? (pt = 1 - pt, r && (pt -= r /
|
|
2273
|
+
!pt && Ce >= 1 && (pt = 1), pt === 1 && Jt--, Jt = Math.min(Jt, o + 1), !!(Jt % 2) && (a === "reverse" ? (pt = 1 - pt, r && (pt -= r / F)) : a === "mirror" && (kn = T)), Pn = ht(0, 1, pt) * F;
|
|
2274
2274
|
}
|
|
2275
2275
|
const Bt = An ? { done: !1, value: i[0] } : kn.next(Pn);
|
|
2276
2276
|
x && (Bt.value = x(Bt.value));
|
|
2277
2277
|
let { done: Cn } = Bt;
|
|
2278
|
-
!An &&
|
|
2279
|
-
const Pr =
|
|
2278
|
+
!An && nt !== null && (Cn = f >= 0 ? j >= G : j <= 0);
|
|
2279
|
+
const Pr = A === null && (k === "finished" || k === "running" && Cn);
|
|
2280
2280
|
return h && h(Bt.value), Pr && Lt(), Bt;
|
|
2281
2281
|
}, R = () => {
|
|
2282
2282
|
b && b.stop(), b = void 0;
|
|
2283
2283
|
}, it = () => {
|
|
2284
|
-
k = "idle", R(), m(), y(), C =
|
|
2284
|
+
k = "idle", R(), m(), y(), C = q = null;
|
|
2285
2285
|
}, Lt = () => {
|
|
2286
2286
|
k = "finished", u && u(), R(), m();
|
|
2287
2287
|
}, St = () => {
|
|
@@ -2289,7 +2289,7 @@ function ge({ autoplay: t = !0, delay: e = 0, driver: n = yl, keyframes: i, type
|
|
|
2289
2289
|
return;
|
|
2290
2290
|
b || (b = n(wt));
|
|
2291
2291
|
const E = b.now();
|
|
2292
|
-
l && l(),
|
|
2292
|
+
l && l(), A !== null ? C = E - A : (!C || k === "finished") && (C = E), k === "finished" && y(), q = C, A = null, k = "running", b.start();
|
|
2293
2293
|
};
|
|
2294
2294
|
t && St();
|
|
2295
2295
|
const Tn = {
|
|
@@ -2297,33 +2297,33 @@ function ge({ autoplay: t = !0, delay: e = 0, driver: n = yl, keyframes: i, type
|
|
|
2297
2297
|
return v.then(E, Rt);
|
|
2298
2298
|
},
|
|
2299
2299
|
get time() {
|
|
2300
|
-
return
|
|
2300
|
+
return tt(j);
|
|
2301
2301
|
},
|
|
2302
2302
|
set time(E) {
|
|
2303
|
-
E = ut(E), j = E,
|
|
2303
|
+
E = ut(E), j = E, A !== null || !b || f === 0 ? A = E : C = b.now() - E / f;
|
|
2304
2304
|
},
|
|
2305
2305
|
get duration() {
|
|
2306
|
-
const E =
|
|
2307
|
-
return
|
|
2306
|
+
const E = S.calculatedDuration === null ? $n(S) : S.calculatedDuration;
|
|
2307
|
+
return tt(E);
|
|
2308
2308
|
},
|
|
2309
2309
|
get speed() {
|
|
2310
2310
|
return f;
|
|
2311
2311
|
},
|
|
2312
2312
|
set speed(E) {
|
|
2313
|
-
E === f || !b || (f = E, Tn.time =
|
|
2313
|
+
E === f || !b || (f = E, Tn.time = tt(j));
|
|
2314
2314
|
},
|
|
2315
2315
|
get state() {
|
|
2316
2316
|
return k;
|
|
2317
2317
|
},
|
|
2318
2318
|
play: St,
|
|
2319
2319
|
pause: () => {
|
|
2320
|
-
k = "paused",
|
|
2320
|
+
k = "paused", A = j;
|
|
2321
2321
|
},
|
|
2322
2322
|
stop: () => {
|
|
2323
2323
|
p = !0, k !== "idle" && (k = "idle", c && c(), it());
|
|
2324
2324
|
},
|
|
2325
2325
|
cancel: () => {
|
|
2326
|
-
|
|
2326
|
+
q !== null && wt(q), it();
|
|
2327
2327
|
},
|
|
2328
2328
|
complete: () => {
|
|
2329
2329
|
k = "finished";
|
|
@@ -2361,11 +2361,11 @@ function Pl(t, e, { onUpdate: n, onComplete: i, ...s }) {
|
|
|
2361
2361
|
delay: 0
|
|
2362
2362
|
});
|
|
2363
2363
|
let x = { done: !1, value: h[0] };
|
|
2364
|
-
const
|
|
2365
|
-
let
|
|
2366
|
-
for (; !x.done &&
|
|
2367
|
-
x = g.sample(
|
|
2368
|
-
p = void 0, h =
|
|
2364
|
+
const S = [];
|
|
2365
|
+
let T = 0;
|
|
2366
|
+
for (; !x.done && T < Tl; )
|
|
2367
|
+
x = g.sample(T), S.push(x.value), T += ie;
|
|
2368
|
+
p = void 0, h = S, d = T - ie, f = "linear";
|
|
2369
2369
|
}
|
|
2370
2370
|
const m = Na(t.owner.current, e, h, {
|
|
2371
2371
|
...s,
|
|
@@ -2395,7 +2395,7 @@ function Pl(t, e, { onUpdate: n, onComplete: i, ...s }) {
|
|
|
2395
2395
|
return m.timeline = g, m.onfinish = null, O;
|
|
2396
2396
|
},
|
|
2397
2397
|
get time() {
|
|
2398
|
-
return
|
|
2398
|
+
return tt(m.currentTime || 0);
|
|
2399
2399
|
},
|
|
2400
2400
|
set time(g) {
|
|
2401
2401
|
m.currentTime = ut(g);
|
|
@@ -2407,10 +2407,10 @@ function Pl(t, e, { onUpdate: n, onComplete: i, ...s }) {
|
|
|
2407
2407
|
m.playbackRate = g;
|
|
2408
2408
|
},
|
|
2409
2409
|
get duration() {
|
|
2410
|
-
return
|
|
2410
|
+
return tt(d);
|
|
2411
2411
|
},
|
|
2412
2412
|
play: () => {
|
|
2413
|
-
r || (m.play(),
|
|
2413
|
+
r || (m.play(), et(v));
|
|
2414
2414
|
},
|
|
2415
2415
|
pause: () => m.pause(),
|
|
2416
2416
|
stop: () => {
|
|
@@ -2583,7 +2583,7 @@ const Fl = {
|
|
|
2583
2583
|
return ge(f);
|
|
2584
2584
|
};
|
|
2585
2585
|
function ve(t) {
|
|
2586
|
-
return !!(
|
|
2586
|
+
return !!(_(t) && t.add);
|
|
2587
2587
|
}
|
|
2588
2588
|
const Js = (t) => /^\-?\d*\.?\d+$/.test(t);
|
|
2589
2589
|
function bn(t, e) {
|
|
@@ -2819,7 +2819,7 @@ function Mt(t, e) {
|
|
|
2819
2819
|
const tr = (t) => (e) => e.test(t), _l = {
|
|
2820
2820
|
test: (t) => t === "auto",
|
|
2821
2821
|
parse: (t) => t
|
|
2822
|
-
}, er = [xt,
|
|
2822
|
+
}, er = [xt, P, Q, at, $o, Ko, _l], jt = (t) => er.find(tr(t)), Ul = [...er, I, dt], Hl = (t) => Ul.find(tr(t));
|
|
2823
2823
|
function Gl(t, e, n) {
|
|
2824
2824
|
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, Mt(n));
|
|
2825
2825
|
}
|
|
@@ -2966,34 +2966,34 @@ function sc(t) {
|
|
|
2966
2966
|
const u = t.getProps(), h = t.getVariantContext(!0) || {}, d = [], f = /* @__PURE__ */ new Set();
|
|
2967
2967
|
let p = {}, m = 1 / 0;
|
|
2968
2968
|
for (let y = 0; y < nc; y++) {
|
|
2969
|
-
const b = ec[y], g = n[b], x = u[b] !== void 0 ? u[b] : h[b],
|
|
2970
|
-
|
|
2971
|
-
let k = x === h[b] && x !== u[b] &&
|
|
2969
|
+
const b = ec[y], g = n[b], x = u[b] !== void 0 ? u[b] : h[b], S = Ht(x), T = b === c ? g.isActive : null;
|
|
2970
|
+
T === !1 && (m = y);
|
|
2971
|
+
let k = x === h[b] && x !== u[b] && S;
|
|
2972
2972
|
if (k && i && t.manuallyAnimateOnMount && (k = !1), g.protectedKeys = { ...p }, // If it isn't active and hasn't *just* been set as inactive
|
|
2973
|
-
!g.isActive &&
|
|
2973
|
+
!g.isActive && T === null || // If we didn't and don't have any defined prop for this animation type
|
|
2974
2974
|
!x && !g.prevProp || // Or if the prop doesn't define an animation
|
|
2975
2975
|
Se(x) || typeof x == "boolean")
|
|
2976
2976
|
continue;
|
|
2977
2977
|
let C = rc(g.prevProp, x) || // If we're making this variant active, we want to always make it active
|
|
2978
|
-
b === c && g.isActive && !k &&
|
|
2979
|
-
y > m &&
|
|
2980
|
-
const
|
|
2981
|
-
let
|
|
2982
|
-
|
|
2983
|
-
const { prevResolvedValues:
|
|
2984
|
-
...
|
|
2985
|
-
...
|
|
2978
|
+
b === c && g.isActive && !k && S || // If we removed a higher-priority variant (i is in reverse order)
|
|
2979
|
+
y > m && S, q = !1;
|
|
2980
|
+
const nt = Array.isArray(x) ? x : [x];
|
|
2981
|
+
let F = nt.reduce(s, {});
|
|
2982
|
+
T === !1 && (F = {});
|
|
2983
|
+
const { prevResolvedValues: G = {} } = g, j = {
|
|
2984
|
+
...G,
|
|
2985
|
+
...F
|
|
2986
2986
|
}, wt = (R) => {
|
|
2987
|
-
C = !0, f.has(R) && (
|
|
2987
|
+
C = !0, f.has(R) && (q = !0, f.delete(R)), g.needsAnimating[R] = !0;
|
|
2988
2988
|
};
|
|
2989
2989
|
for (const R in j) {
|
|
2990
|
-
const it =
|
|
2990
|
+
const it = F[R], Lt = G[R];
|
|
2991
2991
|
if (p.hasOwnProperty(R))
|
|
2992
2992
|
continue;
|
|
2993
2993
|
let St = !1;
|
|
2994
2994
|
fe(it) && fe(Lt) ? St = !Ps(it, Lt) : St = it !== Lt, St ? it !== void 0 ? wt(R) : f.add(R) : it !== void 0 && f.has(R) ? wt(R) : g.protectedKeys[R] = !0;
|
|
2995
2995
|
}
|
|
2996
|
-
g.prevProp = x, g.prevResolvedValues =
|
|
2996
|
+
g.prevProp = x, g.prevResolvedValues = F, g.isActive && (p = { ...p, ...F }), i && t.blockInitialAnimation && (C = !1), C && (!k || q) && d.push(...nt.map((R) => ({
|
|
2997
2997
|
animation: R,
|
|
2998
2998
|
options: { type: b, ...l }
|
|
2999
2999
|
})));
|
|
@@ -3136,13 +3136,13 @@ class ir {
|
|
|
3136
3136
|
const r = Pe(e), a = Ie(r, this.transformPagePoint), { point: l } = a, { timestamp: c } = N;
|
|
3137
3137
|
this.history = [{ ...l, timestamp: c }];
|
|
3138
3138
|
const { onSessionStart: u } = n;
|
|
3139
|
-
u && u(e, Fe(a, this.history)), this.removeListeners = ct(
|
|
3139
|
+
u && u(e, Fe(a, this.history)), this.removeListeners = ct(J(this.contextWindow, "pointermove", this.handlePointerMove), J(this.contextWindow, "pointerup", this.handlePointerUp), J(this.contextWindow, "pointercancel", this.handlePointerUp));
|
|
3140
3140
|
}
|
|
3141
3141
|
updateHandlers(e) {
|
|
3142
3142
|
this.handlers = e;
|
|
3143
3143
|
}
|
|
3144
3144
|
end() {
|
|
3145
|
-
this.removeListeners && this.removeListeners(),
|
|
3145
|
+
this.removeListeners && this.removeListeners(), et(this.updatePoint);
|
|
3146
3146
|
}
|
|
3147
3147
|
}
|
|
3148
3148
|
function Ie(t, e) {
|
|
@@ -3174,7 +3174,7 @@ function fc(t, e) {
|
|
|
3174
3174
|
n--;
|
|
3175
3175
|
if (!i)
|
|
3176
3176
|
return { x: 0, y: 0 };
|
|
3177
|
-
const o =
|
|
3177
|
+
const o = tt(s.timestamp - i.timestamp);
|
|
3178
3178
|
if (o === 0)
|
|
3179
3179
|
return { x: 0, y: 0 };
|
|
3180
3180
|
const r = {
|
|
@@ -3183,26 +3183,26 @@ function fc(t, e) {
|
|
|
3183
3183
|
};
|
|
3184
3184
|
return r.x === 1 / 0 && (r.x = 0), r.y === 1 / 0 && (r.y = 0), r;
|
|
3185
3185
|
}
|
|
3186
|
-
function
|
|
3186
|
+
function H(t) {
|
|
3187
3187
|
return t.max - t.min;
|
|
3188
3188
|
}
|
|
3189
3189
|
function Ke(t, e = 0, n = 0.01) {
|
|
3190
3190
|
return Math.abs(t - e) <= n;
|
|
3191
3191
|
}
|
|
3192
3192
|
function ti(t, e, n, i = 0.5) {
|
|
3193
|
-
t.origin = i, t.originPoint = M(e.min, e.max, t.origin), t.scale =
|
|
3193
|
+
t.origin = i, t.originPoint = M(e.min, e.max, t.origin), t.scale = H(n) / H(e), (Ke(t.scale, 1, 1e-4) || isNaN(t.scale)) && (t.scale = 1), t.translate = M(n.min, n.max, t.origin) - t.originPoint, (Ke(t.translate) || isNaN(t.translate)) && (t.translate = 0);
|
|
3194
3194
|
}
|
|
3195
3195
|
function _t(t, e, n, i) {
|
|
3196
3196
|
ti(t.x, e.x, n.x, i ? i.originX : void 0), ti(t.y, e.y, n.y, i ? i.originY : void 0);
|
|
3197
3197
|
}
|
|
3198
3198
|
function ei(t, e, n) {
|
|
3199
|
-
t.min = n.min + e.min, t.max = t.min +
|
|
3199
|
+
t.min = n.min + e.min, t.max = t.min + H(e);
|
|
3200
3200
|
}
|
|
3201
3201
|
function pc(t, e, n) {
|
|
3202
3202
|
ei(t.x, e.x, n.x), ei(t.y, e.y, n.y);
|
|
3203
3203
|
}
|
|
3204
3204
|
function ni(t, e, n) {
|
|
3205
|
-
t.min = e.min - n.min, t.max = t.min +
|
|
3205
|
+
t.min = e.min - n.min, t.max = t.min + H(e);
|
|
3206
3206
|
}
|
|
3207
3207
|
function Ut(t, e, n) {
|
|
3208
3208
|
ni(t.x, e.x, n.x), ni(t.y, e.y, n.y);
|
|
@@ -3234,7 +3234,7 @@ function vc(t, e) {
|
|
|
3234
3234
|
}
|
|
3235
3235
|
function yc(t, e) {
|
|
3236
3236
|
let n = 0.5;
|
|
3237
|
-
const i =
|
|
3237
|
+
const i = H(t), s = H(e);
|
|
3238
3238
|
return s > i ? n = Yt(e.min, e.max - i, t.min) : i > s && (n = Yt(t.min, t.max - s, e.min)), ht(0, 1, n);
|
|
3239
3239
|
}
|
|
3240
3240
|
function bc(t, e) {
|
|
@@ -3269,7 +3269,7 @@ const ai = () => ({
|
|
|
3269
3269
|
x: li(),
|
|
3270
3270
|
y: li()
|
|
3271
3271
|
});
|
|
3272
|
-
function
|
|
3272
|
+
function X(t) {
|
|
3273
3273
|
return [t("x"), t("y")];
|
|
3274
3274
|
}
|
|
3275
3275
|
function rr({ top: t, left: e, right: n, bottom: i }) {
|
|
@@ -3373,13 +3373,13 @@ class Vc {
|
|
|
3373
3373
|
const { drag: d, dragPropagation: f, onDragStart: p } = this.getProps();
|
|
3374
3374
|
if (d && !f && (this.openGlobalLock && this.openGlobalLock(), this.openGlobalLock = Ss(d), !this.openGlobalLock))
|
|
3375
3375
|
return;
|
|
3376
|
-
this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0),
|
|
3376
|
+
this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), X((v) => {
|
|
3377
3377
|
let y = this.getAxisMotionValue(v).get() || 0;
|
|
3378
|
-
if (
|
|
3378
|
+
if (Q.test(y)) {
|
|
3379
3379
|
const { projection: b } = this.visualElement;
|
|
3380
3380
|
if (b && b.layout) {
|
|
3381
3381
|
const g = b.layout.layoutBox[v];
|
|
3382
|
-
g && (y =
|
|
3382
|
+
g && (y = H(g) * (parseFloat(y) / 100));
|
|
3383
3383
|
}
|
|
3384
3384
|
}
|
|
3385
3385
|
this.originPoint[v] = y;
|
|
@@ -3396,7 +3396,7 @@ class Vc {
|
|
|
3396
3396
|
return;
|
|
3397
3397
|
}
|
|
3398
3398
|
this.updateAxis("x", h.point, v), this.updateAxis("y", h.point, v), this.visualElement.render(), m && m(u, h);
|
|
3399
|
-
}, a = (u, h) => this.stop(u, h), l = () =>
|
|
3399
|
+
}, a = (u, h) => this.stop(u, h), l = () => X((u) => {
|
|
3400
3400
|
var h;
|
|
3401
3401
|
return this.getAnimationState(u) === "paused" && ((h = this.getAxisMotionValue(u).animation) === null || h === void 0 ? void 0 : h.play());
|
|
3402
3402
|
}), { dragSnapToOrigin: c } = this.getProps();
|
|
@@ -3439,7 +3439,7 @@ class Vc {
|
|
|
3439
3439
|
resolveConstraints() {
|
|
3440
3440
|
var e;
|
|
3441
3441
|
const { dragConstraints: n, dragElastic: i } = this.getProps(), s = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : (e = this.visualElement.projection) === null || e === void 0 ? void 0 : e.layout, o = this.constraints;
|
|
3442
|
-
n && Pt(n) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : n && s ? this.constraints = gc(s.layoutBox, n) : this.constraints = !1, this.elastic = xc(i), o !== this.constraints && s && this.constraints && !this.hasMutatedConstraints &&
|
|
3442
|
+
n && Pt(n) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : n && s ? this.constraints = gc(s.layoutBox, n) : this.constraints = !1, this.elastic = xc(i), o !== this.constraints && s && this.constraints && !this.hasMutatedConstraints && X((r) => {
|
|
3443
3443
|
this.getAxisMotionValue(r) && (this.constraints[r] = bc(s.layoutBox[r], this.constraints[r]));
|
|
3444
3444
|
});
|
|
3445
3445
|
}
|
|
@@ -3448,7 +3448,7 @@ class Vc {
|
|
|
3448
3448
|
if (!e || !Pt(e))
|
|
3449
3449
|
return !1;
|
|
3450
3450
|
const i = e.current;
|
|
3451
|
-
|
|
3451
|
+
$(i !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
|
|
3452
3452
|
const { projection: s } = this.visualElement;
|
|
3453
3453
|
if (!s || !s.layout)
|
|
3454
3454
|
return !1;
|
|
@@ -3461,7 +3461,7 @@ class Vc {
|
|
|
3461
3461
|
return r;
|
|
3462
3462
|
}
|
|
3463
3463
|
startAnimation(e) {
|
|
3464
|
-
const { drag: n, dragMomentum: i, dragElastic: s, dragTransition: o, dragSnapToOrigin: r, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, c =
|
|
3464
|
+
const { drag: n, dragMomentum: i, dragElastic: s, dragTransition: o, dragSnapToOrigin: r, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, c = X((u) => {
|
|
3465
3465
|
if (!se(u, n, this.currentDirection))
|
|
3466
3466
|
return;
|
|
3467
3467
|
let h = l && l[u] || {};
|
|
@@ -3486,10 +3486,10 @@ class Vc {
|
|
|
3486
3486
|
return i.start(yn(e, i, 0, n));
|
|
3487
3487
|
}
|
|
3488
3488
|
stopAnimation() {
|
|
3489
|
-
|
|
3489
|
+
X((e) => this.getAxisMotionValue(e).stop());
|
|
3490
3490
|
}
|
|
3491
3491
|
pauseAnimation() {
|
|
3492
|
-
|
|
3492
|
+
X((e) => {
|
|
3493
3493
|
var n;
|
|
3494
3494
|
return (n = this.getAxisMotionValue(e).animation) === null || n === void 0 ? void 0 : n.pause();
|
|
3495
3495
|
});
|
|
@@ -3509,7 +3509,7 @@ class Vc {
|
|
|
3509
3509
|
return s || this.visualElement.getValue(e, (i.initial ? i.initial[e] : void 0) || 0);
|
|
3510
3510
|
}
|
|
3511
3511
|
snapToCursor(e) {
|
|
3512
|
-
|
|
3512
|
+
X((n) => {
|
|
3513
3513
|
const { drag: i } = this.getProps();
|
|
3514
3514
|
if (!se(n, i, this.currentDirection))
|
|
3515
3515
|
return;
|
|
@@ -3533,7 +3533,7 @@ class Vc {
|
|
|
3533
3533
|
return;
|
|
3534
3534
|
this.stopAnimation();
|
|
3535
3535
|
const s = { x: 0, y: 0 };
|
|
3536
|
-
|
|
3536
|
+
X((r) => {
|
|
3537
3537
|
const a = this.getAxisMotionValue(r);
|
|
3538
3538
|
if (a) {
|
|
3539
3539
|
const l = a.get();
|
|
@@ -3541,7 +3541,7 @@ class Vc {
|
|
|
3541
3541
|
}
|
|
3542
3542
|
});
|
|
3543
3543
|
const { transformTemplate: o } = this.visualElement.getProps();
|
|
3544
|
-
this.visualElement.current.style.transform = o ? o({}, "") : "none", i.root && i.root.updateScroll(), i.updateLayout(), this.resolveConstraints(),
|
|
3544
|
+
this.visualElement.current.style.transform = o ? o({}, "") : "none", i.root && i.root.updateScroll(), i.updateLayout(), this.resolveConstraints(), X((r) => {
|
|
3545
3545
|
if (!se(r, e, null))
|
|
3546
3546
|
return;
|
|
3547
3547
|
const a = this.getAxisMotionValue(r), { min: l, max: c } = this.constraints[r];
|
|
@@ -3552,7 +3552,7 @@ class Vc {
|
|
|
3552
3552
|
if (!this.visualElement.current)
|
|
3553
3553
|
return;
|
|
3554
3554
|
Cc.set(this.visualElement, this);
|
|
3555
|
-
const e = this.visualElement.current, n =
|
|
3555
|
+
const e = this.visualElement.current, n = J(e, "pointerdown", (l) => {
|
|
3556
3556
|
const { drag: c, dragListener: u = !0 } = this.getProps();
|
|
3557
3557
|
c && u && this.start(l);
|
|
3558
3558
|
}), i = () => {
|
|
@@ -3560,8 +3560,8 @@ class Vc {
|
|
|
3560
3560
|
Pt(l) && (this.constraints = this.resolveRefConstraints());
|
|
3561
3561
|
}, { projection: s } = this.visualElement, o = s.addEventListener("measure", i);
|
|
3562
3562
|
s && !s.layout && (s.root && s.root.updateScroll(), s.updateLayout()), i();
|
|
3563
|
-
const r =
|
|
3564
|
-
this.isDragging && c && (
|
|
3563
|
+
const r = Z(window, "resize", () => this.scalePositionWithinConstraints()), a = s.addEventListener("didUpdate", ({ delta: l, hasLayoutChanged: c }) => {
|
|
3564
|
+
this.isDragging && c && (X((u) => {
|
|
3565
3565
|
const h = this.getAxisMotionValue(u);
|
|
3566
3566
|
h && (this.originPoint[u] += l[u].translate, h.set(h.get() + l[u].translate));
|
|
3567
3567
|
}), this.visualElement.render());
|
|
@@ -3627,7 +3627,7 @@ class Oc extends ft {
|
|
|
3627
3627
|
};
|
|
3628
3628
|
}
|
|
3629
3629
|
mount() {
|
|
3630
|
-
this.removePointerDownListener =
|
|
3630
|
+
this.removePointerDownListener = J(this.node.current, "pointerdown", (e) => this.onPointerDown(e));
|
|
3631
3631
|
}
|
|
3632
3632
|
update() {
|
|
3633
3633
|
this.session && this.session.updateHandlers(this.createPanHandlers());
|
|
@@ -3637,7 +3637,7 @@ class Oc extends ft {
|
|
|
3637
3637
|
}
|
|
3638
3638
|
}
|
|
3639
3639
|
function Dc() {
|
|
3640
|
-
const t =
|
|
3640
|
+
const t = W(en);
|
|
3641
3641
|
if (t === null)
|
|
3642
3642
|
return [!0, null];
|
|
3643
3643
|
const { isPresent: e, onExitComplete: n, register: i } = t, s = Er();
|
|
@@ -3663,7 +3663,7 @@ const It = {
|
|
|
3663
3663
|
if (!e.target)
|
|
3664
3664
|
return t;
|
|
3665
3665
|
if (typeof t == "string")
|
|
3666
|
-
if (
|
|
3666
|
+
if (P.test(t))
|
|
3667
3667
|
t = parseFloat(t);
|
|
3668
3668
|
else
|
|
3669
3669
|
return t;
|
|
@@ -3722,8 +3722,8 @@ class Rc extends zi.Component {
|
|
|
3722
3722
|
}
|
|
3723
3723
|
}
|
|
3724
3724
|
function ur(t) {
|
|
3725
|
-
const [e, n] = Dc(), i =
|
|
3726
|
-
return zi.createElement(Rc, { ...t, layoutGroup: i, switchLayoutGroup:
|
|
3725
|
+
const [e, n] = Dc(), i = W(rs);
|
|
3726
|
+
return zi.createElement(Rc, { ...t, layoutGroup: i, switchLayoutGroup: W(os), isPresent: e, safeToRemove: n });
|
|
3727
3727
|
}
|
|
3728
3728
|
const Bc = {
|
|
3729
3729
|
borderRadius: {
|
|
@@ -3740,7 +3740,7 @@ const Bc = {
|
|
|
3740
3740
|
borderBottomLeftRadius: It,
|
|
3741
3741
|
borderBottomRightRadius: It,
|
|
3742
3742
|
boxShadow: Lc
|
|
3743
|
-
}, hr = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], Nc = hr.length, mi = (t) => typeof t == "string" ? parseFloat(t) : t, gi = (t) => typeof t == "number" ||
|
|
3743
|
+
}, hr = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], Nc = hr.length, mi = (t) => typeof t == "string" ? parseFloat(t) : t, gi = (t) => typeof t == "number" || P.test(t);
|
|
3744
3744
|
function jc(t, e, n, i, s, o) {
|
|
3745
3745
|
s ? (t.opacity = M(
|
|
3746
3746
|
0,
|
|
@@ -3753,7 +3753,7 @@ function jc(t, e, n, i, s, o) {
|
|
|
3753
3753
|
let l = vi(e, a), c = vi(n, a);
|
|
3754
3754
|
if (l === void 0 && c === void 0)
|
|
3755
3755
|
continue;
|
|
3756
|
-
l || (l = 0), c || (c = 0), l === 0 || c === 0 || gi(l) === gi(c) ? (t[a] = Math.max(M(mi(l), mi(c), i), 0), (
|
|
3756
|
+
l || (l = 0), c || (c = 0), l === 0 || c === 0 || gi(l) === gi(c) ? (t[a] = Math.max(M(mi(l), mi(c), i), 0), (Q.test(c) || Q.test(l)) && (t[a] += "%")) : t[a] = c;
|
|
3757
3757
|
}
|
|
3758
3758
|
(e.rotate || n.rotate) && (t.rotate = M(e.rotate || 0, n.rotate || 0, i));
|
|
3759
3759
|
}
|
|
@@ -3767,14 +3767,14 @@ function dr(t, e, n) {
|
|
|
3767
3767
|
function yi(t, e) {
|
|
3768
3768
|
t.min = e.min, t.max = e.max;
|
|
3769
3769
|
}
|
|
3770
|
-
function
|
|
3770
|
+
function Y(t, e) {
|
|
3771
3771
|
yi(t.x, e.x), yi(t.y, e.y);
|
|
3772
3772
|
}
|
|
3773
3773
|
function bi(t, e, n, i, s) {
|
|
3774
3774
|
return t -= e, t = ye(t, 1 / n, i), s !== void 0 && (t = ye(t, 1 / s, i)), t;
|
|
3775
3775
|
}
|
|
3776
3776
|
function zc(t, e = 0, n = 1, i = 0.5, s, o = t, r = t) {
|
|
3777
|
-
if (
|
|
3777
|
+
if (Q.test(e) && (e = parseFloat(e), e = M(r.min, r.max, e / 100) - r.min), typeof e != "number")
|
|
3778
3778
|
return;
|
|
3779
3779
|
let a = M(o.min, o.max, i);
|
|
3780
3780
|
t === o && (a -= e), t.min = bi(t.min, e, n, a, s), t.max = bi(t.max, e, n, a, s);
|
|
@@ -3799,7 +3799,7 @@ function pr(t, e) {
|
|
|
3799
3799
|
return Math.round(t.x.min) === Math.round(e.x.min) && Math.round(t.x.max) === Math.round(e.x.max) && Math.round(t.y.min) === Math.round(e.y.min) && Math.round(t.y.max) === Math.round(e.y.max);
|
|
3800
3800
|
}
|
|
3801
3801
|
function Ti(t) {
|
|
3802
|
-
return
|
|
3802
|
+
return H(t.x) / H(t.y);
|
|
3803
3803
|
}
|
|
3804
3804
|
class Hc {
|
|
3805
3805
|
constructor() {
|
|
@@ -3883,9 +3883,9 @@ class Yc {
|
|
|
3883
3883
|
function Xc(t, e) {
|
|
3884
3884
|
const n = performance.now(), i = ({ timestamp: s }) => {
|
|
3885
3885
|
const o = s - n;
|
|
3886
|
-
o >= e && (
|
|
3886
|
+
o >= e && (et(i), t(o - e));
|
|
3887
3887
|
};
|
|
3888
|
-
return V.read(i, !0), () =>
|
|
3888
|
+
return V.read(i, !0), () => et(i);
|
|
3889
3889
|
}
|
|
3890
3890
|
function qc(t) {
|
|
3891
3891
|
window.MotionDebug && window.MotionDebug.record(t);
|
|
@@ -3894,7 +3894,7 @@ function Kc(t) {
|
|
|
3894
3894
|
return t instanceof SVGElement && t.tagName !== "svg";
|
|
3895
3895
|
}
|
|
3896
3896
|
function $c(t, e, n) {
|
|
3897
|
-
const i =
|
|
3897
|
+
const i = _(t) ? t : Mt(t);
|
|
3898
3898
|
return i.start(yn("", i, e, n)), i.animation;
|
|
3899
3899
|
}
|
|
3900
3900
|
const Pi = ["", "X", "Y", "Z"], Qc = { visibility: "hidden" }, ki = 1e3;
|
|
@@ -3964,7 +3964,7 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
3964
3964
|
unmount() {
|
|
3965
3965
|
this.options.layoutId && this.willUpdate(), this.root.nodes.remove(this);
|
|
3966
3966
|
const r = this.getStack();
|
|
3967
|
-
r && r.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0,
|
|
3967
|
+
r && r.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0, et(this.updateProjection);
|
|
3968
3968
|
}
|
|
3969
3969
|
// only on the root
|
|
3970
3970
|
blockUpdate() {
|
|
@@ -4080,12 +4080,12 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4080
4080
|
}
|
|
4081
4081
|
removeElementScroll(r) {
|
|
4082
4082
|
const a = L();
|
|
4083
|
-
|
|
4083
|
+
Y(a, r);
|
|
4084
4084
|
for (let l = 0; l < this.path.length; l++) {
|
|
4085
4085
|
const c = this.path[l], { scroll: u, options: h } = c;
|
|
4086
4086
|
if (c !== this.root && u && h.layoutScroll) {
|
|
4087
4087
|
if (u.isRoot) {
|
|
4088
|
-
|
|
4088
|
+
Y(a, r);
|
|
4089
4089
|
const { scroll: d } = this.root;
|
|
4090
4090
|
d && (lt(a.x, -d.offset.x), lt(a.y, -d.offset.y));
|
|
4091
4091
|
}
|
|
@@ -4096,7 +4096,7 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4096
4096
|
}
|
|
4097
4097
|
applyTransform(r, a = !1) {
|
|
4098
4098
|
const l = L();
|
|
4099
|
-
|
|
4099
|
+
Y(l, r);
|
|
4100
4100
|
for (let c = 0; c < this.path.length; c++) {
|
|
4101
4101
|
const u = this.path[c];
|
|
4102
4102
|
!a && u.options.layoutScroll && u.scroll && u !== u.root && Vt(l, {
|
|
@@ -4108,14 +4108,14 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4108
4108
|
}
|
|
4109
4109
|
removeTransform(r) {
|
|
4110
4110
|
const a = L();
|
|
4111
|
-
|
|
4111
|
+
Y(a, r);
|
|
4112
4112
|
for (let l = 0; l < this.path.length; l++) {
|
|
4113
4113
|
const c = this.path[l];
|
|
4114
4114
|
if (!c.instance || !gt(c.latestValues))
|
|
4115
4115
|
continue;
|
|
4116
4116
|
Qe(c.latestValues) && c.updateSnapshot();
|
|
4117
4117
|
const u = L(), h = c.measurePageBox();
|
|
4118
|
-
|
|
4118
|
+
Y(u, h), wi(a, c.latestValues, c.snapshot ? c.snapshot.layoutBox : void 0, u);
|
|
4119
4119
|
}
|
|
4120
4120
|
return gt(this.latestValues) && wi(a, this.latestValues), a;
|
|
4121
4121
|
}
|
|
@@ -4146,13 +4146,13 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4146
4146
|
if (!(!this.layout || !(h || d))) {
|
|
4147
4147
|
if (this.resolvedRelativeTargetAt = N.timestamp, !this.targetDelta && !this.relativeTarget) {
|
|
4148
4148
|
const f = this.getClosestProjectingParent();
|
|
4149
|
-
f && f.layout && this.animationProgress !== 1 ? (this.relativeParent = f, this.forceRelativeParentToResolveTarget(), this.relativeTarget = L(), this.relativeTargetOrigin = L(), Ut(this.relativeTargetOrigin, this.layout.layoutBox, f.layout.layoutBox),
|
|
4149
|
+
f && f.layout && this.animationProgress !== 1 ? (this.relativeParent = f, this.forceRelativeParentToResolveTarget(), this.relativeTarget = L(), this.relativeTargetOrigin = L(), Ut(this.relativeTargetOrigin, this.layout.layoutBox, f.layout.layoutBox), Y(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
|
|
4150
4150
|
}
|
|
4151
4151
|
if (!(!this.relativeTarget && !this.targetDelta)) {
|
|
4152
|
-
if (this.target || (this.target = L(), this.targetWithTransforms = L()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), pc(this.target, this.relativeTarget, this.relativeParent.target)) : this.targetDelta ? (this.resumingFrom ? this.target = this.applyTransform(this.layout.layoutBox) :
|
|
4152
|
+
if (this.target || (this.target = L(), this.targetWithTransforms = L()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), pc(this.target, this.relativeTarget, this.relativeParent.target)) : this.targetDelta ? (this.resumingFrom ? this.target = this.applyTransform(this.layout.layoutBox) : Y(this.target, this.layout.layoutBox), ar(this.target, this.targetDelta)) : Y(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget) {
|
|
4153
4153
|
this.attemptToResolveRelativeTarget = !1;
|
|
4154
4154
|
const f = this.getClosestProjectingParent();
|
|
4155
|
-
f && !!f.resumingFrom == !!this.resumingFrom && !f.options.layoutScroll && f.target && this.animationProgress !== 1 ? (this.relativeParent = f, this.forceRelativeParentToResolveTarget(), this.relativeTarget = L(), this.relativeTargetOrigin = L(), Ut(this.relativeTargetOrigin, this.target, f.target),
|
|
4155
|
+
f && !!f.resumingFrom == !!this.resumingFrom && !f.options.layoutScroll && f.target && this.animationProgress !== 1 ? (this.relativeParent = f, this.forceRelativeParentToResolveTarget(), this.relativeTarget = L(), this.relativeTargetOrigin = L(), Ut(this.relativeTargetOrigin, this.target, f.target), Y(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
|
|
4156
4156
|
}
|
|
4157
4157
|
vt.resolvedTargetDeltas++;
|
|
4158
4158
|
}
|
|
@@ -4174,7 +4174,7 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4174
4174
|
const { layout: u, layoutId: h } = this.options;
|
|
4175
4175
|
if (this.isTreeAnimating = !!(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation), this.isTreeAnimating || (this.targetDelta = this.relativeTarget = void 0), !this.layout || !(u || h))
|
|
4176
4176
|
return;
|
|
4177
|
-
|
|
4177
|
+
Y(this.layoutCorrected, this.layout.layoutBox);
|
|
4178
4178
|
const d = this.treeScale.x, f = this.treeScale.y;
|
|
4179
4179
|
Tc(this.layoutCorrected, this.treeScale, this.path, l), a.layout && !a.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1) && (a.target = a.layout.layoutBox);
|
|
4180
4180
|
const { target: p } = a;
|
|
@@ -4206,12 +4206,12 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4206
4206
|
this.animationProgress = 0;
|
|
4207
4207
|
let g;
|
|
4208
4208
|
this.mixTargetDelta = (x) => {
|
|
4209
|
-
const
|
|
4210
|
-
Ei(h.x, r.x,
|
|
4209
|
+
const S = x / 1e3;
|
|
4210
|
+
Ei(h.x, r.x, S), Ei(h.y, r.y, S), this.setTargetDelta(h), this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout && (Ut(d, this.layout.layoutBox, this.relativeParent.layout.layoutBox), uu(this.relativeTarget, this.relativeTargetOrigin, d, S), g && Uc(this.relativeTarget, g) && (this.isProjectionDirty = !1), g || (g = L()), Y(g, this.relativeTarget)), m && (this.animationValues = u, jc(u, c, this.latestValues, S, b, y)), this.root.scheduleUpdateProjection(), this.scheduleRender(), this.animationProgress = S;
|
|
4211
4211
|
}, this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
|
|
4212
4212
|
}
|
|
4213
4213
|
startAnimation(r) {
|
|
4214
|
-
this.notifyListeners("animationStart"), this.currentAnimation && this.currentAnimation.stop(), this.resumingFrom && this.resumingFrom.currentAnimation && this.resumingFrom.currentAnimation.stop(), this.pendingAnimation && (
|
|
4214
|
+
this.notifyListeners("animationStart"), this.currentAnimation && this.currentAnimation.stop(), this.resumingFrom && this.resumingFrom.currentAnimation && this.resumingFrom.currentAnimation.stop(), this.pendingAnimation && (et(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = V.update(() => {
|
|
4215
4215
|
le.hasAnimatedSinceResize = !0, this.currentAnimation = $c(0, ki, {
|
|
4216
4216
|
...r,
|
|
4217
4217
|
onUpdate: (a) => {
|
|
@@ -4237,12 +4237,12 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4237
4237
|
if (!(!a || !l || !c)) {
|
|
4238
4238
|
if (this !== r && this.layout && c && gr(this.options.animationType, this.layout.layoutBox, c.layoutBox)) {
|
|
4239
4239
|
l = this.target || L();
|
|
4240
|
-
const h =
|
|
4240
|
+
const h = H(this.layout.layoutBox.x);
|
|
4241
4241
|
l.x.min = r.target.x.min, l.x.max = l.x.min + h;
|
|
4242
|
-
const d =
|
|
4242
|
+
const d = H(this.layout.layoutBox.y);
|
|
4243
4243
|
l.y.min = r.target.y.min, l.y.max = l.y.min + d;
|
|
4244
4244
|
}
|
|
4245
|
-
|
|
4245
|
+
Y(a, l), Vt(a, u), _t(this.projectionDeltaWithTransform, this.layoutCorrected, a, u);
|
|
4246
4246
|
}
|
|
4247
4247
|
}
|
|
4248
4248
|
registerSharedNode(r, a) {
|
|
@@ -4351,11 +4351,11 @@ function tu(t) {
|
|
|
4351
4351
|
const n = ((e = t.resumeFrom) === null || e === void 0 ? void 0 : e.snapshot) || t.snapshot;
|
|
4352
4352
|
if (t.isLead() && t.layout && n && t.hasListeners("didUpdate")) {
|
|
4353
4353
|
const { layoutBox: i, measuredBox: s } = t.layout, { animationType: o } = t.options, r = n.source !== t.layout.source;
|
|
4354
|
-
o === "size" ?
|
|
4355
|
-
const d = r ? n.measuredBox[h] : n.layoutBox[h], f =
|
|
4354
|
+
o === "size" ? X((h) => {
|
|
4355
|
+
const d = r ? n.measuredBox[h] : n.layoutBox[h], f = H(d);
|
|
4356
4356
|
d.min = i[h].min, d.max = d.min + f;
|
|
4357
|
-
}) : gr(o, n.layoutBox, i) &&
|
|
4358
|
-
const d = r ? n.measuredBox[h] : n.layoutBox[h], f =
|
|
4357
|
+
}) : gr(o, n.layoutBox, i) && X((h) => {
|
|
4358
|
+
const d = r ? n.measuredBox[h] : n.layoutBox[h], f = H(i[h]);
|
|
4359
4359
|
d.max = d.min + f, t.relativeTarget && !t.currentAnimation && (t.isProjectionDirty = !0, t.relativeTarget[h].max = t.relativeTarget[h].min + f);
|
|
4360
4360
|
});
|
|
4361
4361
|
const a = Ct();
|
|
@@ -4450,7 +4450,7 @@ function gr(t, e, n) {
|
|
|
4450
4450
|
return t === "position" || t === "preserve-aspect" && !Ke(Ti(e), Ti(n), 0.2);
|
|
4451
4451
|
}
|
|
4452
4452
|
const pu = mr({
|
|
4453
|
-
attachResizeListener: (t, e) =>
|
|
4453
|
+
attachResizeListener: (t, e) => Z(t, "resize", e),
|
|
4454
4454
|
measureScroll: () => ({
|
|
4455
4455
|
x: document.documentElement.scrollLeft || document.body.scrollLeft,
|
|
4456
4456
|
y: document.documentElement.scrollTop || document.body.scrollTop
|
|
@@ -4493,7 +4493,7 @@ function vu(t) {
|
|
|
4493
4493
|
}
|
|
4494
4494
|
const yu = 4;
|
|
4495
4495
|
function Je(t, e, n = 1) {
|
|
4496
|
-
|
|
4496
|
+
$(n <= yu, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);
|
|
4497
4497
|
const [i, s] = vu(t);
|
|
4498
4498
|
if (!i)
|
|
4499
4499
|
return;
|
|
@@ -4535,7 +4535,7 @@ const xu = /* @__PURE__ */ new Set([
|
|
|
4535
4535
|
"y",
|
|
4536
4536
|
"translateX",
|
|
4537
4537
|
"translateY"
|
|
4538
|
-
]), yr = (t) => xu.has(t), wu = (t) => Object.keys(t).some(yr), re = (t) => t === xt || t ===
|
|
4538
|
+
]), yr = (t) => xu.has(t), wu = (t) => Object.keys(t).some(yr), re = (t) => t === xt || t === P, Ri = (t, e) => parseFloat(t.split(", ")[e]), Bi = (t, e) => (n, { transform: i }) => {
|
|
4539
4539
|
if (i === "none" || !i)
|
|
4540
4540
|
return 0;
|
|
4541
4541
|
const s = i.match(/^matrix3d\((.+)\)$/);
|
|
@@ -4593,13 +4593,13 @@ const Pu = (t, e, n) => {
|
|
|
4593
4593
|
const p = d.length, m = d[0] === null ? 1 : 0;
|
|
4594
4594
|
u = d[m], h = jt(u);
|
|
4595
4595
|
for (let v = m; v < p && d[v] !== null; v++)
|
|
4596
|
-
f ?
|
|
4596
|
+
f ? $(jt(d[v]) === f, "All keyframes must be of the same type") : (f = jt(d[v]), $(f === h || re(h) && re(f), "Keyframes must be of the same dimension as the current value"));
|
|
4597
4597
|
} else
|
|
4598
4598
|
f = jt(d);
|
|
4599
4599
|
if (h !== f)
|
|
4600
4600
|
if (re(h) && re(f)) {
|
|
4601
4601
|
const p = c.get();
|
|
4602
|
-
typeof p == "string" && c.set(parseFloat(p)), typeof d == "string" ? e[l] = parseFloat(d) : Array.isArray(d) && f ===
|
|
4602
|
+
typeof p == "string" && c.set(parseFloat(p)), typeof d == "string" ? e[l] = parseFloat(d) : Array.isArray(d) && f === P && (e[l] = d.map(parseFloat));
|
|
4603
4603
|
} else
|
|
4604
4604
|
h != null && h.transform && (f != null && f.transform) && (u === 0 || d === 0) ? u === 0 ? c.set(f.transform(u)) : e[l] = h.transform(d) : (r || (o = Au(t), r = !0), a.push(l), i[l] = i[l] !== void 0 ? i[l] : e[l], c.jump(d));
|
|
4605
4605
|
}), a.length) {
|
|
@@ -4629,9 +4629,9 @@ function Mu(t, e, n) {
|
|
|
4629
4629
|
const { willChange: i } = e;
|
|
4630
4630
|
for (const s in e) {
|
|
4631
4631
|
const o = e[s], r = n[s];
|
|
4632
|
-
if (
|
|
4632
|
+
if (_(o))
|
|
4633
4633
|
t.addValue(s, o), ve(i) && i.add(s), process.env.NODE_ENV === "development" && Sn(o.version === "10.18.0", `Attempting to mix Framer Motion versions ${o.version} with 10.18.0 may not work as expected.`);
|
|
4634
|
-
else if (
|
|
4634
|
+
else if (_(r))
|
|
4635
4635
|
t.addValue(s, Mt(o, { owner: t })), ve(i) && i.remove(s);
|
|
4636
4636
|
else if (r !== o)
|
|
4637
4637
|
if (t.hasValue(s)) {
|
|
@@ -4665,7 +4665,7 @@ class Lu {
|
|
|
4665
4665
|
const { willChange: c, ...u } = this.scrapeMotionValuesFromProps(n, {});
|
|
4666
4666
|
for (const h in u) {
|
|
4667
4667
|
const d = u[h];
|
|
4668
|
-
a[h] !== void 0 &&
|
|
4668
|
+
a[h] !== void 0 && _(d) && (d.set(a[h], !1), ve(c) && c.add(h));
|
|
4669
4669
|
}
|
|
4670
4670
|
}
|
|
4671
4671
|
/**
|
|
@@ -4682,7 +4682,7 @@ class Lu {
|
|
|
4682
4682
|
this.current = e, Ni.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, i) => this.bindToMotionValue(i, n)), br.current || Eu(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : tn.current, process.env.NODE_ENV !== "production" && Sn(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
|
|
4683
4683
|
}
|
|
4684
4684
|
unmount() {
|
|
4685
|
-
Ni.delete(this.current), this.projection && this.projection.unmount(),
|
|
4685
|
+
Ni.delete(this.current), this.projection && this.projection.unmount(), et(this.notifyUpdate), et(this.render), this.valueSubscriptions.forEach((e) => e()), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
|
|
4686
4686
|
for (const e in this.events)
|
|
4687
4687
|
this.events[e].clear();
|
|
4688
4688
|
for (const e in this.features)
|
|
@@ -4704,7 +4704,7 @@ class Lu {
|
|
|
4704
4704
|
let r, a;
|
|
4705
4705
|
if (process.env.NODE_ENV !== "production" && s && i) {
|
|
4706
4706
|
const l = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
4707
|
-
n.ignoreStrict ? Qt(!1, l) :
|
|
4707
|
+
n.ignoreStrict ? Qt(!1, l) : $(!1, l);
|
|
4708
4708
|
}
|
|
4709
4709
|
for (let l = 0; l < Ou; l++) {
|
|
4710
4710
|
const c = xr[l], { isEnabled: u, Feature: h, ProjectionNode: d, MeasureLayout: f } = Gt[c];
|
|
@@ -4876,7 +4876,7 @@ class Lu {
|
|
|
4876
4876
|
if (i && s !== void 0)
|
|
4877
4877
|
return s;
|
|
4878
4878
|
const o = this.getBaseTargetFromProps(this.props, e);
|
|
4879
|
-
return o !== void 0 && !
|
|
4879
|
+
return o !== void 0 && !_(o) ? o : this.initialValues[e] !== void 0 && s === void 0 ? void 0 : this.baseTarget[e];
|
|
4880
4880
|
}
|
|
4881
4881
|
on(e, n) {
|
|
4882
4882
|
return this.events[e] || (this.events[e] = new wn()), this.events[e].add(n);
|
|
@@ -4937,7 +4937,7 @@ class Bu extends wr {
|
|
|
4937
4937
|
handleChildMotionValue() {
|
|
4938
4938
|
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
4939
4939
|
const { children: e } = this.props;
|
|
4940
|
-
|
|
4940
|
+
_(e) && (this.childSubscription = e.on("change", (n) => {
|
|
4941
4941
|
this.current && (this.current.textContent = `${n}`);
|
|
4942
4942
|
}));
|
|
4943
4943
|
}
|
|
@@ -4987,7 +4987,27 @@ const ju = (t, e) => on(t) ? new Nu(e, { enableHardwareAcceleration: !1 }) : new
|
|
|
4987
4987
|
...Iu
|
|
4988
4988
|
}, Sr = /* @__PURE__ */ zo((t, e) => ba(t, e, Fu, ju));
|
|
4989
4989
|
function zu(t) {
|
|
4990
|
-
|
|
4990
|
+
return /* @__PURE__ */ w(
|
|
4991
|
+
"svg",
|
|
4992
|
+
{
|
|
4993
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4994
|
+
width: "16",
|
|
4995
|
+
height: "16",
|
|
4996
|
+
fill: "currentColor",
|
|
4997
|
+
viewBox: "0 0 16 16",
|
|
4998
|
+
...t,
|
|
4999
|
+
children: /* @__PURE__ */ w(
|
|
5000
|
+
"path",
|
|
5001
|
+
{
|
|
5002
|
+
fill: "currenColor",
|
|
5003
|
+
d: "M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"
|
|
5004
|
+
}
|
|
5005
|
+
)
|
|
5006
|
+
}
|
|
5007
|
+
);
|
|
5008
|
+
}
|
|
5009
|
+
function Wu(t) {
|
|
5010
|
+
const { children: e, parentRef: n, onlyChild: i } = t, [s, o] = K({ top: 0, left: 0 });
|
|
4991
5011
|
return Wi(() => {
|
|
4992
5012
|
if (n.current) {
|
|
4993
5013
|
const r = n.current.getBoundingClientRect();
|
|
@@ -5012,54 +5032,34 @@ function zu(t) {
|
|
|
5012
5032
|
n.current
|
|
5013
5033
|
);
|
|
5014
5034
|
}
|
|
5015
|
-
function Wu(t) {
|
|
5016
|
-
return /* @__PURE__ */ w(
|
|
5017
|
-
"svg",
|
|
5018
|
-
{
|
|
5019
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
5020
|
-
width: "16",
|
|
5021
|
-
height: "16",
|
|
5022
|
-
fill: "currentColor",
|
|
5023
|
-
viewBox: "0 0 16 16",
|
|
5024
|
-
...t,
|
|
5025
|
-
children: /* @__PURE__ */ w(
|
|
5026
|
-
"path",
|
|
5027
|
-
{
|
|
5028
|
-
fill: "currenColor",
|
|
5029
|
-
d: "M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"
|
|
5030
|
-
}
|
|
5031
|
-
)
|
|
5032
|
-
}
|
|
5033
|
-
);
|
|
5034
|
-
}
|
|
5035
5035
|
function Tr({ item: t, level: e = 0, ...n }) {
|
|
5036
|
-
var
|
|
5037
|
-
const { isActive: i, isCollapsed: s, expanded: o, toggleExpand: r } = n, a = `level-${e}`, l = s ? "collapsed" : "expanded", c = i(t.id) ? "active" : "", u = (
|
|
5038
|
-
function m(
|
|
5039
|
-
var
|
|
5040
|
-
const { level:
|
|
5041
|
-
return !h || s &&
|
|
5042
|
-
|
|
5036
|
+
var k;
|
|
5037
|
+
const { isActive: i, isCollapsed: s, expanded: o, toggleExpand: r } = n, a = `level-${e}`, l = s ? "collapsed" : "expanded", c = i(t.id) ? "active" : "", u = (A, C = a) => `${A} ${C} ${l} ${c}`, h = !!((k = t.children) != null && k.length), [d, f] = K(!1), p = Et();
|
|
5038
|
+
function m(A) {
|
|
5039
|
+
var F;
|
|
5040
|
+
const { level: C, hovered: q, parentRef: nt } = A;
|
|
5041
|
+
return !h || s && C >= 2 && !q ? null : /* @__PURE__ */ w(
|
|
5042
|
+
Wu,
|
|
5043
5043
|
{
|
|
5044
|
-
parentRef:
|
|
5045
|
-
onlyChild: !s || s &&
|
|
5044
|
+
parentRef: nt,
|
|
5045
|
+
onlyChild: !s || s && C < 2,
|
|
5046
5046
|
children: /* @__PURE__ */ w(
|
|
5047
5047
|
Sr.div,
|
|
5048
5048
|
{
|
|
5049
|
-
className: u("menu-item__dropdown", `level-${
|
|
5049
|
+
className: u("menu-item__dropdown", `level-${C}`),
|
|
5050
5050
|
initial: { height: s ? "auto" : 0 },
|
|
5051
5051
|
animate: {
|
|
5052
5052
|
height: s || o(t.id) ? "auto" : 0
|
|
5053
5053
|
},
|
|
5054
5054
|
transition: { duration: 0.2 },
|
|
5055
|
-
children: (
|
|
5055
|
+
children: (F = t.children) == null ? void 0 : F.map((G) => /* @__PURE__ */ _i(Tr, { ...n, key: G.id, item: G, level: C }))
|
|
5056
5056
|
},
|
|
5057
5057
|
+s
|
|
5058
5058
|
)
|
|
5059
5059
|
}
|
|
5060
5060
|
);
|
|
5061
5061
|
}
|
|
5062
|
-
const v =
|
|
5062
|
+
const v = window.location.origin, y = t.path && t.path.includes("http") ? new URL(t.path) : { origin: "", pathname: "" }, b = window.location.pathname.split("/")[1], g = y.pathname.split("/")[1], x = n.ssr || !v.includes("local") && v !== y.origin || g !== b, S = h ? "div" : x ? "a" : Nr, T = t.path && n.replacePath ? n.replacePath(t.path) : t.path || "#";
|
|
5063
5063
|
return /* @__PURE__ */ B(
|
|
5064
5064
|
"div",
|
|
5065
5065
|
{
|
|
@@ -5069,21 +5069,22 @@ function Tr({ item: t, level: e = 0, ...n }) {
|
|
|
5069
5069
|
onMouseLeave: () => s && f(!1),
|
|
5070
5070
|
children: [
|
|
5071
5071
|
/* @__PURE__ */ B(
|
|
5072
|
-
|
|
5072
|
+
S,
|
|
5073
5073
|
{
|
|
5074
|
-
|
|
5074
|
+
to: T,
|
|
5075
|
+
href: T,
|
|
5075
5076
|
style: {
|
|
5076
5077
|
paddingLeft: `${s ? "0.5rem" : `${e * 1}rem`}`
|
|
5077
5078
|
},
|
|
5078
5079
|
className: u("menu-item__link"),
|
|
5079
|
-
onClick: (
|
|
5080
|
-
h && (
|
|
5080
|
+
onClick: (A) => {
|
|
5081
|
+
h && (A.preventDefault(), s || r(t.id));
|
|
5081
5082
|
},
|
|
5082
5083
|
children: [
|
|
5083
5084
|
e !== 0 && /* @__PURE__ */ w(_u, { cls: u, item: t }),
|
|
5084
5085
|
/* @__PURE__ */ w("span", { className: u("menu-item__label"), children: t.name }),
|
|
5085
5086
|
h && /* @__PURE__ */ w("div", { className: u("menu-item__icon-arrow__wrapper"), children: /* @__PURE__ */ w(
|
|
5086
|
-
|
|
5087
|
+
zu,
|
|
5087
5088
|
{
|
|
5088
5089
|
className: u(
|
|
5089
5090
|
`menu-item__icon-arrow__icon ${o(t.id) ? "open" : "close"}`
|
|
@@ -5101,7 +5102,7 @@ function Tr({ item: t, level: e = 0, ...n }) {
|
|
|
5101
5102
|
}
|
|
5102
5103
|
function _u({ item: t, cls: e }) {
|
|
5103
5104
|
var r, a;
|
|
5104
|
-
const [n, i] =
|
|
5105
|
+
const [n, i] = K(!1), s = () => {
|
|
5105
5106
|
i(!0);
|
|
5106
5107
|
}, o = (r = t.icon) == null ? void 0 : r.endsWith(".svg");
|
|
5107
5108
|
return /* @__PURE__ */ w("div", { className: e("menu-item__icon"), children: n ? /* @__PURE__ */ w(
|
|
@@ -5227,7 +5228,7 @@ function rh(t) {
|
|
|
5227
5228
|
return /* @__PURE__ */ w(Hi, { styles: [Hu, Xu], style: { zIndex: 1200 }, children: /* @__PURE__ */ w(qu, { ...t }) });
|
|
5228
5229
|
}
|
|
5229
5230
|
function qu(t) {
|
|
5230
|
-
const { baseUrl: e, menuPath: n } = t, i = jr(), [s, o] =
|
|
5231
|
+
const { baseUrl: e, menuPath: n } = t, i = jr(), [s, o] = K([]), [r, a] = K(!1), l = (Ar(s, i.pathname) || []).filter((y) => y.parentKey !== 0), [c, u] = K({}), h = (y) => {
|
|
5231
5232
|
u({
|
|
5232
5233
|
...c,
|
|
5233
5234
|
[y]: !c[y]
|
|
@@ -5239,18 +5240,18 @@ function qu(t) {
|
|
|
5239
5240
|
(async () => {
|
|
5240
5241
|
const b = e + (n || "/global-menu-config/api/v1/menu-items/user"), g = await Fr.get(b, {
|
|
5241
5242
|
withCredentials: !0
|
|
5242
|
-
}).then((
|
|
5243
|
-
var
|
|
5243
|
+
}).then((S) => S.data).catch((S) => {
|
|
5244
|
+
var T, k;
|
|
5244
5245
|
Rr(
|
|
5245
|
-
((k = (
|
|
5246
|
+
((k = (T = S.response) == null ? void 0 : T.data) == null ? void 0 : k.errorMessage) || "Have error when get menu items"
|
|
5246
5247
|
);
|
|
5247
5248
|
}), x = {};
|
|
5248
|
-
g.forEach((
|
|
5249
|
-
|
|
5250
|
-
}), u(x), o(g.map((
|
|
5249
|
+
g.forEach((S) => {
|
|
5250
|
+
S.children && (x[S.id] = !0);
|
|
5251
|
+
}), u(x), o(g.map((S) => ({ ...S, parentKey: 0 })));
|
|
5251
5252
|
})();
|
|
5252
5253
|
}, [e, n]);
|
|
5253
|
-
const [f, p] =
|
|
5254
|
+
const [f, p] = K(!1), m = r ? "collapsed" : "expanded", v = (y) => `${y} ${m}`;
|
|
5254
5255
|
return /* @__PURE__ */ B("div", { className: v("side-bar"), children: [
|
|
5255
5256
|
/* @__PURE__ */ w("div", { className: v("side-bar__wrapper-toggle-btn"), children: /* @__PURE__ */ w(
|
|
5256
5257
|
"button",
|
|
@@ -5278,7 +5279,8 @@ function qu(t) {
|
|
|
5278
5279
|
isActive: (g) => l.some((x) => x.id === g),
|
|
5279
5280
|
isCollapsed: r,
|
|
5280
5281
|
expanded: (g) => c[g],
|
|
5281
|
-
toggleExpand: h
|
|
5282
|
+
toggleExpand: h,
|
|
5283
|
+
replacePath: t.replacePath
|
|
5282
5284
|
},
|
|
5283
5285
|
y.id
|
|
5284
5286
|
))
|