import { kB as y, E as m, V as v } from "./684d2f28.js";
import { a as h } from "./b7901950.js";
import { _ as g } from "./d44efa59.js";
import { k as _ } from "./55f8e851.js";
import b, { useRef as d, useMemo as x, useState as w, useCallback as E } from "react";
function T(e, n, r, t) {
  function s(a) {
    return a instanceof r ? a : new r(function(o) {
      o(a);
    });
  }
  return new (r || (r = Promise))(function(a, o) {
    function c(u) {
      try {
        i(t.next(u));
      } catch (l) {
        o(l);
      }
    }
    function f(u) {
      try {
        i(t.throw(u));
      } catch (l) {
        o(l);
      }
    }
    function i(u) {
      u.done ? a(u.value) : s(u.value).then(c, f);
    }
    i((t = t.apply(e, n || [])).next());
  });
}
function N(e, n) {
  var r = typeof Symbol == "function" && e[Symbol.iterator];
  if (!r)
    return e;
  var t = r.call(e), s, a = [], o;
  try {
    for (; (n === void 0 || n-- > 0) && !(s = t.next()).done; )
      a.push(s.value);
  } catch (c) {
    o = { error: c };
  } finally {
    try {
      s && !s.done && (r = t.return) && r.call(t);
    } finally {
      if (o)
        throw o.error;
    }
  }
  return a;
}
function q(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 O(e, n) {
  const r = Object.assign({}, n.props);
  e.className && (r.className = y(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 S = h, j = g, k = _, A = j(function(e, n, r, t) {
  S(n, k(n), e, t);
}), D = A;
const F = /* @__PURE__ */ m(D);
function G(...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 H(e, n) {
  const r = e;
  for (const t in n)
    n.hasOwnProperty(t) && (r[t] = n[t]);
  return r;
}
const p = "adm-safe-area", J = (e) => O(e, /* @__PURE__ */ v("div", {
  className: y(p, `${p}-position-${e.position}`)
}));
var P = function(e) {
  return typeof e == "function";
}, V = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
const W = V;
function $(e) {
  W && (P(e) || console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));
  var n = d(e);
  n.current = x(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 z = function() {
  var e = N(w({}), 2), n = e[1];
  return E(function() {
    return n({});
  }, []);
};
const C = z;
function K(e) {
  const {
    value: n,
    defaultValue: r,
    onChange: t
  } = e, s = C(), a = d(n !== void 0 ? n : r);
  n !== void 0 && (a.current = n);
  const o = $((c, f = !1) => {
    const i = typeof c == "function" ? c(a.current) : c;
    if (!(!f && i === a.current))
      return a.current = i, s(), t == null ? void 0 : t(i);
  });
  return [a.current, o];
}
export {
  J as S,
  q as _,
  H as a,
  $ as b,
  P as c,
  N as d,
  T as e,
  W as i,
  G as m,
  K as u,
  O as w
};
