import { jsxs as r, jsx as e } from "react/jsx-runtime";
import { useMemo as b } from "react";
import { Link as f } from "react-router-dom";
import { useTranslation as u } from "react-i18next";
import { ArrowLeft as N, Target as g, Lightbulb as w, Users as o, XCircle as m, CheckCircle as d, Zap as h, Gauge as y, Shield as j, DollarSign as A, TrendingUp as q, Clock as C } from "lucide-react";
function k({ data: t, backPath: n = "/docs", backLabel: x = "nav.backToDocs", i18nNamespace: v = "docs" }) {
  const { t: c } = u([v, "docs"]), a = b(() => {
    let s = 0;
    return {
      valeur: t.overview.problem || t.overview.solution ? ++s : 0,
      useCases: t.useCases?.length ? ++s : 0,
      benefits: t.benefits?.length ? ++s : 0,
      beforeAfter: t.beforeAfter ? ++s : 0,
      features: t.features?.length ? ++s : 0,
      steps: t.steps?.length ? ++s : 0,
      faq: t.faq?.length ? ++s : 0,
      reference: t.businessRules || t.permissions || t.apiEndpoints ? ++s : 0
    };
  }, [t]), p = (s) => {
    switch (s) {
      case "time":
        return /* @__PURE__ */ e(C, { className: "w-8 h-8 text-[var(--dataviz-cat-1)]" });
      case "quality":
        return /* @__PURE__ */ e(q, { className: "w-8 h-8 text-[var(--dataviz-cat-2)]" });
      case "roi":
        return /* @__PURE__ */ e(A, { className: "w-8 h-8 text-[var(--dataviz-cat-3)]" });
      case "users":
        return /* @__PURE__ */ e(o, { className: "w-8 h-8 text-[var(--dataviz-cat-4)]" });
      case "automation":
        return /* @__PURE__ */ e(h, { className: "w-8 h-8 text-[var(--dataviz-cat-5)]" });
      case "security":
        return /* @__PURE__ */ e(j, { className: "w-8 h-8 text-[var(--dataviz-cat-6)]" });
      default:
        return /* @__PURE__ */ e(y, { className: "w-8 h-8 text-[var(--text-muted)]" });
    }
  };
  return /* @__PURE__ */ r("div", { className: "space-y-8", children: [
    n && /* @__PURE__ */ r(
      f,
      {
        to: n,
        className: "inline-flex items-center gap-2 text-[var(--text-secondary)] hover:text-[var(--color-accent-600)] transition-colors",
        children: [
          /* @__PURE__ */ e(N, { className: "w-4 h-4" }),
          c(x)
        ]
      }
    ),
    /* @__PURE__ */ r("div", { children: [
      /* @__PURE__ */ e("h1", { className: "text-3xl font-bold mb-4", children: t.overview.title ? c(t.overview.title) : c(t.overview.objective) }),
      t.overview.title && /* @__PURE__ */ e("p", { className: "text-lg text-[var(--text-secondary)] mb-2", children: c(t.overview.objective) }),
      t.overview.solution && /* @__PURE__ */ e("p", { className: "text-xl text-[var(--color-accent-600)] font-medium mb-2", children: c(t.overview.solution) }),
      t.overview.stats && /* @__PURE__ */ r("div", { className: "flex gap-4 text-sm text-[var(--text-secondary)]", children: [
        t.overview.stats.useCases && /* @__PURE__ */ r("span", { children: [
          t.overview.stats.useCases,
          " cas d'usage"
        ] }),
        t.overview.stats.businessRules && /* @__PURE__ */ r("span", { children: [
          t.overview.stats.businessRules,
          " règles métier"
        ] }),
        t.overview.stats.permissions && /* @__PURE__ */ r("span", { children: [
          t.overview.stats.permissions,
          " permissions"
        ] }),
        t.overview.stats.endpoints && /* @__PURE__ */ r("span", { children: [
          t.overview.stats.endpoints,
          " endpoints API"
        ] })
      ] })
    ] }),
    (t.overview.problem || t.overview.solution) && /* @__PURE__ */ r("section", { id: "valeur", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: a.valeur }),
        "Pourquoi ce module ?"
      ] }),
      /* @__PURE__ */ r("div", { className: "card p-6", children: [
        t.overview.problem && /* @__PURE__ */ r("div", { className: "mb-6", children: [
          /* @__PURE__ */ r("h3", { className: "font-semibold mb-3 flex items-center gap-2", children: [
            /* @__PURE__ */ e(g, { className: "w-5 h-5 text-[var(--error-text)]" }),
            "Le problème que nous résolvons"
          ] }),
          /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)]", children: c(t.overview.problem) })
        ] }),
        t.overview.solution && /* @__PURE__ */ r("div", { className: "p-4 rounded-lg bg-[var(--success-bg)] border border-[var(--success-border)]", children: [
          /* @__PURE__ */ r("h3", { className: "font-semibold mb-2 flex items-center gap-2 text-[var(--success-text)]", children: [
            /* @__PURE__ */ e(w, { className: "w-5 h-5" }),
            "Notre solution"
          ] }),
          /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)]", children: c(t.overview.solution) })
        ] })
      ] })
    ] }),
    (t.useCases?.length ?? 0) > 0 && /* @__PURE__ */ r("section", { id: "cas-usage", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: a.useCases }),
        "Cas d'usage"
      ] }),
      /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: t.useCases?.map((s) => /* @__PURE__ */ r("div", { className: "card p-6", children: [
        /* @__PURE__ */ r("div", { className: "flex items-center gap-3 mb-4", children: [
          /* @__PURE__ */ e("div", { className: "w-12 h-12 rounded-full bg-[var(--accent-bg)] flex items-center justify-center", children: /* @__PURE__ */ e(o, { className: "w-6 h-6 text-[var(--color-accent-600)]" }) }),
          /* @__PURE__ */ r("div", { children: [
            /* @__PURE__ */ e("div", { className: "font-semibold", children: c(s.name) }),
            /* @__PURE__ */ e("div", { className: "text-sm text-[var(--text-secondary)]", children: s.actor })
          ] })
        ] }),
        /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)]", children: c(s.description) }),
        s.priority && /* @__PURE__ */ r("span", { className: "inline-block mt-3 px-2 py-1 text-xs rounded bg-[var(--bg-secondary)] text-[var(--text-secondary)]", children: [
          "Priorité: ",
          s.priority
        ] })
      ] }, s.id)) })
    ] }),
    (t.benefits?.length ?? 0) > 0 && /* @__PURE__ */ r("section", { id: "benefices", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: a.benefits }),
        "Bénéfices concrets"
      ] }),
      /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: t.benefits?.map((s, l) => /* @__PURE__ */ r("div", { className: "card p-6 text-center", children: [
        /* @__PURE__ */ e("div", { className: "w-16 h-16 mx-auto mb-4 rounded-full bg-[var(--accent-bg)] flex items-center justify-center", children: p(s.icon) }),
        /* @__PURE__ */ e("div", { className: "text-3xl font-bold text-[var(--color-accent-600)] mb-2", children: s.value }),
        /* @__PURE__ */ e("div", { className: "font-semibold mb-1", children: c(s.titleKey) }),
        /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)]", children: c(s.descriptionKey) })
      ] }, `${s.titleKey}-${l}`)) })
    ] }),
    t.beforeAfter && /* @__PURE__ */ r("section", { id: "avant-apres", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: a.beforeAfter }),
        "Avant / Après"
      ] }),
      /* @__PURE__ */ e("div", { className: "card p-6", children: /* @__PURE__ */ r("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
        /* @__PURE__ */ r("div", { className: "p-4 rounded-lg bg-[var(--error-bg)] border border-[var(--error-border)]", children: [
          /* @__PURE__ */ r("h3", { className: "font-semibold mb-4 flex items-center gap-2 text-[var(--error-text)]", children: [
            /* @__PURE__ */ e(m, { className: "w-5 h-5" }),
            "Avant"
          ] }),
          /* @__PURE__ */ e("ul", { className: "space-y-2", children: t.beforeAfter.beforeItems.map((s, l) => /* @__PURE__ */ r("li", { className: "flex items-start gap-2 text-sm", children: [
            /* @__PURE__ */ e(m, { className: "w-4 h-4 text-[var(--error-text)] mt-0.5 flex-shrink-0" }),
            /* @__PURE__ */ e("span", { children: s })
          ] }, `before-${l}`)) })
        ] }),
        /* @__PURE__ */ r("div", { className: "p-4 rounded-lg bg-[var(--success-bg)] border border-[var(--success-border)]", children: [
          /* @__PURE__ */ r("h3", { className: "font-semibold mb-4 flex items-center gap-2 text-[var(--success-text)]", children: [
            /* @__PURE__ */ e(d, { className: "w-5 h-5" }),
            "Après"
          ] }),
          /* @__PURE__ */ e("ul", { className: "space-y-2", children: t.beforeAfter.afterItems.map((s, l) => /* @__PURE__ */ r("li", { className: "flex items-start gap-2 text-sm", children: [
            /* @__PURE__ */ e(d, { className: "w-4 h-4 text-[var(--success-text)] mt-0.5 flex-shrink-0" }),
            /* @__PURE__ */ e("span", { children: s })
          ] }, `after-${l}`)) })
        ] })
      ] }) })
    ] }),
    (t.features?.length ?? 0) > 0 && /* @__PURE__ */ r("section", { id: "fonctionnalites", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: a.features }),
        "Ce que vous pouvez faire"
      ] }),
      /* @__PURE__ */ e("div", { className: "space-y-4", children: t.features?.map((s) => /* @__PURE__ */ e("div", { className: "card p-6", children: /* @__PURE__ */ r("div", { className: "flex items-start gap-4", children: [
        /* @__PURE__ */ e("div", { className: "w-12 h-12 rounded-lg bg-[var(--accent-bg)] flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ e(h, { className: "w-6 h-6 text-[var(--color-accent-600)]" }) }),
        /* @__PURE__ */ r("div", { className: "flex-1", children: [
          /* @__PURE__ */ e("h3", { className: "font-semibold mb-2", children: c(s.title) }),
          /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)] mb-3", children: c(s.description) }),
          s.example && /* @__PURE__ */ r("div", { className: "p-3 rounded-lg bg-[var(--bg-secondary)] text-sm", children: [
            /* @__PURE__ */ e("span", { className: "font-medium text-[var(--color-accent-600)]", children: "Exemple: " }),
            c(s.example)
          ] })
        ] })
      ] }) }, s.id)) })
    ] }),
    (t.steps?.length ?? 0) > 0 && /* @__PURE__ */ r("section", { id: "guide", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: a.steps }),
        "Comment démarrer"
      ] }),
      /* @__PURE__ */ e("div", { className: "card p-6", children: /* @__PURE__ */ e("div", { className: "space-y-6", children: t.steps?.map((s, l) => /* @__PURE__ */ r("div", { className: "flex gap-4", children: [
        /* @__PURE__ */ r("div", { className: "flex flex-col items-center", children: [
          /* @__PURE__ */ e("div", { className: "w-10 h-10 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center font-bold", children: s.number }),
          l < t.steps.length - 1 && /* @__PURE__ */ e("div", { className: "w-0.5 h-full bg-[var(--border-color)] mt-2" })
        ] }),
        /* @__PURE__ */ r("div", { className: "flex-1 pb-6", children: [
          /* @__PURE__ */ e("h4", { className: "font-semibold mb-2", children: s.title }),
          /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)] mb-3", children: s.description }),
          s.screenshotKey && t.screenshots?.[s.screenshotKey] && /* @__PURE__ */ e(
            "img",
            {
              src: t.screenshots[s.screenshotKey],
              alt: s.title,
              className: "rounded-lg border border-[var(--border-color)]",
              onError: (i) => {
                i.target.style.display = "none";
              }
            }
          )
        ] })
      ] }, s.number)) }) })
    ] }),
    (t.faq?.length ?? 0) > 0 && /* @__PURE__ */ r("section", { id: "faq", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: a.faq }),
        "Questions fréquentes"
      ] }),
      /* @__PURE__ */ e("div", { className: "space-y-4", children: t.faq?.map((s, l) => /* @__PURE__ */ r("div", { className: "card p-4", children: [
        /* @__PURE__ */ e("h3", { className: "font-medium mb-2", children: c(s.questionKey) }),
        /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)]", children: c(s.answerKey) })
      ] }, `faq-${l}`)) })
    ] }),
    (t.businessRules || t.permissions || t.apiEndpoints) && /* @__PURE__ */ e("section", { id: "reference", className: "scroll-mt-4", children: /* @__PURE__ */ r("details", { className: "card", children: [
      /* @__PURE__ */ r("summary", { className: "p-4 cursor-pointer hover:bg-[var(--bg-secondary)] rounded-lg font-semibold flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--bg-secondary)] text-[var(--text-muted)] flex items-center justify-center text-sm", children: a.reference }),
        "Référence technique (administrateurs)"
      ] }),
      /* @__PURE__ */ r("div", { className: "p-4 pt-0 space-y-6", children: [
        (t.businessRules?.length ?? 0) > 0 && /* @__PURE__ */ r("div", { children: [
          /* @__PURE__ */ e("h3", { className: "font-semibold mb-3", children: "Règles métier" }),
          /* @__PURE__ */ e("div", { className: "space-y-2", children: t.businessRules?.map((s) => /* @__PURE__ */ r("div", { className: "p-3 rounded-lg bg-[var(--bg-secondary)]", children: [
            /* @__PURE__ */ r("div", { className: "flex items-center gap-2 mb-1", children: [
              /* @__PURE__ */ e("span", { className: "text-xs font-mono text-[var(--color-accent-600)]", children: s.id }),
              /* @__PURE__ */ e("span", { className: "text-xs px-2 py-0.5 rounded bg-[var(--accent-bg)]", children: s.category })
            ] }),
            /* @__PURE__ */ e("div", { className: "font-medium text-sm", children: s.name }),
            /* @__PURE__ */ e("p", { className: "text-xs text-[var(--text-secondary)] mt-1", children: c(s.statement) })
          ] }, s.id)) })
        ] }),
        (t.permissions?.length ?? 0) > 0 && /* @__PURE__ */ r("div", { children: [
          /* @__PURE__ */ e("h3", { className: "font-semibold mb-3", children: "Permissions" }),
          /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ r("table", { className: "w-full text-sm", children: [
            /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { className: "border-b border-[var(--border-color)]", children: [
              /* @__PURE__ */ e("th", { className: "text-left py-2 px-3", children: "Permission" }),
              /* @__PURE__ */ e("th", { className: "text-left py-2 px-3", children: "Description" }),
              /* @__PURE__ */ e("th", { className: "text-left py-2 px-3", children: "Rôles" })
            ] }) }),
            /* @__PURE__ */ e("tbody", { children: t.permissions?.map((s, l) => /* @__PURE__ */ r("tr", { className: "border-b border-[var(--border-color)]", children: [
              /* @__PURE__ */ e("td", { className: "py-2 px-3 font-mono text-xs", children: s.path }),
              /* @__PURE__ */ e("td", { className: "py-2 px-3", children: s.description }),
              /* @__PURE__ */ e("td", { className: "py-2 px-3", children: /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: s.roles.map((i) => /* @__PURE__ */ e(
                "span",
                {
                  className: "px-2 py-0.5 rounded bg-[var(--accent-bg)] text-xs",
                  children: i
                },
                i
              )) }) })
            ] }, `perm-${l}`)) })
          ] }) })
        ] }),
        (t.apiEndpoints?.length ?? 0) > 0 && /* @__PURE__ */ r("div", { children: [
          /* @__PURE__ */ e("h3", { className: "font-semibold mb-3", children: "Points de terminaison API" }),
          /* @__PURE__ */ e("div", { className: "space-y-2", children: t.apiEndpoints?.map((s, l) => /* @__PURE__ */ r("div", { className: "p-3 rounded-lg bg-[var(--bg-secondary)]", children: [
            /* @__PURE__ */ r("div", { className: "flex items-center gap-2 mb-1", children: [
              /* @__PURE__ */ e(
                "span",
                {
                  className: `text-xs font-bold px-2 py-0.5 rounded ${{
                    GET: "bg-[var(--info-bg)] text-[var(--info-text)]",
                    POST: "bg-[var(--success-bg)] text-[var(--success-text)]",
                    PUT: "bg-[var(--warning-bg)] text-[var(--warning-text)]",
                    PATCH: "bg-[var(--warning-bg)] text-[var(--warning-text)]"
                  }[s.method] ?? "bg-[var(--error-bg)] text-[var(--error-text)]"}`,
                  children: s.method
                }
              ),
              /* @__PURE__ */ e("code", { className: "text-xs", children: s.path })
            ] }),
            /* @__PURE__ */ r("div", { className: "text-xs text-[var(--text-secondary)] mt-1", children: [
              "Handler: ",
              s.handler,
              " | Permission: ",
              s.permission
            ] })
          ] }, `endpoint-${l}`)) })
        ] })
      ] })
    ] }) })
  ] });
}
export {
  k as D
};
//# sourceMappingURL=DocRenderer-BrP-OIN6.js.map
