import m from "./html2canvas.esm-DgdJBc_o.js";
function g({ domElement: n, fileName: t, format: o = "png", options: r = {} }) {
  if (n)
    return new Promise((c, i) => {
      const e = document.createElement("a");
      m(n, { ...r }).then((a) => {
        e.href = a.toDataURL(`image/${o}`), e.download = `${t}.${o}`, e.click(), e && e.remove(), c();
      }).catch((a) => {
        console.error("Error generating image:", a), i(a);
      });
    });
}
export {
  g as default
};
