import { c as v, g as h, v as m, w as p, x as g, j as x } from "./13339559.js";
import b, { useRef as d, useMemo as _, useState as w, useCallback as N } from "react";
function M(e, n, r, t) {
  function s(a) {
    return a instanceof r ? a : new r(function(c) {
      c(a);
    });
  }
  return new (r || (r = Promise))(function(a, c) {
    function o(u) {
      try {
        i(t.next(u));
      } catch (l) {
        c(l);
      }
    }
    function f(u) {
      try {
        i(t.throw(u));
      } catch (l) {
        c(l);
      }
    }
    function i(u) {
      u.done ? a(u.value) : s(u.value).then(o, f);
    }
    i((t = t.apply(e, n || [])).next());
  });
}
function O(e, n) {
  var r = typeof Symbol == "function" && e[Symbol.iterator];
  if (!r)
    return e;
  var t = r.call(e), s, a = [], c;
  try {
    for (; (n === void 0 || n-- > 0) && !(s = t.next()).done; )
      a.push(s.value);
  } catch (o) {
    c = { error: o };
  } finally {
    try {
      s && !s.done && (r = t.return) && r.call(t);
    } finally {
      if (c)
        throw c.error;
    }
  }
  return a;
}
function U(e, n, r) {
  if (r || arguments.length === 2)
    for (var t = 0, s = n.length, a; t < s; t++)
      (a || !(t in n)) && (a || (a = Array.prototype.slice.call(n, 0, t)), a[t] = n[t]);
  return e.concat(a || Array.prototype.slice.call(n));
}
function j(e, n) {
  const r = Object.assign({}, n.props);
  e.className && (r.className = v(n.props.className, e.className)), e.style && (r.style = Object.assign(Object.assign({}, r.style), e.style)), e.tabIndex !== void 0 && (r.tabIndex = e.tabIndex);
  for (const t in e)
    e.hasOwnProperty(t) && (t.startsWith("data-") || t.startsWith("aria-")) && (r[t] = e[t]);
  return b.cloneElement(n, r);
}
var A = p, S = m, E = g, k = S(function(e, n, r, t) {
  A(n, E(n), e, t);
}), D = k;
const F = /* @__PURE__ */ h(D);
function T(...e) {
  function n(t, s) {
    return s === void 0 ? t : s;
  }
  let r = Object.assign({}, e[0]);
  for (let t = 1; t < e.length; t++)
    r = F(r, e[t], n);
  return r;
}
function q(e, n) {
  const r = e;
  for (const t in n)
    n.hasOwnProperty(t) && (r[t] = n[t]);
  return r;
}
const y = "adm-safe-area", B = (e) => j(e, /* @__PURE__ */ x("div", {
  className: v(y, `${y}-position-${e.position}`)
}));
var P = function(e) {
  return typeof e == "function";
}, W = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
const $ = W;
function z(e) {
  $ && (P(e) || console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));
  var n = d(e);
  n.current = _(function() {
    return e;
  }, [e]);
  var r = d();
  return r.current || (r.current = function() {
    for (var t = [], s = 0; s < arguments.length; s++)
      t[s] = arguments[s];
    return n.current.apply(this, t);
  }), r.current;
}
var C = function() {
  var e = O(w({}), 2), n = e[1];
  return N(function() {
    return n({});
  }, []);
};
const I = C;
function G(e) {
  const {
    value: n,
    defaultValue: r,
    onChange: t
  } = e, s = I(), a = d(n !== void 0 ? n : r);
  n !== void 0 && (a.current = n);
  const c = z((o, f = !1) => {
    const i = typeof o == "function" ? o(a.current) : o;
    if (!(!f && i === a.current))
      return a.current = i, s(), t == null ? void 0 : t(i);
  });
  return [a.current, c];
}
export {
  B as S,
  U as _,
  q as a,
  z as b,
  P as c,
  O as d,
  M as e,
  $ as i,
  T as m,
  G as u,
  j as w
};
