UNPKG

react-toast-notify-ks

Version:

toast notification library for React

1,670 lines (1,668 loc) 187 kB
import js, { createContext as Pt, useRef as me, useContext as Y, useId as No, useEffect as yn, useCallback as vn, useLayoutEffect as Uo, useMemo as Ve, useInsertionEffect as $o, forwardRef as Wo, Fragment as Fs, createElement as Ko, Component as Go, memo as _s, useState as Yo } from "react"; import { createPortal as zo } from "react-dom"; var fe = { exports: {} }, $t = {}; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var mi; function Ho() { if (mi) return $t; mi = 1; var t = js, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, s = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 }; function r(a, l, u) { var c, d = {}, h = null, p = null; u !== void 0 && (h = "" + u), l.key !== void 0 && (h = "" + l.key), l.ref !== void 0 && (p = l.ref); for (c in l) i.call(l, c) && !o.hasOwnProperty(c) && (d[c] = l[c]); if (a && a.defaultProps) for (c in l = a.defaultProps, l) d[c] === void 0 && (d[c] = l[c]); return { $$typeof: e, type: a, key: h, ref: p, props: d, _owner: s.current }; } return $t.Fragment = n, $t.jsx = r, $t.jsxs = r, $t; } var Wt = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var gi; function Xo() { return gi || (gi = 1, process.env.NODE_ENV !== "production" && function() { var t = js, e = Symbol.for("react.element"), n = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), r = Symbol.for("react.provider"), a = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), y = Symbol.iterator, v = "@@iterator"; function b(f) { if (f === null || typeof f != "object") return null; var m = y && f[y] || f[v]; return typeof m == "function" ? m : null; } var g = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function x(f) { { for (var m = arguments.length, T = new Array(m > 1 ? m - 1 : 0), A = 1; A < m; A++) T[A - 1] = arguments[A]; P("error", f, T); } } function P(f, m, T) { { var A = g.ReactDebugCurrentFrame, D = A.getStackAddendum(); D !== "" && (m += "%s", T = T.concat([D])); var L = T.map(function(R) { return String(R); }); L.unshift("Warning: " + m), Function.prototype.apply.call(console[f], console, L); } } var C = !1, w = !1, M = !1, I = !1, V = !1, U; U = Symbol.for("react.module.reference"); function z(f) { return !!(typeof f == "string" || typeof f == "function" || f === i || f === o || V || f === s || f === u || f === c || I || f === p || C || w || M || typeof f == "object" && f !== null && (f.$$typeof === h || f.$$typeof === d || f.$$typeof === r || f.$$typeof === a || f.$$typeof === l || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. f.$$typeof === U || f.getModuleId !== void 0)); } function ct(f, m, T) { var A = f.displayName; if (A) return A; var D = m.displayName || m.name || ""; return D !== "" ? T + "(" + D + ")" : T; } function Nt(f) { return f.displayName || "Context"; } function it(f) { if (f == null) return null; if (typeof f.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof f == "function") return f.displayName || f.name || null; if (typeof f == "string") return f; switch (f) { case i: return "Fragment"; case n: return "Portal"; case o: return "Profiler"; case s: return "StrictMode"; case u: return "Suspense"; case c: return "SuspenseList"; } if (typeof f == "object") switch (f.$$typeof) { case a: var m = f; return Nt(m) + ".Consumer"; case r: var T = f; return Nt(T._context) + ".Provider"; case l: return ct(f, f.render, "ForwardRef"); case d: var A = f.displayName || null; return A !== null ? A : it(f.type) || "Memo"; case h: { var D = f, L = D._payload, R = D._init; try { return it(R(L)); } catch { return null; } } } return null; } var st = Object.assign, St = 0, Oe, N, J, wt, At, Zn, Jn; function Qn() { } Qn.__reactDisabledLog = !0; function ho() { { if (St === 0) { Oe = console.log, N = console.info, J = console.warn, wt = console.error, At = console.group, Zn = console.groupCollapsed, Jn = console.groupEnd; var f = { configurable: !0, enumerable: !0, value: Qn, writable: !0 }; Object.defineProperties(console, { info: f, log: f, warn: f, error: f, group: f, groupCollapsed: f, groupEnd: f }); } St++; } } function po() { { if (St--, St === 0) { var f = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: st({}, f, { value: Oe }), info: st({}, f, { value: N }), warn: st({}, f, { value: J }), error: st({}, f, { value: wt }), group: st({}, f, { value: At }), groupCollapsed: st({}, f, { value: Zn }), groupEnd: st({}, f, { value: Jn }) }); } St < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var ke = g.ReactCurrentDispatcher, je; function ae(f, m, T) { { if (je === void 0) try { throw Error(); } catch (D) { var A = D.stack.trim().match(/\n( *(at )?)/); je = A && A[1] || ""; } return ` ` + je + f; } } var Fe = !1, le; { var mo = typeof WeakMap == "function" ? WeakMap : Map; le = new mo(); } function ti(f, m) { if (!f || Fe) return ""; { var T = le.get(f); if (T !== void 0) return T; } var A; Fe = !0; var D = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var L; L = ke.current, ke.current = null, ho(); try { if (m) { var R = function() { throw Error(); }; if (Object.defineProperty(R.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(R, []); } catch (H) { A = H; } Reflect.construct(f, [], R); } else { try { R.call(); } catch (H) { A = H; } f.call(R.prototype); } } else { try { throw Error(); } catch (H) { A = H; } f(); } } catch (H) { if (H && A && typeof H.stack == "string") { for (var E = H.stack.split(` `), G = A.stack.split(` `), F = E.length - 1, B = G.length - 1; F >= 1 && B >= 0 && E[F] !== G[B]; ) B--; for (; F >= 1 && B >= 0; F--, B--) if (E[F] !== G[B]) { if (F !== 1 || B !== 1) do if (F--, B--, B < 0 || E[F] !== G[B]) { var Q = ` ` + E[F].replace(" at new ", " at "); return f.displayName && Q.includes("<anonymous>") && (Q = Q.replace("<anonymous>", f.displayName)), typeof f == "function" && le.set(f, Q), Q; } while (F >= 1 && B >= 0); break; } } } finally { Fe = !1, ke.current = L, po(), Error.prepareStackTrace = D; } var Et = f ? f.displayName || f.name : "", gt = Et ? ae(Et) : ""; return typeof f == "function" && le.set(f, gt), gt; } function go(f, m, T) { return ti(f, !1); } function yo(f) { var m = f.prototype; return !!(m && m.isReactComponent); } function ue(f, m, T) { if (f == null) return ""; if (typeof f == "function") return ti(f, yo(f)); if (typeof f == "string") return ae(f); switch (f) { case u: return ae("Suspense"); case c: return ae("SuspenseList"); } if (typeof f == "object") switch (f.$$typeof) { case l: return go(f.render); case d: return ue(f.type, m, T); case h: { var A = f, D = A._payload, L = A._init; try { return ue(L(D), m, T); } catch { } } } return ""; } var Ut = Object.prototype.hasOwnProperty, ei = {}, ni = g.ReactDebugCurrentFrame; function ce(f) { if (f) { var m = f._owner, T = ue(f.type, f._source, m ? m.type : null); ni.setExtraStackFrame(T); } else ni.setExtraStackFrame(null); } function vo(f, m, T, A, D) { { var L = Function.call.bind(Ut); for (var R in f) if (L(f, R)) { var E = void 0; try { if (typeof f[R] != "function") { var G = Error((A || "React class") + ": " + T + " type `" + R + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof f[R] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw G.name = "Invariant Violation", G; } E = f[R](m, R, A, T, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (F) { E = F; } E && !(E instanceof Error) && (ce(D), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", A || "React class", T, R, typeof E), ce(null)), E instanceof Error && !(E.message in ei) && (ei[E.message] = !0, ce(D), x("Failed %s type: %s", T, E.message), ce(null)); } } } var xo = Array.isArray; function _e(f) { return xo(f); } function To(f) { { var m = typeof Symbol == "function" && Symbol.toStringTag, T = m && f[Symbol.toStringTag] || f.constructor.name || "Object"; return T; } } function bo(f) { try { return ii(f), !1; } catch { return !0; } } function ii(f) { return "" + f; } function si(f) { if (bo(f)) return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", To(f)), ii(f); } var ri = g.ReactCurrentOwner, Po = { key: !0, ref: !0, __self: !0, __source: !0 }, oi, ai; function So(f) { if (Ut.call(f, "ref")) { var m = Object.getOwnPropertyDescriptor(f, "ref").get; if (m && m.isReactWarning) return !1; } return f.ref !== void 0; } function wo(f) { if (Ut.call(f, "key")) { var m = Object.getOwnPropertyDescriptor(f, "key").get; if (m && m.isReactWarning) return !1; } return f.key !== void 0; } function Ao(f, m) { typeof f.ref == "string" && ri.current; } function Vo(f, m) { { var T = function() { oi || (oi = !0, x("%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://reactjs.org/link/special-props)", m)); }; T.isReactWarning = !0, Object.defineProperty(f, "key", { get: T, configurable: !0 }); } } function Eo(f, m) { { var T = function() { ai || (ai = !0, x("%s: `ref` 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://reactjs.org/link/special-props)", m)); }; T.isReactWarning = !0, Object.defineProperty(f, "ref", { get: T, configurable: !0 }); } } var Ro = function(f, m, T, A, D, L, R) { var E = { // This tag allows us to uniquely identify this as a React Element $$typeof: e, // Built-in properties that belong on the element type: f, key: m, ref: T, props: R, // Record the component responsible for creating this element. _owner: L }; return E._store = {}, Object.defineProperty(E._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(E, "_self", { configurable: !1, enumerable: !1, writable: !1, value: A }), Object.defineProperty(E, "_source", { configurable: !1, enumerable: !1, writable: !1, value: D }), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E; }; function Co(f, m, T, A, D) { { var L, R = {}, E = null, G = null; T !== void 0 && (si(T), E = "" + T), wo(m) && (si(m.key), E = "" + m.key), So(m) && (G = m.ref, Ao(m, D)); for (L in m) Ut.call(m, L) && !Po.hasOwnProperty(L) && (R[L] = m[L]); if (f && f.defaultProps) { var F = f.defaultProps; for (L in F) R[L] === void 0 && (R[L] = F[L]); } if (E || G) { var B = typeof f == "function" ? f.displayName || f.name || "Unknown" : f; E && Vo(R, B), G && Eo(R, B); } return Ro(f, E, G, D, A, ri.current, R); } } var Be = g.ReactCurrentOwner, li = g.ReactDebugCurrentFrame; function Vt(f) { if (f) { var m = f._owner, T = ue(f.type, f._source, m ? m.type : null); li.setExtraStackFrame(T); } else li.setExtraStackFrame(null); } var Ie; Ie = !1; function Ne(f) { return typeof f == "object" && f !== null && f.$$typeof === e; } function ui() { { if (Be.current) { var f = it(Be.current.type); if (f) return ` Check the render method of \`` + f + "`."; } return ""; } } function Do(f) { return ""; } var ci = {}; function Mo(f) { { var m = ui(); if (!m) { var T = typeof f == "string" ? f : f.displayName || f.name; T && (m = ` Check the top-level render call using <` + T + ">."); } return m; } } function fi(f, m) { { if (!f._store || f._store.validated || f.key != null) return; f._store.validated = !0; var T = Mo(m); if (ci[T]) return; ci[T] = !0; var A = ""; f && f._owner && f._owner !== Be.current && (A = " It was passed a child from " + it(f._owner.type) + "."), Vt(f), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', T, A), Vt(null); } } function di(f, m) { { if (typeof f != "object") return; if (_e(f)) for (var T = 0; T < f.length; T++) { var A = f[T]; Ne(A) && fi(A, m); } else if (Ne(f)) f._store && (f._store.validated = !0); else if (f) { var D = b(f); if (typeof D == "function" && D !== f.entries) for (var L = D.call(f), R; !(R = L.next()).done; ) Ne(R.value) && fi(R.value, m); } } } function Lo(f) { { var m = f.type; if (m == null || typeof m == "string") return; var T; if (typeof m == "function") T = m.propTypes; else if (typeof m == "object" && (m.$$typeof === l || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. m.$$typeof === d)) T = m.propTypes; else return; if (T) { var A = it(m); vo(T, f.props, "prop", A, f); } else if (m.PropTypes !== void 0 && !Ie) { Ie = !0; var D = it(m); x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", D || "Unknown"); } typeof m.getDefaultProps == "function" && !m.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function Oo(f) { { for (var m = Object.keys(f.props), T = 0; T < m.length; T++) { var A = m[T]; if (A !== "children" && A !== "key") { Vt(f), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", A), Vt(null); break; } } f.ref !== null && (Vt(f), x("Invalid attribute `ref` supplied to `React.Fragment`."), Vt(null)); } } var hi = {}; function pi(f, m, T, A, D, L) { { var R = z(f); if (!R) { var E = ""; (f === void 0 || typeof f == "object" && f !== null && Object.keys(f).length === 0) && (E += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var G = Do(); G ? E += G : E += ui(); var F; f === null ? F = "null" : _e(f) ? F = "array" : f !== void 0 && f.$$typeof === e ? (F = "<" + (it(f.type) || "Unknown") + " />", E = " Did you accidentally export a JSX literal instead of a component?") : F = typeof f, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", F, E); } var B = Co(f, m, T, D, L); if (B == null) return B; if (R) { var Q = m.children; if (Q !== void 0) if (A) if (_e(Q)) { for (var Et = 0; Et < Q.length; Et++) di(Q[Et], f); Object.freeze && Object.freeze(Q); } else x("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 di(Q, f); } if (Ut.call(m, "key")) { var gt = it(f), H = Object.keys(m).filter(function(Io) { return Io !== "key"; }), Ue = H.length > 0 ? "{key: someKey, " + H.join(": ..., ") + ": ...}" : "{key: someKey}"; if (!hi[gt + Ue]) { var Bo = H.length > 0 ? "{" + H.join(": ..., ") + ": ...}" : "{}"; x(`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} />`, Ue, gt, Bo, gt), hi[gt + Ue] = !0; } } return f === i ? Oo(B) : Lo(B), B; } } function ko(f, m, T) { return pi(f, m, T, !0); } function jo(f, m, T) { return pi(f, m, T, !1); } var Fo = jo, _o = ko; Wt.Fragment = i, Wt.jsx = Fo, Wt.jsxs = _o; }()), Wt; } var yi; function qo() { return yi || (yi = 1, process.env.NODE_ENV === "production" ? fe.exports = Ho() : fe.exports = Xo()), fe.exports; } var q = qo(); const Zo = { success: { background: "bg-green-100 border-l-4 border-green-500", hover: "hover:bg-green-200", icon: "✓", titleGradient: "bg-gradient-to-r from-green-600 to-green-500 bg-clip-text text-transparent", loadingBar: "bg-gradient-to-r from-transparent via-green-400 to-transparent" }, error: { background: "bg-red-100 border-l-4 border-red-500", hover: "hover:bg-red-200", icon: "⚠️", titleGradient: "bg-gradient-to-r from-red-600 to-red-500 bg-clip-text text-transparent", loadingBar: "bg-gradient-to-r from-transparent via-red-400 to-transparent" }, warning: { background: "bg-yellow-100 border-l-4 border-yellow-500", hover: "hover:bg-yellow-200", icon: "!", titleGradient: "bg-gradient-to-r from-yellow-600 to-yellow-500 bg-clip-text text-transparent", loadingBar: "bg-gradient-to-r from-transparent via-yellow-400 to-transparent" }, info: { background: "bg-blue-100 border-l-4 border-blue-500", hover: "hover:bg-blue-200", icon: "ℹ", titleGradient: "bg-gradient-to-r from-blue-600 to-blue-500 bg-clip-text text-transparent", loadingBar: "bg-gradient-to-r from-transparent via-blue-400 to-transparent" } }, Bs = Pt({}); function Jo(t) { const e = me(null); return e.current === null && (e.current = t()), e.current; } const xn = Pt(null), Is = Pt({ transformPagePoint: (t) => t, isStatic: !1, reducedMotion: "never" }); function Qo(t = !0) { const e = Y(xn); if (e === null) return [!0, null]; const { isPresent: n, onExitComplete: i, register: s } = e, o = No(); yn(() => { t && s(o); }, [t]); const r = vn(() => t && i && i(o), [o, i, t]); return !n && i ? [!1, r] : [!0]; } const Tn = typeof window < "u", ta = Tn ? Uo : yn, X = (t) => t; let Ft = X, dt = X; process.env.NODE_ENV !== "production" && (Ft = (t, e) => { !t && typeof console < "u" && console.warn(e); }, dt = (t, e) => { if (!t) throw new Error(e); }); function bn(t) { let e; return () => (e === void 0 && (e = t()), e); } const Ot = (t, e, n) => { const i = e - t; return i === 0 ? 1 : (n - t) / i; }, rt = (t) => t * 1e3, lt = (t) => t / 1e3, ea = { skipAnimations: !1, useManualTiming: !1 }; function na(t) { let e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), i = !1, s = !1; const o = /* @__PURE__ */ new WeakSet(); let r = { delta: 0, timestamp: 0, isProcessing: !1 }; function a(u) { o.has(u) && (l.schedule(u), t()), u(r); } const l = { /** * Schedule a process to run on the next frame. */ schedule: (u, c = !1, d = !1) => { const p = d && i ? e : n; return c && o.add(u), p.has(u) || p.add(u), u; }, /** * Cancel the provided callback from running on the next frame. */ cancel: (u) => { n.delete(u), o.delete(u); }, /** * Execute all schedule callbacks. */ process: (u) => { if (r = u, i) { s = !0; return; } i = !0, [e, n] = [n, e], e.forEach(a), e.clear(), i = !1, s && (s = !1, l.process(u)); } }; return l; } const de = [ "read", // Read "resolveKeyframes", // Write/Read/Write/Read "update", // Compute "preRender", // Compute "render", // Write "postRender" // Compute ], ia = 40; function Ns(t, e) { let n = !1, i = !0; const s = { delta: 0, timestamp: 0, isProcessing: !1 }, o = () => n = !0, r = de.reduce((g, x) => (g[x] = na(o), g), {}), { read: a, resolveKeyframes: l, update: u, preRender: c, render: d, postRender: h } = r, p = () => { const g = performance.now(); n = !1, s.delta = i ? 1e3 / 60 : Math.max(Math.min(g - s.timestamp, ia), 1), s.timestamp = g, s.isProcessing = !0, a.process(s), l.process(s), u.process(s), c.process(s), d.process(s), h.process(s), s.isProcessing = !1, n && e && (i = !1, t(p)); }, y = () => { n = !0, i = !0, s.isProcessing || t(p); }; return { schedule: de.reduce((g, x) => { const P = r[x]; return g[x] = (C, w = !1, M = !1) => (n || y(), P.schedule(C, w, M)), g; }, {}), cancel: (g) => { for (let x = 0; x < de.length; x++) r[de[x]].cancel(g); }, state: s, steps: r }; } const { schedule: O, cancel: ht, state: $, steps: $e } = Ns(typeof requestAnimationFrame < "u" ? requestAnimationFrame : X, !0), Us = Pt({ strict: !1 }), vi = { 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"] }, kt = {}; for (const t in vi) kt[t] = { isEnabled: (e) => vi[t].some((n) => !!e[n]) }; function sa(t) { for (const e in t) kt[e] = { ...kt[e], ...t[e] }; } const ra = /* @__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 xe(t) { return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || ra.has(t); } let $s = (t) => !xe(t); function oa(t) { t && ($s = (e) => e.startsWith("on") ? !xe(e) : t(e)); } try { oa(require("@emotion/is-prop-valid").default); } catch { } function aa(t, e, n) { const i = {}; for (const s in t) s === "values" && typeof t.values == "object" || ($s(s) || n === !0 && xe(s) || !e && !xe(s) || // If trying to use native HTML drag events, forward drag listeners t.draggable && s.startsWith("onDrag")) && (i[s] = t[s]); return i; } const xi = /* @__PURE__ */ new Set(); function Ee(t, e, n) { t || xi.has(e) || (console.warn(e), xi.add(e)); } function la(t) { if (typeof Proxy > "u") return t; const e = /* @__PURE__ */ new Map(), n = (...i) => (process.env.NODE_ENV !== "production" && Ee(!1, "motion() is deprecated. Use motion.create() instead."), t(...i)); return new Proxy(n, { /** * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. * The prop name is passed through as `key` and we can use that to generate a `motion` * DOM component with that name. */ get: (i, s) => s === "create" ? t : (e.has(s) || e.set(s, t(s)), e.get(s)) }); } const Re = Pt({}); function Jt(t) { return typeof t == "string" || Array.isArray(t); } function Ce(t) { return t !== null && typeof t == "object" && typeof t.start == "function"; } const Pn = [ "animate", "whileInView", "whileFocus", "whileHover", "whileTap", "whileDrag", "exit" ], Sn = ["initial", ...Pn]; function De(t) { return Ce(t.animate) || Sn.some((e) => Jt(t[e])); } function Ws(t) { return !!(De(t) || t.variants); } function ua(t, e) { if (De(t)) { const { initial: n, animate: i } = t; return { initial: n === !1 || Jt(n) ? n : void 0, animate: Jt(i) ? i : void 0 }; } return t.inherit !== !1 ? e : {}; } function ca(t) { const { initial: e, animate: n } = ua(t, Y(Re)); return Ve(() => ({ initial: e, animate: n }), [Ti(e), Ti(n)]); } function Ti(t) { return Array.isArray(t) ? t.join(" ") : t; } const fa = Symbol.for("motionComponentSymbol"); function Rt(t) { return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current"); } function da(t, e, n) { return vn( (i) => { i && t.mount && t.mount(i), e && (i ? e.mount(i) : e.unmount()), n && (typeof n == "function" ? n(i) : Rt(n) && (n.current = i)); }, /** * Only pass a new ref callback to React if we've received a visual element * factory. Otherwise we'll be mounting/remounting every time externalRef * or other dependencies change. */ [e] ); } const wn = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), ha = "framerAppearId", Ks = "data-" + wn(ha), { schedule: An, cancel: Cf } = Ns(queueMicrotask, !1), Gs = Pt({}); function pa(t, e, n, i, s) { var o, r; const { visualElement: a } = Y(Re), l = Y(Us), u = Y(xn), c = Y(Is).reducedMotion, d = me(null); i = i || l.renderer, !d.current && i && (d.current = i(t, { visualState: e, parent: a, props: n, presenceContext: u, blockInitialAnimation: u ? u.initial === !1 : !1, reducedMotionConfig: c })); const h = d.current, p = Y(Gs); h && !h.projection && s && (h.type === "html" || h.type === "svg") && ma(d.current, n, s, p); const y = me(!1); $o(() => { h && y.current && h.update(n, u); }); const v = n[Ks], b = me(!!v && !(!((o = window.MotionHandoffIsComplete) === null || o === void 0) && o.call(window, v)) && ((r = window.MotionHasOptimisedAnimation) === null || r === void 0 ? void 0 : r.call(window, v))); return ta(() => { h && (y.current = !0, window.MotionIsMounted = !0, h.updateFeatures(), An.render(h.render), b.current && h.animationState && h.animationState.animateChanges()); }), yn(() => { h && (!b.current && h.animationState && h.animationState.animateChanges(), b.current && (queueMicrotask(() => { var g; (g = window.MotionHandoffMarkAsComplete) === null || g === void 0 || g.call(window, v); }), b.current = !1)); }), h; } function ma(t, e, n, i) { const { layoutId: s, layout: o, drag: r, dragConstraints: a, layoutScroll: l, layoutRoot: u } = e; t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : Ys(t.parent)), t.projection.setOptions({ layoutId: s, layout: o, alwaysMeasureLayout: !!r || a && Rt(a), visualElement: t, /** * TODO: Update options in an effect. This could be tricky as it'll be too late * to update by the time layout animations run. * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, * ensuring it gets called if there's no potential layout animations. * */ animationType: typeof o == "string" ? o : "both", initialPromotionConfig: i, layoutScroll: l, layoutRoot: u }); } function Ys(t) { if (t) return t.options.allowProjection !== !1 ? t.projection : Ys(t.parent); } function ga({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVisualState: i, Component: s }) { var o, r; t && sa(t); function a(u, c) { let d; const h = { ...Y(Is), ...u, layoutId: ya(u) }, { isStatic: p } = h, y = ca(u), v = i(u, p); if (!p && Tn) { va(h, t); const b = xa(h); d = b.MeasureLayout, y.visualElement = pa(s, v, h, e, b.ProjectionNode); } return q.jsxs(Re.Provider, { value: y, children: [d && y.visualElement ? q.jsx(d, { visualElement: y.visualElement, ...h }) : null, n(s, u, da(v, y.visualElement, c), v, p, y.visualElement)] }); } a.displayName = `motion.${typeof s == "string" ? s : `create(${(r = (o = s.displayName) !== null && o !== void 0 ? o : s.name) !== null && r !== void 0 ? r : ""})`}`; const l = Wo(a); return l[fa] = s, l; } function ya({ layoutId: t }) { const e = Y(Bs).id; return e && t !== void 0 ? e + "-" + t : t; } function va(t, e) { const n = Y(Us).strict; if (process.env.NODE_ENV !== "production" && e && n) { const i = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."; t.ignoreStrict ? Ft(!1, i) : dt(!1, i); } } function xa(t) { const { drag: e, layout: n } = kt; if (!e && !n) return {}; const i = { ...e, ...n }; return { MeasureLayout: e != null && e.isEnabled(t) || n != null && n.isEnabled(t) ? i.MeasureLayout : void 0, ProjectionNode: i.ProjectionNode }; } const Ta = [ "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 Vn(t) { return ( /** * If it's not a string, it's a custom React component. Currently we only support * HTML custom React components. */ typeof t != "string" || /** * If it contains a dash, the element is a custom HTML webcomponent. */ t.includes("-") ? !1 : ( /** * If it's in our list of lowercase SVG tags, it's an SVG component */ !!(Ta.indexOf(t) > -1 || /** * If it contains a capital letter, it's an SVG component */ /[A-Z]/u.test(t)) ) ); } function zs(t, { style: e, vars: n }, i, s) { Object.assign(t.style, e, s && s.getProjectionStyles(i)); for (const o in n) t.style.setProperty(o, n[o]); } const Hs = /* @__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 Xs(t, e, n, i) { zs(t, e, void 0, i); for (const s in e.attrs) t.setAttribute(Hs.has(s) ? s : wn(s), e.attrs[s]); } const K = (t) => !!(t && t.getVelocity), _t = [ "transformPerspective", "x", "y", "z", "translateX", "translateY", "translateZ", "scale", "scaleX", "scaleY", "rotate", "rotateX", "rotateY", "rotateZ", "skew", "skewX", "skewY" ], Bt = new Set(_t), Te = {}; function ba(t) { Object.assign(Te, t); } function qs(t, { layout: e, layoutId: n }) { return Bt.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!Te[t] || t === "opacity"); } function En(t, e, n) { var i; const { style: s } = t, o = {}; for (const r in s) (K(s[r]) || e.style && K(e.style[r]) || qs(r, t) || ((i = n == null ? void 0 : n.getValue(r)) === null || i === void 0 ? void 0 : i.liveStyle) !== void 0) && (o[r] = s[r]); return o; } function Zs(t, e, n) { const i = En(t, e, n); for (const s in t) if (K(t[s]) || K(e[s])) { const o = _t.indexOf(s) !== -1 ? "attr" + s.charAt(0).toUpperCase() + s.substring(1) : s; i[o] = t[s]; } return i; } function bi(t) { const e = [{}, {}]; return t == null || t.values.forEach((n, i) => { e[0][i] = n.get(), e[1][i] = n.getVelocity(); }), e; } function Rn(t, e, n, i) { if (typeof e == "function") { const [s, o] = bi(i); e = e(n !== void 0 ? n : t.custom, s, o); } if (typeof e == "string" && (e = t.variants && t.variants[e]), typeof e == "function") { const [s, o] = bi(i); e = e(n !== void 0 ? n : t.custom, s, o); } return e; } const tn = (t) => Array.isArray(t), Pa = (t) => !!(t && typeof t == "object" && t.mix && t.toValue), Sa = (t) => tn(t) ? t[t.length - 1] || 0 : t; function ge(t) { const e = K(t) ? t.get() : t; return Pa(e) ? e.toValue() : e; } function wa({ scrapeMotionValuesFromProps: t, createRenderState: e, onMount: n }, i, s, o) { const r = { latestValues: Aa(i, s, o, t), renderState: e() }; return n && (r.mount = (a) => n(i, a, r)), r; } const Js = (t) => (e, n) => { const i = Y(Re), s = Y(xn), o = () => wa(t, e, i, s); return n ? o() : Jo(o); }; function Aa(t, e, n, i) { const s = {}, o = i(t, {}); for (const h in o) s[h] = ge(o[h]); let { initial: r, animate: a } = t; const l = De(t), u = Ws(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 : !1; c = c || r === !1; const d = c ? a : r; if (d && typeof d != "boolean" && !Ce(d)) { const h = Array.isArray(d) ? d : [d]; for (let p = 0; p < h.length; p++) { const y = Rn(t, h[p]); if (y) { const { transitionEnd: v, transition: b, ...g } = y; for (const x in g) { let P = g[x]; if (Array.isArray(P)) { const C = c ? P.length - 1 : 0; P = P[C]; } P !== null && (s[x] = P); } for (const x in v) s[x] = v[x]; } } } return s; } const Cn = () => ({ style: {}, transform: {}, transformOrigin: {}, vars: {} }), Qs = () => ({ ...Cn(), attrs: {} }), tr = (t) => (e) => typeof e == "string" && e.startsWith(t), er = /* @__PURE__ */ tr("--"), Va = /* @__PURE__ */ tr("var(--"), Dn = (t) => Va(t) ? Ea.test(t.split("/*")[0].trim()) : !1, Ea = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, nr = (t, e) => e && typeof t == "number" ? e.transform(t) : t, ut = (t, e, n) => n > e ? e : n < t ? t : n, It = { test: (t) => typeof t == "number", parse: parseFloat, transform: (t) => t }, Qt = { ...It, transform: (t) => ut(0, 1, t) }, he = { ...It, default: 1 }, ie = (t) => ({ test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1, parse: parseFloat, transform: (e) => `${e}${t}` }), ft = /* @__PURE__ */ ie("deg"), ot = /* @__PURE__ */ ie("%"), S = /* @__PURE__ */ ie("px"), Ra = /* @__PURE__ */ ie("vh"), Ca = /* @__PURE__ */ ie("vw"), Pi = { ...ot, parse: (t) => ot.parse(t) / 100, transform: (t) => ot.transform(t * 100) }, Da = { // Border props borderWidth: S, borderTopWidth: S, borderRightWidth: S, borderBottomWidth: S, borderLeftWidth: S, borderRadius: S, radius: S, borderTopLeftRadius: S, borderTopRightRadius: S, borderBottomRightRadius: S, borderBottomLeftRadius: S, // Positioning props width: S, maxWidth: S, height: S, maxHeight: S, top: S, right: S, bottom: S, left: S, // Spacing props padding: S, paddingTop: S, paddingRight: S, paddingBottom: S, paddingLeft: S, margin: S, marginTop: S, marginRight: S, marginBottom: S, marginLeft: S, // Misc backgroundPositionX: S, backgroundPositionY: S }, Ma = { rotate: ft, rotateX: ft, rotateY: ft, rotateZ: ft, scale: he, scaleX: he, scaleY: he, scaleZ: he, skew: ft, skewX: ft, skewY: ft, distance: S, translateX: S, translateY: S, translateZ: S, x: S, y: S, z: S, perspective: S, transformPerspective: S, opacity: Qt, originX: Pi, originY: Pi, originZ: S }, Si = { ...It, transform: Math.round }, Mn = { ...Da, ...Ma, zIndex: Si, size: S, // SVG fillOpacity: Qt, strokeOpacity: Qt, numOctaves: Si }, La = { x: "translateX", y: "translateY", z: "translateZ", transformPerspective: "perspective" }, Oa = _t.length; function ka(t, e, n) { let i = "", s = !0; for (let o = 0; o < Oa; o++) { const r = _t[o], a = t[r]; if (a === void 0) continue; let l = !0; if (typeof a == "number" ? l = a === (r.startsWith("scale") ? 1 : 0) : l = parseFloat(a) === 0, !l || n) { const u = nr(a, Mn[r]); if (!l) { s = !1; const c = La[r] || r; i += `${c}(${u}) `; } n && (e[r] = u); } } return i = i.trim(), n ? i = n(e, s ? "" : i) : s && (i = "none"), i; } function Ln(t, e, n) { const { style: i, vars: s, transformOrigin: o } = t; let r = !1, a = !1; for (const l in e) { const u = e[l]; if (Bt.has(l)) { r = !0; continue; } else if (er(l)) { s[l] = u; continue; } else { const c = nr(u, Mn[l]); l.startsWith("origin") ? (a = !0, o[l] = c) : i[l] = c; } } if (e.transform || (r || n ? i.transform = ka(e, t.transform, n) : i.transform && (i.transform = "none")), a) { const { originX: l = "50%", originY: u = "50%", originZ: c = 0 } = o; i.transformOrigin = `${l} ${u} ${c}`; } } function wi(t, e, n) { return typeof t == "string" ? t : S.transform(e + n * t); } function ja(t, e, n) { const i = wi(e, t.x, t.width), s = wi(n, t.y, t.height); return `${i} ${s}`; } const Fa = { offset: "stroke-dashoffset", array: "stroke-dasharray" }, _a = { offset: "strokeDashoffset", array: "strokeDasharray" }; function Ba(t, e, n = 1, i = 0, s = !0) { t.pathLength = 1; const o = s ? Fa : _a; t[o.offset] = S.transform(-i); const r = S.transform(e), a = S.transform(n); t[o.array] = `${r} ${a}`; } function On(t, { attrX: e, attrY: n, attrScale: i, originX: s, originY: o, pathLength: r, pathSpacing: a = 1, pathOffset: l = 0, // This is object creation, which we try to avoid per-frame. ...u }, c, d) { if (Ln(t, u, d), c) { t.style.viewBox && (t.attrs.viewBox = t.style.viewBox); return; } t.attrs = t.style, t.style = {}; const { attrs: h, style: p, dimensions: y } = t; h.transform && (y && (p.transform = h.transform), delete h.transform), y && (s !== void 0 || o !== void 0 || p.transform) && (p.transformOrigin = ja(y, s !== void 0 ? s : 0.5, o !== void 0 ? o : 0.5)), e !== void 0 && (h.x = e), n !== void 0 && (h.y = n), i !== void 0 && (h.scale = i), r !== void 0 && Ba(h, r, a, l, !1); } const kn = (t) => typeof t == "string" && t.toLowerCase() === "svg", Ia = { useVisualState: Js({ scrapeMotionValuesFromProps: Zs, createRenderState: Qs, onMount: (t, e, { renderState: n, latestValues: i }) => { O.read(() => { try { n.dimensions = typeof e.getBBox == "function" ? e.getBBox() : e.getBoundingClientRect(); } catch { n.dimensions = { x: 0, y: 0, width: 0, height: 0 }; } }), O.render(() => { On(n, i, kn(e.tagName), t.transformTemplate), Xs(e, n); }); } }) }, Na = { useVisualState: Js({ scrapeMotionValuesFromProps: En, createRenderState: Cn }) }; function ir(t, e, n) { for (const i in e) !K(e[i]) && !qs(i, n) && (t[i] = e[i]); } function Ua({ transformTemplate: t }, e) { return Ve(() => { const n = Cn(); return Ln(n, e, t), Object.assign({}, n.vars, n.style); }, [e]); } function $a(t, e) { const n = t.style || {}, i = {}; return ir(i, n, t), Object.assign(i, Ua(t, e)), i; } function Wa(t, e) { const n = {}, i = $a(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; } function Ka(t, e, n, i) { const s = Ve(() => { const o = Qs(); return On(o, e, kn(i), t.transformTemplate), { ...o.attrs, style: { ...o.style } }; }, [e]); if (t.style) { const o = {}; ir(o, t.style, t), s.style = { ...o, ...s.style }; } return s; } function Ga(t = !1) { return (n, i, s, { latestValues: o }, r) => { const l = (Vn(n) ? Ka : Wa)(i, o, r, n), u = aa(i, typeof n == "string", t), c = n !== Fs ? { ...u, ...l, ref: s } : {}, { children: d } = i, h = Ve(() => K(d) ? d.get() : d, [d]); return Ko(n, { ...c, children: h }); }; } function Ya(t, e) { return function(i, { forwardMotionProps: s } = { forwardMotionProps: !1 }) { const r = { ...Vn(i) ? Ia : Na, preloadedFeatures: t, useRender: Ga(s), createVisualElement: e, Component: i }; return ga(r); }; } function sr(t, e) { if (!Array.isArray(e)) return !1; const n = e.length; if (n !== t.length) return !1; for (let i = 0; i < n; i++) if (e[i] !== t[i]) return !1; return !0; } function Me(t, e, n) { const i = t.getProps(); return Rn(i, e, n !== void 0 ? n : i.custom, t); } const za = bn(() => window.ScrollTimeline !== void 0); class Ha { 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)); } /** * TODO: Filter out cancelled or stopped animations before returning */ 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((s) => { if (za() && s.attachTimeline) return s.attachTimeline(e); if (typeof n == "function") return n(s); }); return () => { i.forEach((s, o) => { s && s(), this.animations[o].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 Xa extends Ha { then(e, n) { return Promise.all(this.animations).then(e).catch(n); } } function jn(t, e) { return t ? t[e] || t.default || t : void 0; } const en = 2e4; function rr(t) { let e = 0; const n = 50; let i = t.next(e); for (; !i.done && e < en; ) e += n, i = t.next(e); return e >= en ? 1 / 0 : e; } function Fn(t) { return typeof t == "function"; } function Ai(t, e) { t.timeline = e, t.onfinish = null; } const _n = (t) => Array.isArray(t) && typeof t[0] == "number", qa = { linearEasing: void 0 }; function Za(t, e) { const n = bn(t); return () => { var i; return (i = qa[e]) !== null && i !== void 0 ? i : n(); }; } const be = /* @__PURE__ */ Za(() => { try { document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" }); } catch { return !1; } return !0; }, "linearEasing"), or = (t, e, n = 10) => { let i = ""; const s = Math.max(Math.round(e / n), 2); for (let o = 0; o < s; o++) i += t(Ot(0, s - 1, o)) + ", "; return `linear(${i.substring(0, i.length - 2)})`; }; function ar(t) { return !!(typeof t == "function" && be() || !t || typeof t == "string" && (t in nn || be()) || _n(t) || Array.isArray(t) && t.every(ar)); } const Gt = ([t, e, n, i]) => `cubic-bezier(${t}, ${e}, ${n}, ${i})`, nn = { linear: "linear", ease: "ease", easeIn: "ease-in", easeOut: "ease-out", easeInOut: "ease-in-out", circIn: /* @__PURE__ */ Gt([0, 0.65, 0.55, 1]), circOut: /* @__PURE__ */ Gt([0.55, 0, 1, 0.45]), backIn: /* @__PURE__ */ Gt([0.31, 0.01, 0.66, -0.59]), backOut: /* @__PURE__ */ Gt([0.33, 1.53, 0.69, 0.99]) }; function lr(t, e) { if (t) return typeof t == "function" && be() ? or(t, e) : _n(t) ? Gt(t) : Array.isArray(t) ? t.map((n) => lr(n, e) || nn.easeOut) : nn[t]; } const nt = { x: !1, y: !1 }; function ur() { return nt.x || nt.y; } function Ja(t, e, n) { var i; if (t instanceof Element) return [t]; if (typeof t == "string") { let s = document; const o = (i = void 0) !== null && i !== void 0 ? i : s.querySelectorAll(t); return o ? Array.from(o) : []; } return Array.from(t); } function cr(t, e) { const n = Ja(t), i = new AbortController(), s = { passive: !0, ...e, signal: i.signal }; return [n, s, () => i.abort()]; } function Vi(t) { return (e) => { e.pointerType === "touch" || ur() || t(e); }; } function Qa(t, e, n = {}) { const [i, s, o] = cr(t, n), r = Vi((a) => { const { target: l } = a, u = e(a); if (typeof u != "function" || !l) return; const c = Vi((d) => { u(d), l.removeEventListener("pointerleave", c); }); l.addEventListener("pointerleave", c, s); }); return i.forEach((a) => { a.addEventListener("pointerenter", r, s); }), o; } const fr = (t, e) => e ? t === e ? !0 :