import { jsx as t, jsxs as M } from "react/jsx-runtime";
import { Sector as m } from "recharts";
function I(l) {
  return function(A) {
    const {
      cx: n = 0,
      cy: r = 0,
      midAngle: x = 0,
      innerRadius: g = 0,
      outerRadius: e = 0,
      startAngle: d = 0,
      endAngle: y = 0,
      fill: c = "var(--dataviz-cat-1)",
      payload: i,
      percent: v = 0,
      value: $ = 0
    } = A;
    if (!i) return /* @__PURE__ */ t("g", {});
    const f = Math.PI / 180, h = Math.sin(-f * x), o = Math.cos(-f * x), R = n + (e + 10) * o, S = r + (e + 10) * h, p = n + (e + 30) * o, u = r + (e + 30) * h, s = p + (o >= 0 ? 1 : -1) * 22, a = u, z = o >= 0 ? "start" : "end";
    return /* @__PURE__ */ M("g", { children: [
      /* @__PURE__ */ t(
        "text",
        {
          x: n,
          y: r,
          dy: -10,
          textAnchor: "middle",
          fill: "var(--text-primary)",
          style: { fontSize: "14px", fontWeight: "bold" },
          children: l.getLabel(i)
        }
      ),
      /* @__PURE__ */ t(
        "text",
        {
          x: n,
          y: r,
          dy: 10,
          textAnchor: "middle",
          fill: "var(--text-secondary)",
          style: { fontSize: "12px" },
          children: l.getValueText($, i)
        }
      ),
      /* @__PURE__ */ t(
        m,
        {
          cx: n,
          cy: r,
          innerRadius: g,
          outerRadius: e,
          startAngle: d,
          endAngle: y,
          fill: c
        }
      ),
      /* @__PURE__ */ t(
        m,
        {
          cx: n,
          cy: r,
          startAngle: d,
          endAngle: y,
          innerRadius: e + 6,
          outerRadius: e + 10,
          fill: c
        }
      ),
      /* @__PURE__ */ t("path", { d: `M${R},${S}L${p},${u}L${s},${a}`, stroke: c, fill: "none" }),
      /* @__PURE__ */ t("circle", { cx: s, cy: a, r: 2, fill: c, stroke: "none" }),
      /* @__PURE__ */ t(
        "text",
        {
          x: s + (o >= 0 ? 1 : -1) * 12,
          y: a,
          textAnchor: z,
          fill: "var(--text-primary)",
          style: { fontSize: "12px" },
          children: `${(v * 100).toFixed(0)}%`
        }
      )
    ] });
  };
}
export {
  I as c
};
//# sourceMappingURL=renderActiveShape-Cwe7yij0.js.map
