UNPKG

react-pretty-box

Version:

React-Pretty-Box is a ReactJS 18 library that enhances image viewing in web applications. It enables zoom functionality for single images or galleries, allowing users to explore visuals in greater detail. With intuitive controls like pinch-to-zoom and pan

1,088 lines (1,086 loc) 193 kB
import * as Sn from "react"; import cr, { createContext as Xt, useRef as gt, useLayoutEffect as ur, useEffect as Ve, useId as Pn, useContext as q, useInsertionEffect as $s, useCallback as Tn, useMemo as Dt, Children as hr, isValidElement as dr, useState as J, forwardRef as pr, Fragment as Fs, createElement as mr, Component as fr } from "react"; var ci, ze = { exports: {} }, Zt = {}, ui, hi, ve = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ function gr() { return ui || (ui = 1, process.env.NODE_ENV !== "production" && function() { function t(v) { if (v == null) return null; if (typeof v == "function") return v.$$typeof === rr ? null : v.displayName || v.name || null; if (typeof v == "string") return v; switch (v) { case j: return "Fragment"; case P: return "Portal"; case M: return "Profiler"; case k: return "StrictMode"; case O: return "Suspense"; case _: return "SuspenseList"; } if (typeof v == "object") switch (typeof v.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), v.$$typeof) { case R: return (v.displayName || "Context") + ".Provider"; case V: return (v._context.displayName || "Context") + ".Consumer"; case W: var E = v.render; return (v = v.displayName) || (v = (v = E.displayName || E.name || "") !== "" ? "ForwardRef(" + v + ")" : "ForwardRef"), v; case lt: return (E = v.displayName || null) !== null ? E : t(v.type) || "Memo"; case it: E = v._payload, v = v._init; try { return t(v(E)); } catch { } } return null; } function e(v) { return "" + v; } function n(v) { try { e(v); var E = !1; } catch { E = !0; } if (E) { var A = (E = console).error, N = typeof Symbol == "function" && Symbol.toStringTag && v[Symbol.toStringTag] || v.constructor.name || "Object"; return A.call(E, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", N), e(v); } } function i() { } function o(v) { if (Oe === void 0) try { throw Error(); } catch (A) { var E = A.stack.trim().match(/\n( *(at )?)/); Oe = E && E[1] || "", si = -1 < A.stack.indexOf(` at`) ? " (<anonymous>)" : -1 < A.stack.indexOf("@") ? "@unknown:0:0" : ""; } return ` ` + Oe + v + si; } function s(v, E) { if (!v || Ie) return ""; var A = Ue.get(v); if (A !== void 0) return A; Ie = !0, A = Error.prepareStackTrace, Error.prepareStackTrace = void 0; var N; N = Ct.H, Ct.H = null, function() { if (ye === 0) { f = console.log, p = console.info, g = console.warn, x = console.error, y = console.group, b = console.groupCollapsed, S = console.groupEnd; var B = { configurable: !0, enumerable: !0, value: i, writable: !0 }; Object.defineProperties(console, { info: B, log: B, warn: B, error: B, group: B, groupCollapsed: B, groupEnd: B }); } ye++; }(); try { var Y = { DetermineComponentFrameRoot: function() { try { if (E) { var B = function() { throw Error(); }; if (Object.defineProperty(B.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(B, []); } catch (ot) { var Ft = ot; } Reflect.construct(v, [], B); } else { try { B.call(); } catch (ot) { Ft = ot; } v.call(B.prototype); } } else { try { throw Error(); } catch (ot) { Ft = ot; } (B = v()) && typeof B.catch == "function" && B.catch(function() { }); } } catch (ot) { if (ot && Ft && typeof ot.stack == "string") return [ot.stack, Ft.stack]; } return [null, null]; } }; Y.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot"; var F = Object.getOwnPropertyDescriptor(Y.DetermineComponentFrameRoot, "name"); F && F.configurable && Object.defineProperty(Y.DetermineComponentFrameRoot, "name", { value: "DetermineComponentFrameRoot" }); var L = Y.DetermineComponentFrameRoot(), ft = L[0], $t = L[1]; if (ft && $t) { var D = ft.split(` `), Q = $t.split(` `); for (L = F = 0; F < D.length && !D[F].includes("DetermineComponentFrameRoot"); ) F++; for (; L < Q.length && !Q[L].includes("DetermineComponentFrameRoot"); ) L++; if (F === D.length || L === Q.length) for (F = D.length - 1, L = Q.length - 1; 1 <= F && 0 <= L && D[F] !== Q[L]; ) L--; for (; 1 <= F && 0 <= L; F--, L--) if (D[F] !== Q[L]) { if (F !== 1 || L !== 1) do if (F--, 0 > --L || D[F] !== Q[L]) { var st = ` ` + D[F].replace(" at new ", " at "); return v.displayName && st.includes("<anonymous>") && (st = st.replace("<anonymous>", v.displayName)), typeof v == "function" && Ue.set(v, st), st; } while (1 <= F && 0 <= L); break; } } } finally { Ie = !1, Ct.H = N, function() { if (--ye == 0) { var B = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: kt({}, B, { value: f }), info: kt({}, B, { value: p }), warn: kt({}, B, { value: g }), error: kt({}, B, { value: x }), group: kt({}, B, { value: y }), groupCollapsed: kt({}, B, { value: b }), groupEnd: kt({}, B, { value: S }) }); } 0 > ye && console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue."); }(), Error.prepareStackTrace = A; } return D = (D = v ? v.displayName || v.name : "") ? o(D) : "", typeof v == "function" && Ue.set(v, D), D; } function r(v) { if (v == null) return ""; if (typeof v == "function") { var E = v.prototype; return s(v, !(!E || !E.isReactComponent)); } if (typeof v == "string") return o(v); switch (v) { case O: return o("Suspense"); case _: return o("SuspenseList"); } if (typeof v == "object") switch (v.$$typeof) { case W: return v = s(v.render, !1); case lt: return r(v.type); case it: E = v._payload, v = v._init; try { return r(v(E)); } catch { } } return ""; } function a() { var v = Ct.A; return v === null ? null : v.getOwner(); } function l() { var v = t(this.type); return ri[v] || (ri[v] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), (v = this.props.ref) !== void 0 ? v : null; } function u(v, E, A, N, Y, F) { if (typeof v == "string" || typeof v == "function" || v === j || v === M || v === k || v === O || v === _ || v === mt || typeof v == "object" && v !== null && (v.$$typeof === it || v.$$typeof === lt || v.$$typeof === R || v.$$typeof === V || v.$$typeof === W || v.$$typeof === ar || v.getModuleId !== void 0)) { var L = E.children; if (L !== void 0) if (N) if (Be(L)) { for (N = 0; N < L.length; N++) c(L[N], v); Object.freeze && Object.freeze(L); } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); else c(L, v); } else L = "", (v === void 0 || typeof v == "object" && v !== null && Object.keys(v).length === 0) && (L += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), v === null ? N = "null" : Be(v) ? N = "array" : v !== void 0 && v.$$typeof === w ? (N = "<" + (t(v.type) || "Unknown") + " />", L = " Did you accidentally export a JSX literal instead of a component?") : N = typeof v, console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, L); if (ii.call(E, "key")) { L = t(v); var ft = Object.keys(E).filter(function(D) { return D !== "key"; }); N = 0 < ft.length ? "{key: someKey, " + ft.join(": ..., ") + ": ...}" : "{key: someKey}", ai[L + N] || (ft = 0 < ft.length ? "{" + ft.join(": ..., ") + ": ...}" : "{}", console.error(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`, N, L, ft, L), ai[L + N] = !0); } if (L = null, A !== void 0 && (n(A), L = "" + A), function(D) { if (ii.call(D, "key")) { var Q = Object.getOwnPropertyDescriptor(D, "key").get; if (Q && Q.isReactWarning) return !1; } return D.key !== void 0; }(E) && (n(E.key), L = "" + E.key), "key" in E) for (var $t in A = {}, E) $t !== "key" && (A[$t] = E[$t]); else A = E; return L && function(D, Q) { function st() { oi || (oi = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", Q)); } st.isReactWarning = !0, Object.defineProperty(D, "key", { get: st, configurable: !0 }); }(A, typeof v == "function" ? v.displayName || v.name || "Unknown" : v), function(D, Q, st, B, Ft, ot) { return st = ot.ref, D = { $$typeof: w, type: D, key: Q, props: ot, _owner: Ft }, (st !== void 0 ? st : null) !== null ? Object.defineProperty(D, "ref", { enumerable: !1, get: l }) : Object.defineProperty(D, "ref", { enumerable: !1, value: null }), D._store = {}, Object.defineProperty(D._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: 0 }), Object.defineProperty(D, "_debugInfo", { configurable: !1, enumerable: !1, writable: !0, value: null }), Object.freeze && (Object.freeze(D.props), Object.freeze(D)), D; }(v, L, F, 0, a(), A); } function c(v, E) { if (typeof v == "object" && v && v.$$typeof !== lr) { if (Be(v)) for (var A = 0; A < v.length; A++) { var N = v[A]; h(N) && d(N, E); } else if (h(v)) v._store && (v._store.validated = 1); else if (v === null || typeof v != "object" ? A = null : A = typeof (A = ct && v[ct] || v["@@iterator"]) == "function" ? A : null, typeof A == "function" && A !== v.entries && (A = A.call(v)) !== v) for (; !(v = A.next()).done; ) h(v.value) && d(v.value, E); } } function h(v) { return typeof v == "object" && v !== null && v.$$typeof === w; } function d(v, E) { if (v._store && !v._store.validated && v.key == null && (v._store.validated = 1, E = function(Y) { var F = "", L = a(); return L && (L = t(L.type)) && (F = ` Check the render method of \`` + L + "`."), F || (Y = t(Y)) && (F = ` Check the top-level render call using <` + Y + ">."), F; }(E), !li[E])) { li[E] = !0; var A = ""; v && v._owner != null && v._owner !== a() && (A = null, typeof v._owner.tag == "number" ? A = t(v._owner.type) : typeof v._owner.name == "string" && (A = v._owner.name), A = " It was passed a child from " + A + "."); var N = Ct.getCurrentStack; Ct.getCurrentStack = function() { var Y = r(v.type); return N && (Y += N() || ""), Y; }, console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', E, A), Ct.getCurrentStack = N; } } var f, p, g, x, y, b, S, T = cr, w = Symbol.for("react.transitional.element"), P = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), k = Symbol.for("react.strict_mode"), M = Symbol.for("react.profiler"), V = Symbol.for("react.consumer"), R = Symbol.for("react.context"), W = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), lt = Symbol.for("react.memo"), it = Symbol.for("react.lazy"), mt = Symbol.for("react.offscreen"), ct = Symbol.iterator, rr = Symbol.for("react.client.reference"), Ct = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ii = Object.prototype.hasOwnProperty, kt = Object.assign, ar = Symbol.for("react.client.reference"), Be = Array.isArray, ye = 0; i.__reactDisabledLog = !0; var Oe, si, oi, Ie = !1, Ue = new (typeof WeakMap == "function" ? WeakMap : Map)(), lr = Symbol.for("react.client.reference"), ri = {}, ai = {}, li = {}; ve.Fragment = j, ve.jsx = function(v, E, A, N, Y) { return u(v, E, A, !1, 0, Y); }, ve.jsxs = function(v, E, A, N, Y) { return u(v, E, A, !0, 0, Y); }; }()), ve; } var m = (hi || (hi = 1, process.env.NODE_ENV === "production" ? ze.exports = function() { if (ci) return Zt; ci = 1; var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment"); function n(i, o, s) { var r = null; if (s !== void 0 && (r = "" + s), o.key !== void 0 && (r = "" + o.key), "key" in o) for (var a in s = {}, o) a !== "key" && (s[a] = o[a]); else s = o; return o = s.ref, { $$typeof: t, type: i, key: r, ref: o !== void 0 ? o : null, props: s }; } return Zt.Fragment = e, Zt.jsx = n, Zt.jsxs = n, Zt; }() : ze.exports = gr()), ze.exports); const jn = Xt({}); function Cn(t) { const e = gt(null); return e.current === null && (e.current = t()), e.current; } const kn = typeof window < "u", Bs = kn ? ur : Ve, De = Xt(null), En = Xt({ transformPagePoint: (t) => t, isStatic: !1, reducedMotion: "never" }); class yr extends Sn.Component { getSnapshotBeforeUpdate(e) { const n = this.props.childRef.current; if (n && e.isPresent && !this.props.isPresent) { const i = n.offsetParent, o = i instanceof HTMLElement && i.offsetWidth || 0, s = this.props.sizeRef.current; s.height = n.offsetHeight || 0, s.width = n.offsetWidth || 0, s.top = n.offsetTop, s.left = n.offsetLeft, s.right = o - s.width - s.left; } return null; } componentDidUpdate() { } render() { return this.props.children; } } function vr({ children: t, isPresent: e, anchorX: n }) { const i = Pn(), o = gt(null), s = gt({ width: 0, height: 0, top: 0, left: 0, right: 0 }), { nonce: r } = q(En); return $s(() => { const { width: a, height: l, top: u, left: c, right: h } = s.current; if (e || !o.current || !a || !l) return; const d = n === "left" ? `left: ${c}` : `right: ${h}`; o.current.dataset.motionPopId = i; const f = document.createElement("style"); return r && (f.nonce = r), document.head.appendChild(f), f.sheet && f.sheet.insertRule(` [data-motion-pop-id="${i}"] { position: absolute !important; width: ${a}px !important; height: ${l}px !important; ${d}px !important; top: ${u}px !important; } `), () => { document.head.removeChild(f); }; }, [e]), m.jsx(yr, { isPresent: e, childRef: o, sizeRef: s, children: Sn.cloneElement(t, { ref: o }) }); } const xr = ({ children: t, initial: e, isPresent: n, onExitComplete: i, custom: o, presenceAffectsLayout: s, mode: r, anchorX: a }) => { const l = Cn(br), u = Pn(), c = Tn((d) => { l.set(d, !0); for (const f of l.values()) if (!f) return; i && i(); }, [l, i]), h = Dt(() => ({ id: u, initial: e, isPresent: n, custom: o, onExitComplete: c, register: (d) => (l.set(d, !1), () => l.delete(d)) }), s ? [Math.random(), c] : [n, c]); return Dt(() => { l.forEach((d, f) => l.set(f, !1)); }, [n]), Sn.useEffect(() => { !n && !l.size && i && i(); }, [n]), r === "popLayout" && (t = m.jsx(vr, { isPresent: n, anchorX: a, children: t })), m.jsx(De.Provider, { value: h, children: t }); }; function br() { return /* @__PURE__ */ new Map(); } function Os(t = !0) { const e = q(De); if (e === null) return [!0, null]; const { isPresent: n, onExitComplete: i, register: o } = e, s = Pn(); Ve(() => { if (t) return o(s); }, [t]); const r = Tn(() => t && i && i(s), [s, i, t]); return !n && i ? [!1, r] : [!0]; } const xe = (t) => t.key || ""; function di(t) { const e = []; return hr.forEach(t, (n) => { dr(n) && e.push(n); }), e; } const et = ({ children: t, custom: e, initial: n = !0, onExitComplete: i, presenceAffectsLayout: o = !0, mode: s = "sync", propagate: r = !1, anchorX: a = "left" }) => { const [l, u] = Os(r), c = Dt(() => di(t), [t]), h = r && !l ? [] : c.map(xe), d = gt(!0), f = gt(c), p = Cn(() => /* @__PURE__ */ new Map()), [g, x] = J(c), [y, b] = J(c); Bs(() => { d.current = !1, f.current = c; for (let w = 0; w < y.length; w++) { const P = xe(y[w]); h.includes(P) ? p.delete(P) : p.get(P) !== !0 && p.set(P, !1); } }, [y, h.length, h.join("-")]); const S = []; if (c !== g) { let w = [...c]; for (let P = 0; P < y.length; P++) { const j = y[P], k = xe(j); h.includes(k) || (w.splice(P, 0, j), S.push(j)); } return s === "wait" && S.length && (w = S), b(di(w)), x(c), null; } process.env.NODE_ENV !== "production" && s === "wait" && y.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`); const { forceRender: T } = q(jn); return m.jsx(m.Fragment, { children: y.map((w) => { const P = xe(w), j = !(r && !l) && (c === y || h.includes(P)); return m.jsx(xr, { isPresent: j, initial: !(d.current && !n) && void 0, custom: e, presenceAffectsLayout: o, mode: s, onExitComplete: j ? void 0 : () => { if (!p.has(P)) return; p.set(P, !0); let k = !0; p.forEach((M) => { M || (k = !1); }), k && (T == null || T(), b(f.current), r && (u == null || u()), i && i()); }, anchorX: a, children: w }, P); }) }); }; function An(t, e) { t.indexOf(e) === -1 && t.push(e); } function Ln(t, e) { const n = t.indexOf(e); n > -1 && t.splice(n, 1); } const tt = (t) => t; let Ht = tt, St = tt; process.env.NODE_ENV !== "production" && (Ht = (t, e) => { t || typeof console > "u" || console.warn(e); }, St = (t, e) => { if (!t) throw new Error(e); }); const wr = !1; function Mn(t) { let e; return () => (e === void 0 && (e = t()), e); } const Yt = (t, e, n) => { const i = e - t; return i === 0 ? 1 : (n - t) / i; }; class Vn { constructor() { this.subscriptions = []; } add(e) { return An(this.subscriptions, e), () => Ln(this.subscriptions, e); } notify(e, n, i) { const o = this.subscriptions.length; if (o) if (o === 1) this.subscriptions[0](e, n, i); else for (let s = 0; s < o; s++) { const r = this.subscriptions[s]; r && r(e, n, i); } } getSize() { return this.subscriptions.length; } clear() { this.subscriptions.length = 0; } } const ht = (t) => 1e3 * t, yt = (t) => t / 1e3; function Is(t, e) { return e ? t * (1e3 / e) : 0; } const pi = /* @__PURE__ */ new Set(); function Ce(t, e, n) { t || pi.has(e) || (console.warn(e), pi.add(e)); } const Sr = Mn(() => window.ScrollTimeline !== void 0); class Pr { constructor(e) { this.stop = () => this.runAll("stop"), this.animations = e.filter(Boolean); } get finished() { return Promise.all(this.animations.map((e) => "finished" in e ? e.finished : e)); } getAll(e) { return this.animations[0][e]; } setAll(e, n) { for (let i = 0; i < this.animations.length; i++) this.animations[i][e] = n; } attachTimeline(e, n) { const i = this.animations.map((o) => Sr() && o.attachTimeline ? o.attachTimeline(e) : typeof n == "function" ? n(o) : void 0); return () => { i.forEach((o, s) => { o && o(), this.animations[s].stop(); }); }; } get time() { return this.getAll("time"); } set time(e) { this.setAll("time", e); } get speed() { return this.getAll("speed"); } set speed(e) { this.setAll("speed", e); } get startTime() { return this.getAll("startTime"); } get duration() { let e = 0; for (let n = 0; n < this.animations.length; n++) e = Math.max(e, this.animations[n].duration); return e; } runAll(e) { this.animations.forEach((n) => n[e]()); } flatten() { this.runAll("flatten"); } play() { this.runAll("play"); } pause() { this.runAll("pause"); } cancel() { this.runAll("cancel"); } complete() { this.runAll("complete"); } } class Tr extends Pr { then(e, n) { return Promise.all(this.animations).then(e).catch(n); } } function Dn(t, e) { return t ? t[e] || t.default || t : void 0; } const on = 2e4; function Us(t) { let e = 0, n = t.next(e); for (; !n.done && e < on; ) e += 50, n = t.next(e); return e >= on ? 1 / 0 : e; } function Rn(t) { return typeof t == "function"; } function mi(t, e) { t.timeline = e, t.onfinish = null; } const Nn = (t) => Array.isArray(t) && typeof t[0] == "number", jr = { linearEasing: void 0 }; function Cr(t, e) { const n = Mn(t); return () => { var i; return (i = jr[e]) !== null && i !== void 0 ? i : n(); }; } const ke = Cr(() => { try { document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" }); } catch { return !1; } return !0; }, "linearEasing"), zs = (t, e, n = 10) => { let i = ""; const o = Math.max(Math.round(e / n), 2); for (let s = 0; s < o; s++) i += t(Yt(0, o - 1, s)) + ", "; return `linear(${i.substring(0, i.length - 2)})`; }; function Ws(t) { return !!(typeof t == "function" && ke() || !t || typeof t == "string" && (t in rn || ke()) || Nn(t) || Array.isArray(t) && t.every(Ws)); } const te = ([t, e, n, i]) => `cubic-bezier(${t}, ${e}, ${n}, ${i})`, rn = { linear: "linear", ease: "ease", easeIn: "ease-in", easeOut: "ease-out", easeInOut: "ease-in-out", circIn: te([0, 0.65, 0.55, 1]), circOut: te([0.55, 0, 1, 0.45]), backIn: te([0.31, 0.01, 0.66, -0.59]), backOut: te([0.33, 1.53, 0.69, 0.99]) }; function _s(t, e) { return t ? typeof t == "function" && ke() ? zs(t, e) : Nn(t) ? te(t) : Array.isArray(t) ? t.map((n) => _s(n, e) || rn.easeOut) : rn[t] : void 0; } const be = ["read", "resolveKeyframes", "update", "preRender", "render", "postRender"], fi = { value: null }; function Ys(t, e) { let n = !1, i = !0; const o = { delta: 0, timestamp: 0, isProcessing: !1 }, s = () => n = !0, r = be.reduce((p, g) => (p[g] = /* @__PURE__ */ function(x, y) { let b = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Set(), T = !1, w = !1; const P = /* @__PURE__ */ new WeakSet(); let j = { delta: 0, timestamp: 0, isProcessing: !1 }, k = 0; function M(R) { P.has(R) && (V.schedule(R), x()), k++, R(j); } const V = { schedule: (R, W = !1, O = !1) => { const _ = O && T ? b : S; return W && P.add(R), _.has(R) || _.add(R), R; }, cancel: (R) => { S.delete(R), P.delete(R); }, process: (R) => { j = R, T ? w = !0 : (T = !0, [b, S] = [S, b], b.forEach(M), y && fi.value && fi.value.frameloop[y].push(k), k = 0, b.clear(), T = !1, w && (w = !1, V.process(R))); } }; return V; }(s, e ? g : void 0), p), {}), { read: a, resolveKeyframes: l, update: u, preRender: c, render: h, postRender: d } = r, f = () => { const p = performance.now(); n = !1, o.delta = i ? 1e3 / 60 : Math.max(Math.min(p - o.timestamp, 40), 1), o.timestamp = p, o.isProcessing = !0, a.process(o), l.process(o), u.process(o), c.process(o), h.process(o), d.process(o), o.isProcessing = !1, n && e && (i = !1, t(f)); }; return { schedule: be.reduce((p, g) => { const x = r[g]; return p[g] = (y, b = !1, S = !1) => (n || (n = !0, i = !0, o.isProcessing || t(f)), x.schedule(y, b, S)), p; }, {}), cancel: (p) => { for (let g = 0; g < be.length; g++) r[be[g]].cancel(p); }, state: o, steps: r }; } const { schedule: $, cancel: bt, state: X, steps: We } = Ys(typeof requestAnimationFrame < "u" ? requestAnimationFrame : tt, !0), { schedule: $n } = Ys(queueMicrotask, !1); let Pe; function kr() { Pe = void 0; } const dt = { now: () => (Pe === void 0 && dt.set(X.isProcessing || wr ? X.timestamp : performance.now()), Pe), set: (t) => { Pe = t, queueMicrotask(kr); } }, ut = { x: !1, y: !1 }; function Xs() { return ut.x || ut.y; } function Hs(t, e) { const n = function(o, s, r) { if (o instanceof EventTarget) return [o]; if (typeof o == "string") { const a = document.querySelectorAll(o); return a ? Array.from(a) : []; } return Array.from(o); }(t), i = new AbortController(); return [n, { passive: !0, ...e, signal: i.signal }, () => i.abort()]; } function gi(t) { return !(t.pointerType === "touch" || Xs()); } function yi(t, e) { const n = `${e}PointerCapture`; if (t.target instanceof Element && n in t.target && t.pointerId !== void 0) try { t.target[n](t.pointerId); } catch { } } const Ks = (t, e) => !!e && (t === e || Ks(t, e.parentElement)), Fn = (t) => t.pointerType === "mouse" ? typeof t.button != "number" || t.button <= 0 : t.isPrimary !== !1, Er = /* @__PURE__ */ new Set(["BUTTON", "INPUT", "SELECT", "TEXTAREA", "A"]), Jt = /* @__PURE__ */ new WeakSet(); function vi(t) { return (e) => { e.key === "Enter" && t(e); }; } function _e(t, e) { t.dispatchEvent(new PointerEvent("pointer" + e, { isPrimary: !0, bubbles: !0 })); } function xi(t) { return Fn(t) && !Xs(); } function Ar(t, e, n = {}) { const [i, o, s] = Hs(t, n), r = (a) => { const l = a.currentTarget; if (!l || !xi(a) || Jt.has(l)) return; Jt.add(l), yi(a, "set"); const u = e(l, a), c = (f, p) => { l.removeEventListener("pointerup", h), l.removeEventListener("pointercancel", d), yi(f, "release"), xi(f) && Jt.has(l) && (Jt.delete(l), typeof u == "function" && u(f, { success: p })); }, h = (f) => { const p = !!f.isTrusted && (g = f, x = l instanceof Element ? l.getBoundingClientRect() : { left: 0, top: 0, right: window.innerWidth, bottom: window.innerHeight }, g.clientX < x.left || g.clientX > x.right || g.clientY < x.top || g.clientY > x.bottom); var g, x; c(f, !p && (!(l instanceof Element) || Ks(l, f.target))); }, d = (f) => { c(f, !1); }; l.addEventListener("pointerup", h, o), l.addEventListener("pointercancel", d, o), l.addEventListener("lostpointercapture", d, o); }; return i.forEach((a) => { let l = !1; var u; (a = n.useGlobalTarget ? window : a) instanceof HTMLElement && (l = !0, u = a, Er.has(u.tagName) || u.tabIndex !== -1 || a.getAttribute("tabindex") !== null || (a.tabIndex = 0)), a.addEventListener("pointerdown", r, o), l && a.addEventListener("focus", (c) => ((h, d) => { const f = h.currentTarget; if (!f) return; const p = vi(() => { if (Jt.has(f)) return; _e(f, "down"); const g = vi(() => { _e(f, "up"); }); f.addEventListener("keyup", g, d), f.addEventListener("blur", () => _e(f, "cancel"), d); }); f.addEventListener("keydown", p, d), f.addEventListener("blur", () => f.removeEventListener("keydown", p), d); })(c, o), o); }), s; } class Lr { constructor(e, n = {}) { this.version = "12.5.0", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (i, o = !0) => { const s = dt.now(); this.updatedAt !== s && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(i), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), o && this.events.renderRequest && this.events.renderRequest.notify(this.current); }, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner; } setCurrent(e) { var n; this.current = e, this.updatedAt = dt.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = (n = this.current, !isNaN(parseFloat(n)))); } setPrevFrameValue(e = this.current) { this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt; } onChange(e) { return process.env.NODE_ENV !== "production" && Ce(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", e); } on(e, n) { this.events[e] || (this.events[e] = new Vn()); const i = this.events[e].add(n); return e === "change" ? () => { i(), $.read(() => { this.events.change.getSize() || this.stop(); }); } : i; } clearListeners() { for (const e in this.events) this.events[e].clear(); } attach(e, n) { this.passiveEffect = e, this.stopPassiveEffect = n; } set(e, n = !0) { n && this.passiveEffect ? this.passiveEffect(e, this.updateAndNotify) : this.updateAndNotify(e, n); } setWithVelocity(e, n, i) { this.set(n), this.prev = void 0, this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt - i; } jump(e, n = !0) { this.updateAndNotify(e), this.prev = e, this.prevUpdatedAt = this.prevFrameValue = void 0, n && this.stop(), this.stopPassiveEffect && this.stopPassiveEffect(); } get() { return this.current; } getPrevious() { return this.prev; } getVelocity() { const e = dt.now(); if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > 30) return 0; const n = Math.min(this.updatedAt - this.prevUpdatedAt, 30); return Is(parseFloat(this.current) - parseFloat(this.prevFrameValue), n); } start(e) { return this.stop(), new Promise((n) => { this.hasAnimated = !0, this.animation = e(n), this.events.animationStart && this.events.animationStart.notify(); }).then(() => { this.events.animationComplete && this.events.animationComplete.notify(), this.clearAnimation(); }); } stop() { this.animation && (this.animation.stop(), this.events.animationCancel && this.events.animationCancel.notify()), this.clearAnimation(); } isAnimating() { return !!this.animation; } clearAnimation() { delete this.animation; } destroy() { this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect(); } } function ee(t, e) { return new Lr(t, e); } const qs = Xt({ strict: !1 }), bi = { animation: ["animate", "variants", "whileHover", "whileTap", "exit", "whileInView", "whileFocus", "whileDrag"], exit: ["exit"], drag: ["drag", "dragControls"], focus: ["whileFocus"], hover: ["whileHover", "onHoverStart", "onHoverEnd"], tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], inView: ["whileInView", "onViewportEnter", "onViewportLeave"], layout: ["layout", "layoutId"] }, _t = {}; for (const t in bi) _t[t] = { isEnabled: (e) => bi[t].some((n) => !!e[n]) }; const Mr = /* @__PURE__ */ new Set(["animate", "exit", "variants", "initial", "style", "values", "variants", "transition", "transformTemplate", "custom", "inherit", "onBeforeLayoutMeasure", "onAnimationStart", "onAnimationComplete", "onUpdate", "onDragStart", "onDrag", "onDragEnd", "onMeasureDragConstraints", "onDirectionLock", "onDragTransitionEnd", "_dragX", "_dragY", "onHoverStart", "onHoverEnd", "onViewportEnter", "onViewportLeave", "globalTapTarget", "ignoreStrict", "viewport"]); function Ee(t) { return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || Mr.has(t); } let Gs = (t) => !Ee(t); try { (wi = require("@emotion/is-prop-valid").default) && (Gs = (t) => t.startsWith("on") ? !Ee(t) : wi(t)); } catch { } var wi; function Vr(t) { if (typeof Proxy > "u") return t; const e = /* @__PURE__ */ new Map(); return new Proxy((...n) => (process.env.NODE_ENV !== "production" && Ce(!1, "motion() is deprecated. Use motion.create() instead."), t(...n)), { get: (n, i) => i === "create" ? t : (e.has(i) || e.set(i, t(i)), e.get(i)) }); } const Re = Xt({}); function Ne(t) { return t !== null && typeof t == "object" && typeof t.start == "function"; } function ae(t) { return typeof t == "string" || Array.isArray(t); } const Bn = ["animate", "whileInView", "whileFocus", "whileHover", "whileTap", "whileDrag", "exit"], On = ["initial", ...Bn]; function $e(t) { return Ne(t.animate) || On.some((e) => ae(t[e])); } function Zs(t) { return !!($e(t) || t.variants); } function Dr(t) { const { initial: e, animate: n } = function(i, o) { if ($e(i)) { const { initial: s, animate: r } = i; return { initial: s === !1 || ae(s) ? s : void 0, animate: ae(r) ? r : void 0 }; } return i.inherit !== !1 ? o : {}; }(t, q(Re)); return Dt(() => ({ initial: e, animate: n }), [Si(e), Si(n)]); } function Si(t) { return Array.isArray(t) ? t.join(" ") : t; } const Rr = Symbol.for("motionComponentSymbol"); function Ot(t) { return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current"); } function Nr(t, e, n) { return Tn((i) => { i && t.onMount && t.onMount(i), e && (i ? e.mount(i) : e.unmount()), n && (typeof n == "function" ? n(i) : Ot(n) && (n.current = i)); }, [e]); } const In = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Js = "data-" + In("framerAppearId"), Qs = Xt({}); function $r(t, e, n, i, o) { var s, r; const { visualElement: a } = q(Re), l = q(qs), u = q(De), c = q(En).reducedMotion, h = gt(null); i = i || l.renderer, !h.current && i && (h.current = i(t, { visualState: e, parent: a, props: n, presenceContext: u, blockInitialAnimation: !!u && u.initial === !1, reducedMotionConfig: c })); const d = h.current, f = q(Qs); !d || d.projection || !o || d.type !== "html" && d.type !== "svg" || function(y, b, S, T) { const { layoutId: w, layout: P, drag: j, dragConstraints: k, layoutScroll: M, layoutRoot: V } = b; y.projection = new S(y.latestValues, b["data-framer-portal-id"] ? void 0 : to(y.parent)), y.projection.setOptions({ layoutId: w, layout: P, alwaysMeasureLayout: !!j || k && Ot(k), visualElement: y, animationType: typeof P == "string" ? P : "both", initialPromotionConfig: T, layoutScroll: M, layoutRoot: V }); }(h.current, n, o, f); const p = gt(!1); $s(() => { d && p.current && d.update(n, u); }); const g = n[Js], x = gt(!!g && !(!((s = window.MotionHandoffIsComplete) === null || s === void 0) && s.call(window, g)) && ((r = window.MotionHasOptimisedAnimation) === null || r === void 0 ? void 0 : r.call(window, g))); return Bs(() => { d && (p.current = !0, window.MotionIsMounted = !0, d.updateFeatures(), $n.render(d.render), x.current && d.animationState && d.animationState.animateChanges()); }), Ve(() => { d && (!x.current && d.animationState && d.animationState.animateChanges(), x.current && (queueMicrotask(() => { var y; (y = window.MotionHandoffMarkAsComplete) === null || y === void 0 || y.call(window, g); }), x.current = !1)); }), d; } function to(t) { if (t) return t.options.allowProjection !== !1 ? t.projection : to(t.parent); } function Fr({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVisualState: i, Component: o }) { var s, r; function a(u, c) { let h; const d = { ...q(En), ...u, layoutId: Br(u) }, { isStatic: f } = d, p = Dr(u), g = i(u, f); if (!f && kn) { (function(y, b) { const S = q(qs).strict; if (process.env.NODE_ENV !== "production" && b && S) { const T = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."; y.ignoreStrict ? Ht(!1, T) : St(!1, T); } })(d, t); const x = function(y) { const { drag: b, layout: S } = _t; if (!b && !S) return {}; const T = { ...b, ...S }; return { MeasureLayout: b != null && b.isEnabled(y) || S != null && S.isEnabled(y) ? T.MeasureLayout : void 0, ProjectionNode: T.ProjectionNode }; }(d); h = x.MeasureLayout, p.visualElement = $r(o, g, d, e, x.ProjectionNode); } return m.jsxs(Re.Provider, { value: p, children: [h && p.visualElement ? m.jsx(h, { visualElement: p.visualElement, ...d }) : null, n(o, u, Nr(g, p.visualElement, c), g, f, p.visualElement)] }); } t && function(u) { for (const c in u) _t[c] = { ..._t[c], ...u[c] }; }(t), a.displayName = `motion.${typeof o == "string" ? o : `create(${(r = (s = o.displayName) !== null && s !== void 0 ? s : o.name) !== null && r !== void 0 ? r : ""})`}`; const l = pr(a); return l[Rr] = o, l; } function Br({ layoutId: t }) { const e = q(jn).id; return e && t !== void 0 ? e + "-" + t : t; } const eo = (t) => (e) => typeof e == "string" && e.startsWith(t), Un = eo("--"), Or = eo("var(--"), zn = (t) => !!Or(t) && Ir.test(t.split("/*")[0].trim()), Ir = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, le = {}, Kt = ["transformPerspective", "x", "y", "z", "translateX", "translateY", "translateZ", "scale", "scaleX", "scaleY", "rotate", "rotateX", "rotateY", "rotateZ", "skew", "skewX", "skewY"], Rt = new Set(Kt); function no(t, { layout: e, layoutId: n }) { return Rt.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!le[t] || t === "opacity"); } const K = (t) => !!(t && t.getVelocity), Pi = (t, e) => e && typeof t == "number" ? e.transform(t) : t, vt = (t, e, n) => n > e ? e : n < t ? t : n, qt = { test: (t) => typeof t == "number", parse: parseFloat, transform: (t) => t }, ce = { ...qt, transform: (t) => vt(0, 1, t) }, we = { ...qt, default: 1 }, pe = (t) => ({ test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1, parse: parseFloat, transform: (e) => `${e}${t}` }), xt = pe("deg"), pt = pe("%"), C = pe("px"), Ur = pe("vh"), zr = pe("vw"), Ti = { ...pt, parse: (t) => pt.parse(t) / 100, transform: (t) => pt.transform(100 * t) }, Wr = { borderWidth: C, borderTopWidth: C, borderRightWidth: C, borderBottomWidth: C, borderLeftWidth: C, borderRadius: C, radius: C, borderTopLeftRadius: C, borderTopRightRadius: C, borderBottomRightRadius: C, borderBottomLeftRadius: C, width: C, maxWidth: C, height: C, maxHeight: C, top: C, right: C, bottom: C, left: C, padding: C, paddingTop: C, paddingRight: C, paddingBottom: C, paddingLeft: C, margin: C, marginTop: C, marginRight: C, marginBottom: C, marginLeft: C, backgroundPositionX: C, backgroundPositionY: C }, _r = { rotate: xt, rotateX: xt, rotateY: xt, rotateZ: xt, scale: we, scaleX: we, scaleY: we, scaleZ: we, skew: xt, skewX: xt, skewY: xt, distance: C, translateX: C, translateY: C, translateZ: C, x: C, y: C, z: C, perspective: C, transformPerspective: C, opacity: ce, originX: Ti, originY: Ti, originZ: C }, ji = { ...qt, transform: Math.round }, an = { ...Wr, ..._r, zIndex: ji, size: C, fillOpacity: ce, strokeOpacity: ce, numOctaves: ji }, Yr = { x: "translateX", y: "translateY", z: "translateZ", transformPerspective: "perspective" }, Xr = Kt.length; function Wn(t, e, n) { const { style: i, vars: o, transformOrigin: s } = t; let r = !1, a = !1; for (const l in e) { const u = e[l]; if (Rt.has(l)) r = !0; else if (Un(l)) o[l] = u; else { const c = Pi(u, an[l]); l.startsWith("origin") ? (a = !0, s[l] = c) : i[l] = c; } } if (e.transform || (r || n ? i.transform = function(l, u, c) { let h = "", d = !0; for (let f = 0; f < Xr; f++) { const p = Kt[f], g = l[p]; if (g === void 0) continue; let x = !0; if (x = typeof g == "number" ? g === (p.startsWith("scale") ? 1 : 0) : parseFloat(g) === 0, !x || c) { const y = Pi(g, an[p]); x || (d = !1, h += `${Yr[p] || p}(${y}) `), c && (u[p] = y); } } return h = h.trim(), c ? h = c(u, d ? "" : h) : d && (h = "none"), h; }(e, t.transform, n) : i.transform && (i.transform = "none")), a) { const { originX: l = "50%", originY: u = "50%", originZ: c = 0 } = s; i.transformOrigin = `${l} ${u} ${c}`; } } const _n = () => ({ style: {}, transform: {}, transformOrigin: {}, vars: {} }); function io(t, e, n) { for (const i in e) K(e[i]) || no(i, n) || (t[i] = e[i]); } function Hr(t, e) { const n = {}; return io(n, t.style || {}, t), Object.assign(n, function({ transformTemplate: i }, o) { return Dt(() => { const s = _n(); return Wn(s, o, i), Object.assign({}, s.vars, s.style); }, [o]); }(t, e)), n; } function Kr(t, e) { const n = {}, i = Hr(t, e); return t.drag && t.dragListener !== !1 && (n.draggable = !1, i.userSelect = i.WebkitUserSelect = i.WebkitTouchCallout = "none", i.touchAction = t.drag === !0 ? "none" : "pan-" + (t.drag === "x" ? "y" : "x")), t.tabIndex === void 0 && (t.onTap || t.onTapStart || t.whileTap) && (n.tabIndex = 0), n.style = i, n; } const qr = ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "switch", "symbol", "svg", "text", "tspan", "use", "view"]; function Yn(t) { return typeof t == "string" && !t.includes("-") && !!(qr.indexOf(t) > -1 || /[A-Z]/u.test(t)); } const Gr = { offset: "stroke-dashoffset", array: "stroke-dasharray" }, Zr = { offset: "strokeDashoffset", array: "strokeDasharray" }; function Ci(t, e, n) { return typeof t == "string" ? t : C.transform(e + n * t); } function Xn(t, { attrX: e, attrY: n, attrScale: i, originX: o, originY: s, pathLength: r, pathSpacing: a = 1, pathOffset: l = 0, ...u }, c, h) { if (Wn(t, u, h), c) return void (t.style.viewBox && (t.attrs.viewBox = t.style.viewBox)); t.attrs = t.style, t.style = {}; const { attrs: d, style: f, dimensions: p } = t; d.transform && (p && (f.transform = d.transform), delete d.transform), p && (o !== void 0 || s !== void 0 || f.transform) && (f.transformOrigin = function(g, x, y) { return `${Ci(x, g.x, g.width)} ${Ci(y, g.y, g.height)}`; }(p, o !== void 0 ? o : 0.5, s !== void 0 ? s : 0.5)), e !== void 0 && (d.x = e), n !== void 0 && (d.y = n), i !== void 0 && (d.scale = i), r !== void 0 && function(g, x, y = 1, b = 0, S = !0) { g.pathLength = 1; const T = S ? Gr : Zr; g[T.offset] = C.transform(-b); const w = C.transform(x), P = C.transform(y); g[T.array] = `${w} ${P}`; }(d, r, a, l, !1); } const so = () => ({ ..._n(), attrs: {} }), Hn = (t) => typeof t == "string" && t.toLowerCase() === "svg"; function Jr(t, e, n, i) { const o = Dt(() => { const s = so(); return Xn(s, e, Hn(i), t.transformTemplate), { ...s.attrs, style: { ...s.style } }; }, [e]); if (t.style) { const s = {}; io(s, t.style, t), o.style = { ...s, ...o.style }; } return o; } function Qr(t = !1) { return (e, n, i, { latestValues: o }, s) => { const r = (Yn(e) ? Jr : Kr)(n, o, s, e), a = function(h, d, f) { const p = {}; for (const g in h) g === "values" && typeof h.values == "object" || (Gs(g) || f === !0 && Ee(g) || !d && !Ee(g) || h.draggable && g.startsWith("onDrag")) && (p[g] = h[g]); return p; }(n, typeof e == "string", t), l = e !== Fs ? { ...a, ...r, ref: i } : {}, { children: u } = n, c = Dt(() => K(u) ? u.get() : u, [u]); return mr(e, { ...l, children: c }); }; } function ki(t) { const e = [{}, {}]; return t == null || t.values.forEach((n, i) => { e[0][i] = n.get(), e[1][i] = n.getVelocity(); }), e; } function Kn(t, e, n, i) { if (typeof e == "function") { const [o, s] = ki(i); e = e(n !== void 0 ? n : t.custom, o, s); } if (typeof e == "string" && (e = t.variants && t.variants[e]), typeof e == "function") { const [o, s] = ki(i); e = e(n !== void 0 ? n : t.custom, o, s); } return e; } const ln = (t) => Array.isArray(t), ta = (t) => !!(t && typeof t == "object" && t.mix && t.toValue), ea = (t) => ln(t) ? t[t.length - 1] || 0 : t; function Te(t) { const e = K(t) ? t.get() : t; return ta(e) ? e.toValue() : e; } const oo = (t) => (e, n) => { const i = q(Re), o = q(De), s = () => function({ scrapeMotionValuesFromProps: r, createRenderState: a, onUpdate: l }, u, c, h) { const d = { latestValues: na(u, c, h, r), renderState: a() }; return l && (d.onMount = (f) => l({ props: u, current: f, ...d }), d.onUpdate = (f) => l(f)), d; }(t, e, i, o); return n ? s() : Cn(s); }; function na(t, e, n, i) { const o = {}, s = i(t, {}); for (const d in s) o[d] = Te(s[d]); let { initial: r, animate: a } = t; const l = $e(t), u = Zs(t); e && u && !l && t.inherit !== !1 && (r === void 0 && (r = e.initial), a === void 0 && (a = e.animate)); let c = !!n && n.initial === !1; c = c || r === !1; const h = c ? a : r; if (h && typeof h != "boolean" && !Ne(h)) { const d = Array.isArray(h) ? h : [h]; for (let f = 0; f < d.length; f++) { const p = Kn(t, d[f]); if (p) { const { transitionEnd: g, transition: x, ...y } = p; for (const b in y) { let S = y[b]; Array.isArray(S) && (S = S[c ? S.length - 1 : 0]), S !== null && (o[b] = S); } for (const b in g) o[b] = g[b]; } } } return o; } function qn(t, e, n) { var i; const { style: o } = t, s = {}; for (const r in o) (K(o[r]) || e.style && K(e.style[r]) || no(r, t) || ((i = n == null ? void 0 : n.getValue(r)) === null || i === void 0 ? void 0 : i.liveStyle) !== void 0) && (s[r] = o[r]); return s; } const ia = { useVisualState: oo({ scrapeMotionValuesFromProps: qn, createRenderState: _n }) }; function ro(t, e) { try { e.dimensions = typeof t.getBBox == "function" ? t.getBBox() : t.getBoundingClientRect(); } catch { e.dimensions = { x: 0, y: 0, width: 0, height: 0 }; } } function ao(t, { style: e, vars: n }, i, o) { Object.assign(t.style, e, o && o.getProjectionStyles(i)); for (const s in n) t.style.setProperty(s, n[s]); } const lo = /* @__PURE__ */ new Set(["baseFrequency", "diffuseConstant", "kernelMatrix", "kernelUnitLength", "keySplines", "keyTimes", "limitingConeAngle", "markerHeight", "markerWidth", "numOctaves", "targetX", "targetY", "surfaceScale", "specularConstant", "specularExponent", "stdDeviation", "tableValues", "viewBox", "gradientTransform", "pathLength", "startOffset", "textLength", "lengthAdjust"]); function co(t, e, n, i) { ao(t, e, void 0, i); for (const o in e.attrs) t.setAttribute(lo.has(o) ? o : In(o), e.attrs[o]); } function uo(t, e, n) { const i = qn(t, e, n); for (const o in t) (K(t[o]) || K(e[o])) && (i[Kt.indexOf(o) !== -1 ? "attr" + o.charAt(0).toUpperCase() + o.substring(1) : o] = t[o]); return i; } const Ei = ["x", "y", "width", "height", "cx", "cy", "r"], sa = { useVisualState: oo({ scrapeMotionValuesFromProps: uo, createRenderState: so, onUpdate: ({ props: t, prevProps: e, current: n, renderState: i, latestValues: o }) => { if (!n) return; let s = !!t.drag; if (!s) { for (const a in o) if (Rt.has(a)) { s = !0; break; } } if (!s) return; let r = !e; if (e) for (let a = 0; a < Ei.length; a++) { const l = Ei[a]; t[l] !== e[l] && (r = !0); } r && $.read(() => { ro(n, i), $.render(() => { Xn(i, o, Hn(n.tagName), t.transformTemplate), co(n, i); }); }); } }) }; function oa(t, e) { return function(n, { forwardMotionProps: i } = { forwardMotionProps: !1 }) { return Fr({ ...Yn(n) ? sa : ia, preloadedFeatures: t, useRender: Qr(i), createVisualElement: e, Component: n }); }; } function ue(t, e, n) { const i = t.getProps(); return Kn(i, e, n !== void 0 ? n : i.custom, t); } const ho = /* @__PURE__ */ new Set(["width", "height", "top", "left", "right", "bottom", ...Kt]); function ra(t, e, n) { t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, ee(n)); } function cn(t, e) { const n = t.getValue("willChange"); if (i = n, !!(K(i) && i.add)) return n.add(e); var i; } function po(t) { return t.props[Js]; } const Ai = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, aa = 1e-7, la = 12; function me(t, e, n, i) { if (t === e && n === i) return tt; const o = (s) => function(r, a, l, u, c) { let h, d, f = 0; do d = a + (l - a) / 2, h = Ai(d, u, c) - r, h > 0 ? l = d : a = d; while (Math.abs(h) > aa && ++f < la); return d; }(s, 0, 1, t, n); return (s) => s === 0 || s === 1 ? s : Ai(o(s), e, i); } const mo = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, fo = (t) => (e) => 1 - t(1 - e), go = me(0.33, 1.53, 0.69, 0.99), Gn = fo(go), yo = mo(Gn), vo = (t) => (t *= 2) < 1 ? 0.5 * Gn(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), Zn = (t) => 1 - Math.sin(Math.acos(t)), xo = fo(Zn), bo = mo(Zn), wo = (t) => /^0[^.\s]+$/u.test(t), ne = (t) => Math.round(1e5 * t) / 1e5, Jn = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu, ca = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\