import { SKELETON_SVG_ICON as u, SVG_CACHE_PREFIX as l } from "./constants.js";
function a(r) {
  return r.replace(/[#\s]/g, "");
}
function C(r) {
  const o = window[r];
  return typeof o == "string" ? o : void 0;
}
function c(r, o) {
  window[r] = o;
}
function f(r, o, t, e = u) {
  const i = `${l}_${o}_color_${a(t)}`, n = o ? C(i) : void 0;
  return r ? n ? {
    src: r,
    cacheKey: o,
    primaryColor: t,
    isSkeleton: !1,
    dataWithColor: n
  } : {
    src: "",
    primaryColor: t,
    cacheKey: o,
    isSkeleton: !0,
    dataWithColor: e
  } : null;
}
export {
  f as getSVG,
  C as getWindowSvgCache,
  a as purgedColor,
  c as setWindowSvgCache
};
