import { jsxs as Ce, jsx as Y } from "react/jsx-runtime";
import k, { useState as le, useEffect as Fe } from "react";
import { as as er, y as Be, c as rr, z as we, W as tr } from "./index-_1f6rhg6.js";
var ge = { exports: {} }, pe, Re;
function _e() {
  if (Re)
    return pe;
  Re = 1;
  var r = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
  return pe = r, pe;
}
var ye, xe;
function nr() {
  if (xe)
    return ye;
  xe = 1;
  var r = _e();
  function e() {
  }
  function t() {
  }
  return t.resetWarningCache = e, ye = function() {
    function n(v, l, f, p, d, m) {
      if (m !== r) {
        var h = new Error(
          "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
        );
        throw h.name = "Invariant Violation", h;
      }
    }
    n.isRequired = n;
    function u() {
      return n;
    }
    var a = {
      array: n,
      bigint: n,
      bool: n,
      func: n,
      number: n,
      object: n,
      string: n,
      symbol: n,
      any: n,
      arrayOf: u,
      element: n,
      elementType: n,
      instanceOf: u,
      node: n,
      objectOf: u,
      oneOf: u,
      oneOfType: u,
      shape: u,
      exact: u,
      checkPropTypes: t,
      resetWarningCache: e
    };
    return a.PropTypes = a, a;
  }, ye;
}
var se = { exports: {} }, C = {};
/** @license React v16.13.1
 * react-is.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 Ae;
function or() {
  return Ae || (Ae = 1, process.env.NODE_ENV !== "production" && function() {
    var r = typeof Symbol == "function" && Symbol.for, e = r ? Symbol.for("react.element") : 60103, t = r ? Symbol.for("react.portal") : 60106, n = r ? Symbol.for("react.fragment") : 60107, u = r ? Symbol.for("react.strict_mode") : 60108, a = r ? Symbol.for("react.profiler") : 60114, v = r ? Symbol.for("react.provider") : 60109, l = r ? Symbol.for("react.context") : 60110, f = r ? Symbol.for("react.async_mode") : 60111, p = r ? Symbol.for("react.concurrent_mode") : 60111, d = r ? Symbol.for("react.forward_ref") : 60112, m = r ? Symbol.for("react.suspense") : 60113, h = r ? Symbol.for("react.suspense_list") : 60120, R = r ? Symbol.for("react.memo") : 60115, j = r ? Symbol.for("react.lazy") : 60116, P = r ? Symbol.for("react.block") : 60121, A = r ? Symbol.for("react.fundamental") : 60117, L = r ? Symbol.for("react.responder") : 60118, G = r ? Symbol.for("react.scope") : 60119;
    function I(s) {
      return typeof s == "string" || typeof s == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
      s === n || s === p || s === a || s === u || s === m || s === h || typeof s == "object" && s !== null && (s.$$typeof === j || s.$$typeof === R || s.$$typeof === v || s.$$typeof === l || s.$$typeof === d || s.$$typeof === A || s.$$typeof === L || s.$$typeof === G || s.$$typeof === P);
    }
    function $(s) {
      if (typeof s == "object" && s !== null) {
        var F = s.$$typeof;
        switch (F) {
          case e:
            var ie = s.type;
            switch (ie) {
              case f:
              case p:
              case n:
              case a:
              case u:
              case m:
                return ie;
              default:
                var Pe = ie && ie.$$typeof;
                switch (Pe) {
                  case l:
                  case d:
                  case j:
                  case R:
                  case v:
                    return Pe;
                  default:
                    return F;
                }
            }
          case t:
            return F;
        }
      }
    }
    var i = f, B = p, X = l, re = v, Z = e, te = d, J = n, ne = j, oe = R, z = t, U = a, D = u, H = m, Q = !1;
    function ae(s) {
      return Q || (Q = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), o(s) || $(s) === f;
    }
    function o(s) {
      return $(s) === p;
    }
    function c(s) {
      return $(s) === l;
    }
    function g(s) {
      return $(s) === v;
    }
    function E(s) {
      return typeof s == "object" && s !== null && s.$$typeof === e;
    }
    function b(s) {
      return $(s) === d;
    }
    function _(s) {
      return $(s) === n;
    }
    function y(s) {
      return $(s) === j;
    }
    function S(s) {
      return $(s) === R;
    }
    function T(s) {
      return $(s) === t;
    }
    function x(s) {
      return $(s) === a;
    }
    function O(s) {
      return $(s) === u;
    }
    function W(s) {
      return $(s) === m;
    }
    C.AsyncMode = i, C.ConcurrentMode = B, C.ContextConsumer = X, C.ContextProvider = re, C.Element = Z, C.ForwardRef = te, C.Fragment = J, C.Lazy = ne, C.Memo = oe, C.Portal = z, C.Profiler = U, C.StrictMode = D, C.Suspense = H, C.isAsyncMode = ae, C.isConcurrentMode = o, C.isContextConsumer = c, C.isContextProvider = g, C.isElement = E, C.isForwardRef = b, C.isFragment = _, C.isLazy = y, C.isMemo = S, C.isPortal = T, C.isProfiler = x, C.isStrictMode = O, C.isSuspense = W, C.isValidElementType = I, C.typeOf = $;
  }()), C;
}
var w = {};
/** @license React v16.13.1
 * react-is.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 je;
function ar() {
  if (je)
    return w;
  je = 1;
  var r = typeof Symbol == "function" && Symbol.for, e = r ? Symbol.for("react.element") : 60103, t = r ? Symbol.for("react.portal") : 60106, n = r ? Symbol.for("react.fragment") : 60107, u = r ? Symbol.for("react.strict_mode") : 60108, a = r ? Symbol.for("react.profiler") : 60114, v = r ? Symbol.for("react.provider") : 60109, l = r ? Symbol.for("react.context") : 60110, f = r ? Symbol.for("react.async_mode") : 60111, p = r ? Symbol.for("react.concurrent_mode") : 60111, d = r ? Symbol.for("react.forward_ref") : 60112, m = r ? Symbol.for("react.suspense") : 60113, h = r ? Symbol.for("react.suspense_list") : 60120, R = r ? Symbol.for("react.memo") : 60115, j = r ? Symbol.for("react.lazy") : 60116, P = r ? Symbol.for("react.block") : 60121, A = r ? Symbol.for("react.fundamental") : 60117, L = r ? Symbol.for("react.responder") : 60118, G = r ? Symbol.for("react.scope") : 60119;
  function I(i) {
    if (typeof i == "object" && i !== null) {
      var B = i.$$typeof;
      switch (B) {
        case e:
          switch (i = i.type, i) {
            case f:
            case p:
            case n:
            case a:
            case u:
            case m:
              return i;
            default:
              switch (i = i && i.$$typeof, i) {
                case l:
                case d:
                case j:
                case R:
                case v:
                  return i;
                default:
                  return B;
              }
          }
        case t:
          return B;
      }
    }
  }
  function $(i) {
    return I(i) === p;
  }
  return w.AsyncMode = f, w.ConcurrentMode = p, w.ContextConsumer = l, w.ContextProvider = v, w.Element = e, w.ForwardRef = d, w.Fragment = n, w.Lazy = j, w.Memo = R, w.Portal = t, w.Profiler = a, w.StrictMode = u, w.Suspense = m, w.isAsyncMode = function(i) {
    return $(i) || I(i) === f;
  }, w.isConcurrentMode = $, w.isContextConsumer = function(i) {
    return I(i) === l;
  }, w.isContextProvider = function(i) {
    return I(i) === v;
  }, w.isElement = function(i) {
    return typeof i == "object" && i !== null && i.$$typeof === e;
  }, w.isForwardRef = function(i) {
    return I(i) === d;
  }, w.isFragment = function(i) {
    return I(i) === n;
  }, w.isLazy = function(i) {
    return I(i) === j;
  }, w.isMemo = function(i) {
    return I(i) === R;
  }, w.isPortal = function(i) {
    return I(i) === t;
  }, w.isProfiler = function(i) {
    return I(i) === a;
  }, w.isStrictMode = function(i) {
    return I(i) === u;
  }, w.isSuspense = function(i) {
    return I(i) === m;
  }, w.isValidElementType = function(i) {
    return typeof i == "string" || typeof i == "function" || i === n || i === p || i === a || i === u || i === m || i === h || typeof i == "object" && i !== null && (i.$$typeof === j || i.$$typeof === R || i.$$typeof === v || i.$$typeof === l || i.$$typeof === d || i.$$typeof === A || i.$$typeof === L || i.$$typeof === G || i.$$typeof === P);
  }, w.typeOf = I, w;
}
var Ie;
function ze() {
  return Ie || (Ie = 1, process.env.NODE_ENV === "production" ? se.exports = ar() : se.exports = or()), se.exports;
}
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var ve, $e;
function ir() {
  if ($e)
    return ve;
  $e = 1;
  var r = Object.getOwnPropertySymbols, e = Object.prototype.hasOwnProperty, t = Object.prototype.propertyIsEnumerable;
  function n(a) {
    if (a == null)
      throw new TypeError("Object.assign cannot be called with null or undefined");
    return Object(a);
  }
  function u() {
    try {
      if (!Object.assign)
        return !1;
      var a = new String("abc");
      if (a[5] = "de", Object.getOwnPropertyNames(a)[0] === "5")
        return !1;
      for (var v = {}, l = 0; l < 10; l++)
        v["_" + String.fromCharCode(l)] = l;
      var f = Object.getOwnPropertyNames(v).map(function(d) {
        return v[d];
      });
      if (f.join("") !== "0123456789")
        return !1;
      var p = {};
      return "abcdefghijklmnopqrst".split("").forEach(function(d) {
        p[d] = d;
      }), Object.keys(Object.assign({}, p)).join("") === "abcdefghijklmnopqrst";
    } catch {
      return !1;
    }
  }
  return ve = u() ? Object.assign : function(a, v) {
    for (var l, f = n(a), p, d = 1; d < arguments.length; d++) {
      l = Object(arguments[d]);
      for (var m in l)
        e.call(l, m) && (f[m] = l[m]);
      if (r) {
        p = r(l);
        for (var h = 0; h < p.length; h++)
          t.call(l, p[h]) && (f[p[h]] = l[p[h]]);
      }
    }
    return f;
  }, ve;
}
var me, ke;
function He() {
  return ke || (ke = 1, me = Function.call.bind(Object.prototype.hasOwnProperty)), me;
}
var be, Le;
function sr() {
  if (Le)
    return be;
  Le = 1;
  var r = function() {
  };
  if (process.env.NODE_ENV !== "production") {
    var e = _e(), t = {}, n = He();
    r = function(a) {
      var v = "Warning: " + a;
      typeof console < "u" && console.error(v);
      try {
        throw new Error(v);
      } catch {
      }
    };
  }
  function u(a, v, l, f, p) {
    if (process.env.NODE_ENV !== "production") {
      for (var d in a)
        if (n(a, d)) {
          var m;
          try {
            if (typeof a[d] != "function") {
              var h = Error(
                (f || "React class") + ": " + l + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
              );
              throw h.name = "Invariant Violation", h;
            }
            m = a[d](v, d, f, l, null, e);
          } catch (j) {
            m = j;
          }
          if (m && !(m instanceof Error) && r(
            (f || "React class") + ": type specification of " + l + " `" + d + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof m + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
          ), m instanceof Error && !(m.message in t)) {
            t[m.message] = !0;
            var R = p ? p() : "";
            r(
              "Failed " + l + " type: " + m.message + (R ?? "")
            );
          }
        }
    }
  }
  return u.resetWarningCache = function() {
    process.env.NODE_ENV !== "production" && (t = {});
  }, be = u, be;
}
var he, Me;
function cr() {
  if (Me)
    return he;
  Me = 1;
  var r = ze(), e = ir(), t = _e(), n = He(), u = sr(), a = function() {
  };
  process.env.NODE_ENV !== "production" && (a = function(l) {
    var f = "Warning: " + l;
    typeof console < "u" && console.error(f);
    try {
      throw new Error(f);
    } catch {
    }
  });
  function v() {
    return null;
  }
  return he = function(l, f) {
    var p = typeof Symbol == "function" && Symbol.iterator, d = "@@iterator";
    function m(o) {
      var c = o && (p && o[p] || o[d]);
      if (typeof c == "function")
        return c;
    }
    var h = "<<anonymous>>", R = {
      array: L("array"),
      bigint: L("bigint"),
      bool: L("boolean"),
      func: L("function"),
      number: L("number"),
      object: L("object"),
      string: L("string"),
      symbol: L("symbol"),
      any: G(),
      arrayOf: I,
      element: $(),
      elementType: i(),
      instanceOf: B,
      node: te(),
      objectOf: re,
      oneOf: X,
      oneOfType: Z,
      shape: ne,
      exact: oe
    };
    function j(o, c) {
      return o === c ? o !== 0 || 1 / o === 1 / c : o !== o && c !== c;
    }
    function P(o, c) {
      this.message = o, this.data = c && typeof c == "object" ? c : {}, this.stack = "";
    }
    P.prototype = Error.prototype;
    function A(o) {
      if (process.env.NODE_ENV !== "production")
        var c = {}, g = 0;
      function E(_, y, S, T, x, O, W) {
        if (T = T || h, O = O || S, W !== t) {
          if (f) {
            var s = new Error(
              "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
            );
            throw s.name = "Invariant Violation", s;
          } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
            var F = T + ":" + S;
            !c[F] && // Avoid spamming the console because they are often not actionable except for lib authors
            g < 3 && (a(
              "You are manually calling a React.PropTypes validation function for the `" + O + "` prop on `" + T + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
            ), c[F] = !0, g++);
          }
        }
        return y[S] == null ? _ ? y[S] === null ? new P("The " + x + " `" + O + "` is marked as required " + ("in `" + T + "`, but its value is `null`.")) : new P("The " + x + " `" + O + "` is marked as required in " + ("`" + T + "`, but its value is `undefined`.")) : null : o(y, S, T, x, O);
      }
      var b = E.bind(null, !1);
      return b.isRequired = E.bind(null, !0), b;
    }
    function L(o) {
      function c(g, E, b, _, y, S) {
        var T = g[E], x = D(T);
        if (x !== o) {
          var O = H(T);
          return new P(
            "Invalid " + _ + " `" + y + "` of type " + ("`" + O + "` supplied to `" + b + "`, expected ") + ("`" + o + "`."),
            { expectedType: o }
          );
        }
        return null;
      }
      return A(c);
    }
    function G() {
      return A(v);
    }
    function I(o) {
      function c(g, E, b, _, y) {
        if (typeof o != "function")
          return new P("Property `" + y + "` of component `" + b + "` has invalid PropType notation inside arrayOf.");
        var S = g[E];
        if (!Array.isArray(S)) {
          var T = D(S);
          return new P("Invalid " + _ + " `" + y + "` of type " + ("`" + T + "` supplied to `" + b + "`, expected an array."));
        }
        for (var x = 0; x < S.length; x++) {
          var O = o(S, x, b, _, y + "[" + x + "]", t);
          if (O instanceof Error)
            return O;
        }
        return null;
      }
      return A(c);
    }
    function $() {
      function o(c, g, E, b, _) {
        var y = c[g];
        if (!l(y)) {
          var S = D(y);
          return new P("Invalid " + b + " `" + _ + "` of type " + ("`" + S + "` supplied to `" + E + "`, expected a single ReactElement."));
        }
        return null;
      }
      return A(o);
    }
    function i() {
      function o(c, g, E, b, _) {
        var y = c[g];
        if (!r.isValidElementType(y)) {
          var S = D(y);
          return new P("Invalid " + b + " `" + _ + "` of type " + ("`" + S + "` supplied to `" + E + "`, expected a single ReactElement type."));
        }
        return null;
      }
      return A(o);
    }
    function B(o) {
      function c(g, E, b, _, y) {
        if (!(g[E] instanceof o)) {
          var S = o.name || h, T = ae(g[E]);
          return new P("Invalid " + _ + " `" + y + "` of type " + ("`" + T + "` supplied to `" + b + "`, expected ") + ("instance of `" + S + "`."));
        }
        return null;
      }
      return A(c);
    }
    function X(o) {
      if (!Array.isArray(o))
        return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? a(
          "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
        ) : a("Invalid argument supplied to oneOf, expected an array.")), v;
      function c(g, E, b, _, y) {
        for (var S = g[E], T = 0; T < o.length; T++)
          if (j(S, o[T]))
            return null;
        var x = JSON.stringify(o, function(W, s) {
          var F = H(s);
          return F === "symbol" ? String(s) : s;
        });
        return new P("Invalid " + _ + " `" + y + "` of value `" + String(S) + "` " + ("supplied to `" + b + "`, expected one of " + x + "."));
      }
      return A(c);
    }
    function re(o) {
      function c(g, E, b, _, y) {
        if (typeof o != "function")
          return new P("Property `" + y + "` of component `" + b + "` has invalid PropType notation inside objectOf.");
        var S = g[E], T = D(S);
        if (T !== "object")
          return new P("Invalid " + _ + " `" + y + "` of type " + ("`" + T + "` supplied to `" + b + "`, expected an object."));
        for (var x in S)
          if (n(S, x)) {
            var O = o(S, x, b, _, y + "." + x, t);
            if (O instanceof Error)
              return O;
          }
        return null;
      }
      return A(c);
    }
    function Z(o) {
      if (!Array.isArray(o))
        return process.env.NODE_ENV !== "production" && a("Invalid argument supplied to oneOfType, expected an instance of array."), v;
      for (var c = 0; c < o.length; c++) {
        var g = o[c];
        if (typeof g != "function")
          return a(
            "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + Q(g) + " at index " + c + "."
          ), v;
      }
      function E(b, _, y, S, T) {
        for (var x = [], O = 0; O < o.length; O++) {
          var W = o[O], s = W(b, _, y, S, T, t);
          if (s == null)
            return null;
          s.data && n(s.data, "expectedType") && x.push(s.data.expectedType);
        }
        var F = x.length > 0 ? ", expected one of type [" + x.join(", ") + "]" : "";
        return new P("Invalid " + S + " `" + T + "` supplied to " + ("`" + y + "`" + F + "."));
      }
      return A(E);
    }
    function te() {
      function o(c, g, E, b, _) {
        return z(c[g]) ? null : new P("Invalid " + b + " `" + _ + "` supplied to " + ("`" + E + "`, expected a ReactNode."));
      }
      return A(o);
    }
    function J(o, c, g, E, b) {
      return new P(
        (o || "React class") + ": " + c + " type `" + g + "." + E + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + b + "`."
      );
    }
    function ne(o) {
      function c(g, E, b, _, y) {
        var S = g[E], T = D(S);
        if (T !== "object")
          return new P("Invalid " + _ + " `" + y + "` of type `" + T + "` " + ("supplied to `" + b + "`, expected `object`."));
        for (var x in o) {
          var O = o[x];
          if (typeof O != "function")
            return J(b, _, y, x, H(O));
          var W = O(S, x, b, _, y + "." + x, t);
          if (W)
            return W;
        }
        return null;
      }
      return A(c);
    }
    function oe(o) {
      function c(g, E, b, _, y) {
        var S = g[E], T = D(S);
        if (T !== "object")
          return new P("Invalid " + _ + " `" + y + "` of type `" + T + "` " + ("supplied to `" + b + "`, expected `object`."));
        var x = e({}, g[E], o);
        for (var O in x) {
          var W = o[O];
          if (n(o, O) && typeof W != "function")
            return J(b, _, y, O, H(W));
          if (!W)
            return new P(
              "Invalid " + _ + " `" + y + "` key `" + O + "` supplied to `" + b + "`.\nBad object: " + JSON.stringify(g[E], null, "  ") + `
Valid keys: ` + JSON.stringify(Object.keys(o), null, "  ")
            );
          var s = W(S, O, b, _, y + "." + O, t);
          if (s)
            return s;
        }
        return null;
      }
      return A(c);
    }
    function z(o) {
      switch (typeof o) {
        case "number":
        case "string":
        case "undefined":
          return !0;
        case "boolean":
          return !o;
        case "object":
          if (Array.isArray(o))
            return o.every(z);
          if (o === null || l(o))
            return !0;
          var c = m(o);
          if (c) {
            var g = c.call(o), E;
            if (c !== o.entries) {
              for (; !(E = g.next()).done; )
                if (!z(E.value))
                  return !1;
            } else
              for (; !(E = g.next()).done; ) {
                var b = E.value;
                if (b && !z(b[1]))
                  return !1;
              }
          } else
            return !1;
          return !0;
        default:
          return !1;
      }
    }
    function U(o, c) {
      return o === "symbol" ? !0 : c ? c["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && c instanceof Symbol : !1;
    }
    function D(o) {
      var c = typeof o;
      return Array.isArray(o) ? "array" : o instanceof RegExp ? "object" : U(c, o) ? "symbol" : c;
    }
    function H(o) {
      if (typeof o > "u" || o === null)
        return "" + o;
      var c = D(o);
      if (c === "object") {
        if (o instanceof Date)
          return "date";
        if (o instanceof RegExp)
          return "regexp";
      }
      return c;
    }
    function Q(o) {
      var c = H(o);
      switch (c) {
        case "array":
        case "object":
          return "an " + c;
        case "boolean":
        case "date":
        case "regexp":
          return "a " + c;
        default:
          return c;
      }
    }
    function ae(o) {
      return !o.constructor || !o.constructor.name ? h : o.constructor.name;
    }
    return R.checkPropTypes = u, R.resetWarningCache = u.resetWarningCache, R.PropTypes = R, R;
  }, he;
}
if (process.env.NODE_ENV !== "production") {
  var ur = ze(), fr = !0;
  ge.exports = cr()(ur.isElement, fr);
} else
  ge.exports = nr()();
var lr = ge.exports;
const N = /* @__PURE__ */ er(lr);
function qe(r, e) {
  var t = Object.keys(r);
  if (Object.getOwnPropertySymbols) {
    var n = Object.getOwnPropertySymbols(r);
    e && (n = n.filter(function(u) {
      return Object.getOwnPropertyDescriptor(r, u).enumerable;
    })), t.push.apply(t, n);
  }
  return t;
}
function De(r) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? qe(Object(t), !0).forEach(function(n) {
      Ke(r, n, t[n]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : qe(Object(t)).forEach(function(n) {
      Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(t, n));
    });
  }
  return r;
}
function ue(r) {
  "@babel/helpers - typeof";
  return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? ue = function(e) {
    return typeof e;
  } : ue = function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, ue(r);
}
function Ke(r, e, t) {
  return e in r ? Object.defineProperty(r, e, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : r[e] = t, r;
}
function dr(r, e) {
  return pr(r) || yr(r, e) || vr(r, e) || mr();
}
function pr(r) {
  if (Array.isArray(r))
    return r;
}
function yr(r, e) {
  var t = r && (typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"]);
  if (t != null) {
    var n = [], u = !0, a = !1, v, l;
    try {
      for (t = t.call(r); !(u = (v = t.next()).done) && (n.push(v.value), !(e && n.length === e)); u = !0)
        ;
    } catch (f) {
      a = !0, l = f;
    } finally {
      try {
        !u && t.return != null && t.return();
      } finally {
        if (a)
          throw l;
      }
    }
    return n;
  }
}
function vr(r, e) {
  if (r) {
    if (typeof r == "string")
      return We(r, e);
    var t = Object.prototype.toString.call(r).slice(8, -1);
    if (t === "Object" && r.constructor && (t = r.constructor.name), t === "Map" || t === "Set")
      return Array.from(r);
    if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
      return We(r, e);
  }
}
function We(r, e) {
  (e == null || e > r.length) && (e = r.length);
  for (var t = 0, n = new Array(e); t < e; t++)
    n[t] = r[t];
  return n;
}
function mr() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
var Se = function(e) {
  var t = k.useRef(e);
  return k.useEffect(function() {
    t.current = e;
  }, [e]), t.current;
}, ee = function(e) {
  return e !== null && ue(e) === "object";
}, br = function(e) {
  return ee(e) && typeof e.then == "function";
}, hr = function(e) {
  return ee(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
}, Ye = "[object Object]", Er = function r(e, t) {
  if (!ee(e) || !ee(t))
    return e === t;
  var n = Array.isArray(e), u = Array.isArray(t);
  if (n !== u)
    return !1;
  var a = Object.prototype.toString.call(e) === Ye, v = Object.prototype.toString.call(t) === Ye;
  if (a !== v)
    return !1;
  if (!a && !n)
    return e === t;
  var l = Object.keys(e), f = Object.keys(t);
  if (l.length !== f.length)
    return !1;
  for (var p = {}, d = 0; d < l.length; d += 1)
    p[l[d]] = !0;
  for (var m = 0; m < f.length; m += 1)
    p[f[m]] = !0;
  var h = Object.keys(p);
  if (h.length !== l.length)
    return !1;
  var R = e, j = t, P = function(L) {
    return r(R[L], j[L]);
  };
  return h.every(P);
}, Ve = function(e, t, n) {
  return ee(e) ? Object.keys(e).reduce(function(u, a) {
    var v = !ee(t) || !Er(e[a], t[a]);
    return n.includes(a) ? (v && console.warn("Unsupported prop change: options.".concat(a, " is not a mutable property.")), u) : v ? De(De({}, u || {}), {}, Ke({}, a, e[a])) : u;
  }, null) : null;
}, gr = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", Ne = function(e) {
  if (e === null || hr(e))
    return e;
  throw new Error(gr);
}, Sr = function(e) {
  if (br(e))
    return {
      tag: "async",
      stripePromise: Promise.resolve(e).then(Ne)
    };
  var t = Ne(e);
  return t === null ? {
    tag: "empty"
  } : {
    tag: "sync",
    stripe: t
  };
}, Te = /* @__PURE__ */ k.createContext(null);
Te.displayName = "ElementsContext";
var _r = function(e, t) {
  if (!e)
    throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t, " in an <Elements> provider."));
  return e;
}, Ge = function(e) {
  var t = e.stripe, n = e.options, u = e.children, a = k.useMemo(function() {
    return Sr(t);
  }, [t]), v = k.useState(function() {
    return {
      stripe: a.tag === "sync" ? a.stripe : null,
      elements: a.tag === "sync" ? a.stripe.elements(n) : null
    };
  }), l = dr(v, 2), f = l[0], p = l[1];
  k.useEffect(function() {
    var h = !0, R = function(P) {
      p(function(A) {
        return A.stripe ? A : {
          stripe: P,
          elements: P.elements(n)
        };
      });
    };
    return a.tag === "async" && !f.stripe ? a.stripePromise.then(function(j) {
      j && h && R(j);
    }) : a.tag === "sync" && !f.stripe && R(a.stripe), function() {
      h = !1;
    };
  }, [a, f, n]);
  var d = Se(t);
  k.useEffect(function() {
    d !== null && d !== t && console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.");
  }, [d, t]);
  var m = Se(n);
  return k.useEffect(function() {
    if (f.elements) {
      var h = Ve(n, m, ["clientSecret", "fonts"]);
      h && f.elements.update(h);
    }
  }, [n, m, f.elements]), k.useEffect(function() {
    var h = f.stripe;
    !h || !h._registerWrapper || !h.registerAppInfo || (h._registerWrapper({
      name: "react-stripe-js",
      version: "1.10.0"
    }), h.registerAppInfo({
      name: "react-stripe-js",
      version: "1.10.0",
      url: "https://stripe.com/docs/stripe-js/react"
    }));
  }, [f.stripe]), /* @__PURE__ */ k.createElement(Te.Provider, {
    value: f
  }, u);
};
Ge.propTypes = {
  stripe: N.any,
  options: N.object
};
var de = function(e) {
  var t = k.useContext(Te);
  return _r(t, e);
}, Tr = function() {
  var e = de("calls useElements()"), t = e.elements;
  return t;
}, Or = function() {
  var e = de("calls useStripe()"), t = e.stripe;
  return t;
};
N.func.isRequired;
var K = function(e) {
  var t = k.useRef(e);
  return k.useEffect(function() {
    t.current = e;
  }, [e]), function() {
    t.current && t.current.apply(t, arguments);
  };
}, V = function() {
}, Pr = function(e) {
  return e.charAt(0).toUpperCase() + e.slice(1);
}, M = function(e, t) {
  var n = "".concat(Pr(e), "Element"), u = function(f) {
    var p = f.id, d = f.className, m = f.options, h = m === void 0 ? {} : m, R = f.onBlur, j = R === void 0 ? V : R, P = f.onFocus, A = P === void 0 ? V : P, L = f.onReady, G = L === void 0 ? V : L, I = f.onChange, $ = I === void 0 ? V : I, i = f.onEscape, B = i === void 0 ? V : i, X = f.onClick, re = X === void 0 ? V : X, Z = f.onLoadError, te = Z === void 0 ? V : Z, J = f.onLoaderStart, ne = J === void 0 ? V : J, oe = de("mounts <".concat(n, ">")), z = oe.elements, U = k.useRef(null), D = k.useRef(null), H = K(G), Q = K(j), ae = K(A), o = K(re), c = K($), g = K(B), E = K(te), b = K(ne);
    k.useLayoutEffect(function() {
      if (U.current == null && z && D.current != null) {
        var y = z.create(e, h);
        U.current = y, y.mount(D.current), y.on("ready", function() {
          return H(y);
        }), y.on("change", c), y.on("blur", Q), y.on("focus", ae), y.on("escape", g), y.on("loaderror", E), y.on("loaderstart", b), y.on("click", o);
      }
    });
    var _ = Se(h);
    return k.useEffect(function() {
      if (U.current) {
        var y = Ve(h, _, ["paymentRequest"]);
        y && U.current.update(y);
      }
    }, [h, _]), k.useLayoutEffect(function() {
      return function() {
        U.current && (U.current.destroy(), U.current = null);
      };
    }, []), /* @__PURE__ */ k.createElement("div", {
      id: p,
      className: d,
      ref: D
    });
  }, a = function(f) {
    de("mounts <".concat(n, ">"));
    var p = f.id, d = f.className;
    return /* @__PURE__ */ k.createElement("div", {
      id: p,
      className: d
    });
  }, v = t ? a : u;
  return v.propTypes = {
    id: N.string,
    className: N.string,
    onChange: N.func,
    onBlur: N.func,
    onFocus: N.func,
    onReady: N.func,
    onClick: N.func,
    onLoadError: N.func,
    onLoaderStart: N.func,
    options: N.object
  }, v.displayName = n, v.__elementType = e, v;
}, q = typeof window > "u";
M("auBankAccount", q);
M("card", q);
M("cardNumber", q);
M("cardExpiry", q);
M("cardCvc", q);
M("fpxBank", q);
M("iban", q);
M("idealBank", q);
M("p24Bank", q);
M("epsBank", q);
var Cr = M("payment", q);
M("paymentRequestButton", q);
M("linkAuthentication", q);
M("shippingAddress", q);
M("affirmMessage", q);
M("afterpayClearpayMessage", q);
var Oe = {};
Object.defineProperty(Oe, "__esModule", { value: !0 });
function fe(r) {
  "@babel/helpers - typeof";
  return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? fe = function(e) {
    return typeof e;
  } : fe = function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, fe(r);
}
var Je = "https://js.stripe.com/v3", wr = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, Ue = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", Rr = function() {
  for (var e = document.querySelectorAll('script[src^="'.concat(Je, '"]')), t = 0; t < e.length; t++) {
    var n = e[t];
    if (wr.test(n.src))
      return n;
  }
  return null;
}, xr = function(e) {
  var t = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", n = document.createElement("script");
  n.src = "".concat(Je).concat(t);
  var u = document.head || document.body;
  if (!u)
    throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
  return u.appendChild(n), n;
}, Ar = function(e, t) {
  !e || !e._registerWrapper || e._registerWrapper({
    name: "stripe-js",
    version: "1.35.0",
    startTime: t
  });
}, ce = null, jr = function(e) {
  return ce !== null || (ce = new Promise(function(t, n) {
    if (typeof window > "u") {
      t(null);
      return;
    }
    if (window.Stripe && e && console.warn(Ue), window.Stripe) {
      t(window.Stripe);
      return;
    }
    try {
      var u = Rr();
      u && e ? console.warn(Ue) : u || (u = xr(e)), u.addEventListener("load", function() {
        window.Stripe ? t(window.Stripe) : n(new Error("Stripe.js not available"));
      }), u.addEventListener("error", function() {
        n(new Error("Failed to load Stripe.js"));
      });
    } catch (a) {
      n(a);
      return;
    }
  })), ce;
}, Ir = function(e, t, n) {
  if (e === null)
    return null;
  var u = e.apply(void 0, t);
  return Ar(u, n), u;
}, $r = function(e) {
  var t = `invalid load parameters; expected object of shape

    {advancedFraudSignals: boolean}

but received

    `.concat(JSON.stringify(e), `
`);
  if (e === null || fe(e) !== "object")
    throw new Error(t);
  if (Object.keys(e).length === 1 && typeof e.advancedFraudSignals == "boolean")
    return e;
  throw new Error(t);
}, Xe, Ze = !1, Qe = function() {
  for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
    t[n] = arguments[n];
  Ze = !0;
  var u = Date.now();
  return jr(Xe).then(function(a) {
    return Ir(a, t, u);
  });
};
Qe.setLoadParameters = function(r) {
  if (Ze)
    throw new Error("You cannot change load parameters after calling loadStripe");
  Xe = $r(r);
};
Oe.loadStripe = Qe;
var kr = Oe;
const Lr = process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY || "";
let Ee;
const Mr = (r) => (Ee || (Ee = kr.loadStripe(
  r || Lr
  /* , {
    locale: "es-419" TODO: Handle multiple locales,
  } */
)), Ee), qr = Mr, Dr = (r) => {
  const { t: e, i18n: t } = Be(), { paymentOption: n, elements: u, state: a, onPaymentElementChange: v } = r, [l, f] = le(!1), [p, d] = le(n !== "HOLD"), m = l || !p || ["processing", "error"].includes(a.status), h = {
    layout: "accordion"
  };
  return Fe(() => {
    u == null || u.update({ locale: t.language });
  }, [u, t.language]), /* @__PURE__ */ Ce("form", { id: "payment-form", className: "bg-subtle mt-4 rounded-md p-6", onSubmit: r.onSubmit, children: [
    /* @__PURE__ */ Y("div", { children: /* @__PURE__ */ Y(Cr, { options: h, onChange: (R) => v() }) }),
    n === "HOLD" && /* @__PURE__ */ Y("div", { className: "bg-info mb-5 mt-2 rounded-md p-3", children: /* @__PURE__ */ Y(
      rr,
      {
        description: e("acknowledge_booking_no_show_fee", {
          amount: r.payment.amount / 100,
          formatParams: { amount: { currency: r.payment.currency } }
        }),
        onChange: (R) => d(R.target.checked),
        descriptionClassName: "text-info font-semibold"
      }
    ) }),
    /* @__PURE__ */ Ce("div", { className: "mt-2 flex justify-end space-x-2", children: [
      /* @__PURE__ */ Y(
        we,
        {
          color: "minimal",
          disabled: m,
          id: "cancel",
          type: "button",
          loading: l,
          onClick: () => {
            f(!0), r.onCancel();
          },
          children: /* @__PURE__ */ Y("span", { id: "button-text", children: e("cancel") })
        }
      ),
      /* @__PURE__ */ Y(
        we,
        {
          type: "submit",
          disabled: m,
          loading: a.status === "processing",
          id: "submit",
          color: "secondary",
          children: /* @__PURE__ */ Y("span", { id: "button-text", children: a.status === "processing" ? /* @__PURE__ */ Y("div", { className: "spinner", id: "spinner" }) : e(n === "HOLD" ? "submit_card" : "pay_now") })
        }
      )
    ] }),
    a.status === "error" && /* @__PURE__ */ Y("div", { className: "mt-4 text-center text-red-900 dark:text-gray-300", role: "alert", children: a.error.message })
  ] });
}, Wr = (r) => {
  const { t: e } = Be(), t = Tr(), n = r.payment.paymentOption, u = r.booking.attendees[0].email, a = Or(), [v, l] = le({ status: "idle" });
  return /* @__PURE__ */ Y(
    Dr,
    {
      ...r,
      elements: t,
      paymentOption: n,
      state: v,
      onSubmit: async (f) => {
        var m;
        if (f.preventDefault(), !a || !t)
          return;
        l({ status: "processing" });
        let p;
        const d = {
          uid: r.booking.uid,
          email: u
        };
        n === "HOLD" && "setupIntent" in r.payment.data ? (p = await a.confirmSetup({
          elements: t,
          redirect: "if_required"
        }), p.setupIntent && (d.payment_intent = p.setupIntent.id, d.payment_intent_client_secret = p.setupIntent.client_secret || void 0, d.redirect_status = p.setupIntent.status)) : n === "ON_BOOKING" && (p = await a.confirmPayment({
          elements: t,
          redirect: "if_required",
          confirmParams: {
            return_url: `${tr}/booking/${d.uid}`
          }
        }), p.paymentIntent && (d.payment_intent = p.paymentIntent.id, d.payment_intent_client_secret = p.paymentIntent.client_secret || void 0, d.redirect_status = p.paymentIntent.status)), p != null && p.error ? l({
          status: "error",
          error: new Error(`Payment failed: ${p.error.message}`)
        }) : (l({ status: "idle" }), (m = r.onPaymentSuccess) == null || m.call(r, r), r.location && (r.location.includes("integration") ? d.location = e("web_conferencing_details_to_follow") : d.location = r.location));
      },
      onCancel: () => {
        var f;
        (f = r.onPaymentCancellation) == null || f.call(r, r);
      },
      onPaymentElementChange: () => {
        l({ status: "idle" });
      }
    }
  );
}, Fr = (r) => {
  const e = qr(r.payment.data.stripe_publishable_key), [t, n] = le("stripe");
  return Fe(() => {
    document.documentElement.classList.contains("dark") && n("night");
  }, []), /* @__PURE__ */ Y(
    Ge,
    {
      stripe: e,
      options: {
        clientSecret: r.clientSecret,
        appearance: {
          theme: t
        }
      },
      children: /* @__PURE__ */ Y(Wr, { ...r })
    }
  );
};
export {
  Fr as default
};
