import r from "react";
import a from "../../../../utils/kebabToCamelCase.js";
function C(f, d) {
  const g = decodeURIComponent(f.replace("data:image/svg+xml,", "")), o = new DOMParser().parseFromString(g, "image/svg+xml").querySelector("svg");
  if (!o)
    throw new Error("Invalid SVG element");
  const s = {};
  for (const t of o.attributes)
    s[a(t.name)] = t.value;
  return (t) => {
    const v = {
      ...s,
      ...t
    };
    return r.createElement(
      "svg",
      v,
      r.createElement("title", {}, d),
      ...Array.from(o.childNodes).map((m) => {
        if (m.nodeType === Node.ELEMENT_NODE) {
          const n = m, l = {};
          for (const e of n.attributes)
            l[a(e.name)] = e.value;
          return r.createElement(
            n.tagName.toLowerCase(),
            l,
            ...Array.from(n.childNodes).map((e) => {
              if (e.nodeType === Node.ELEMENT_NODE) {
                const c = e, i = {};
                for (const u of c.attributes)
                  i[a(u.name)] = u.value;
                return r.createElement(c.tagName.toLowerCase(), i);
              }
              return null;
            }).filter(Boolean)
          );
        }
        return null;
      }).filter(Boolean)
    );
  };
}
export {
  C as default
};
//# sourceMappingURL=convertSvgDataToComponent.js.map
