import { jsx as t, Fragment as a } from "@emotion/react/jsx-runtime";
import { useState as l } from "react";
import { isIntersectionObserverAvailable as p } from "../../utils/isIntersectionObserverAvailable.js";
import { IntersectComponent as b } from "../IntersectComponent/index.js";
function u(r) {
  const { children: o, enableIntersectionObserver: e, width: i, height: n, ...s } = r, [m, c] = l(
    !(e && p())
  );
  return /* @__PURE__ */ t(a, { children: m ? (
    /* Caso visible:  Muestra el contenido y aporta un selector de clase. */
    o
  ) : (
    /* Caso no visible: Implementa un componente que valida si el área de la imagen es visible por la ventana
              del cliente, de ser el caso asigna un cambio de la variable de estado a visible. */
    /* @__PURE__ */ t(
      b,
      {
        enableIntersectionObserver: e,
        setIsVisible: c,
        width: i,
        height: n,
        ...s
      }
    )
  ) });
}
export {
  u as LazyLoadComponent
};
