import l from "react";
import { ImageViewer as i, MultiImageViewer as c } from "./image-viewer.mjs";
import { renderImperatively as n } from "../../utils/render-imperatively.mjs";
const r = /* @__PURE__ */ new Set();
function s(e) {
  o();
  const t = n(l.createElement(i, Object.assign({}, e, {
    afterClose: () => {
      var a;
      r.delete(t), (a = e.afterClose) === null || a === void 0 || a.call(e);
    }
  })));
  return r.add(t), t;
}
function u(e) {
  o();
  const t = n(l.createElement(c, Object.assign({}, e, {
    afterClose: () => {
      var a;
      r.delete(t), (a = e.afterClose) === null || a === void 0 || a.call(e);
    }
  })));
  return r.add(t), t;
}
function o() {
  r.forEach((e) => {
    e.close();
  }), r.clear();
}
export {
  o as clearImageViewer,
  s as showImageViewer,
  u as showMultiImageViewer
};
