import { getFavIcon as l } from "@das-fed/utils/common-info";
import { pureImageSrc as m } from "@das-fed/utils/pure-image-src";
import { systemConfiguration as c } from "@das-fed/utils/api-services";
const i = (o, r = "./logo.svg") => {
  const t = o || r;
  let e = document.querySelector('link[rel*="icon"]');
  e ? e == null || e.setAttribute("href", t) : (e = document.createElement("link"), e.rel = "icon", e.type = "image/svg+xml", e.href = t, document.getElementsByTagName("head")[0].appendChild(e));
}, f = async (o = "./logo.svg") => {
  const r = c.get("/visitor/appearance/with-default", (e) => (e.public = !0, e));
  let t = l();
  if (!t) {
    const [e, n] = await r().run();
    if (e) return;
    const { browserLogoImgHost: s = "", browserLogoImg: a = "" } = n || {};
    t = a ? s + m(a) : "";
  }
  i(t, o);
};
export {
  f as setDasHtmlIcon,
  i as updateFavIcon
};
