// @bun
// src/components/docs/integrations/IntegrationsSlackPage.tsx
import Link from "@contractspec/lib.ui-link";
import { ChevronRight } from "lucide-react";
import { jsx, jsxs } from "react/jsx-runtime";
function IntegrationsSlackPage() {
  return /* @__PURE__ */ jsxs("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h1", {
            className: "text-4xl font-bold",
            children: "Slack Messaging"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "ContractSpec supports signed Slack event ingestion and outbox-backed outbound replies through the channel runtime."
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Required secrets and config"
          }),
          /* @__PURE__ */ jsx("div", {
            className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
            children: /* @__PURE__ */ jsx("pre", {
              children: `// secret payload
{
  "botToken": "xoxb-...",
  "signingSecret": "..."
}

// optional connection config
{
  "defaultChannelId": "C0123456789",
  "apiBaseUrl": "https://slack.com/api"
}`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Webhook ingress"
          }),
          /* @__PURE__ */ jsxs("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsxs("li", {
                children: [
                  "Inbound events are accepted on",
                  " ",
                  /* @__PURE__ */ jsx("code", {
                    className: "bg-background/50 rounded px-2 py-1",
                    children: "/webhooks/slack/events"
                  }),
                  "."
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  "Requests are validated with Slack signatures (",
                  /* @__PURE__ */ jsx("code", {
                    className: "bg-background/50 rounded px-2 py-1",
                    children: "x-slack-signature"
                  }),
                  " ",
                  "+ timestamp tolerance)."
                ]
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Normalized events are deduplicated and persisted before any outbound side effects."
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Workspace routing and dispatch"
          }),
          /* @__PURE__ */ jsx("div", {
            className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
            children: /* @__PURE__ */ jsx("pre", {
              children: `# Workspace mapping (recommended)
CHANNEL_WORKSPACE_MAP_SLACK={"T123":"workspace-acme"}

# Dispatch protection
CHANNEL_DISPATCH_TOKEN=...

# Optional scheduler
CHANNEL_DISPATCH_INTERVAL_MS=120000
CHANNEL_DISPATCH_RUN_ON_START=1`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Best practices"
          }),
          /* @__PURE__ */ jsxs("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsx("li", {
                children: "Keep bot tokens and signing secrets in a managed secret provider."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Use workspace mapping to prevent cross-tenant event leakage."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Keep dispatch asynchronous so webhook handlers stay fast and reliable."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Monitor telemetry for ingest, decision, outbox, and dispatch stages."
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsx(Link, {
            href: "/docs/integrations/twilio",
            className: "btn-ghost",
            children: "Previous: Twilio SMS"
          }),
          /* @__PURE__ */ jsxs(Link, {
            href: "/docs/integrations/github",
            className: "btn-primary",
            children: [
              "Next: GitHub Messaging ",
              /* @__PURE__ */ jsx(ChevronRight, {
                size: 16
              })
            ]
          })
        ]
      })
    ]
  });
}
export {
  IntegrationsSlackPage
};
