import * as t from "react";
import { useRef as u, Suspense as c } from "react";
const r = /* @__PURE__ */ new Set();
function i(e) {
  if (!r.has(e))
    throw new Promise((a) => {
      const n = new Image();
      n.src = e, n.onload = () => {
        r.add(e), a(null);
      };
    });
}
function f({
  altText: e,
  className: a,
  imageRef: n,
  src: l,
  width: m,
  height: o,
  maxWidth: s
}) {
  return i(l), /* @__PURE__ */ t.createElement(
    "img",
    {
      className: a || void 0,
      src: l,
      alt: e,
      ref: n,
      style: {
        height: o,
        maxWidth: s,
        width: m
      }
    }
  );
}
function d({
  src: e,
  altText: a,
  width: n,
  height: l,
  maxWidth: m
}) {
  const o = u(null);
  return /* @__PURE__ */ t.createElement(c, { fallback: null }, /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement(f, { className: "", src: e, altText: a, imageRef: o, width: n, height: l, maxWidth: m }))));
}
export {
  d as default
};
