import React from "react";
import Icon from "./Icon";
const cache = /* @__PURE__ */ new Set();
function createFromIconfontCN(scriptUrl) {
  if (typeof document !== "undefined" && typeof window !== "undefined" && typeof document.createElement === "function" && typeof scriptUrl === "string" && scriptUrl.length && !cache.has(scriptUrl)) {
    const script = document.createElement("script");
    script.setAttribute("src", scriptUrl);
    script.setAttribute("data-namespace", scriptUrl);
    cache.add(scriptUrl);
    document.body.appendChild(script);
  }
  const Iconfont = (props) => {
    Iconfont.displayName = "Iconfont";
    const {
      name
    } = props;
    let content;
    if (name) {
      content = /* @__PURE__ */ React.createElement("svg", {
        width: "1em",
        height: "1em",
        fill: "currentColor"
      }, /* @__PURE__ */ React.createElement("use", {
        xlinkHref: `#${name}`
      }));
    }
    return /* @__PURE__ */ React.createElement(Icon, props, content);
  };
  return Iconfont;
}
export {
  createFromIconfontCN as default
};
