{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "not-found-index",
  "type": "registry:block",
  "title": "404 Lost and Found",
  "description": "An editorial 404 with a request log line, search and a destination index.",
  "files": [
    {
      "path": "src/registry/blocks/not-found/not-found-index.tsx",
      "type": "registry:block",
      "content": "\"use client\";\n\nimport { useId, useState, type CSSProperties, type ComponentProps, type FormEvent } from \"react\";\nimport { ArrowRight } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { cn } from \"@/lib/utils\";\n\ntype Destination = { title: string; description: string; href: string };\n\nexport type NotFoundIndexProps = {\n  /** Marker colour (the small square). */\n  accent?: string;\n  /** The path that was requested. */\n  path?: string;\n  /** Pre-formatted time of the request, e.g. \"9 Oct 2026, 14:02\". */\n  timestamp?: string;\n  title?: string;\n  description?: string;\n  /** A likely intended path, rendered as \"Did you mean …?\". */\n  suggestion?: string;\n  searchLabel?: string;\n  searchPlaceholder?: string;\n  onSearch?: (query: string) => void | Promise<void>;\n  destinationsLabel?: string;\n  destinations?: Destination[];\n  /** Address for the \"Report a broken link\" mailto. */\n  reportEmail?: string;\n  reportLabel?: string;\n} & ComponentProps<\"section\">;\n\nconst pad = (n: number) => String(n).padStart(2, \"0\");\n\nconst DEFAULTS = {\n  accent: \"#0A6EFF\",\n  path: \"/pricing-2024\",\n  timestamp: \"9 Oct 2026, 14:02\",\n  title: \"We couldn't find that page.\",\n  description:\n    \"The address may be from an old email or a bookmark from before our September rename. Search below, or pick up from one of the pages most people are looking for.\",\n  suggestion: \"/pricing\",\n  searchLabel: \"Search Osier\",\n  searchPlaceholder: \"Try “recurring bookings” or “refunds”\",\n  destinationsLabel: \"Where people usually go\",\n  destinations: [\n    {\n      title: \"Pricing\",\n      description: \"Three plans, billed monthly or yearly. The 2024 rates are listed at the bottom.\",\n      href: \"/pricing\",\n    },\n    {\n      title: \"Getting started\",\n      description: \"Set up your first booking page in about ten minutes.\",\n      href: \"/docs/getting-started\",\n    },\n    {\n      title: \"Payments and refunds\",\n      description: \"Deposits, cancellation windows and how refunds reach your clients.\",\n      href: \"/docs/payments\",\n    },\n    {\n      title: \"Changelog\",\n      description: \"What shipped this month, including the new calendar sync.\",\n      href: \"/changelog\",\n    },\n    {\n      title: \"Talk to support\",\n      description: \"A real person replies within one working day, Monday to Friday.\",\n      href: \"/support\",\n    },\n  ],\n  reportEmail: \"web@osier.app\",\n  reportLabel: \"Report a broken link\",\n} satisfies Partial<NotFoundIndexProps>;\n\nexport function NotFoundIndex({\n  accent = DEFAULTS.accent,\n  path = DEFAULTS.path,\n  timestamp = DEFAULTS.timestamp,\n  title = DEFAULTS.title,\n  description = DEFAULTS.description,\n  suggestion = DEFAULTS.suggestion,\n  searchLabel = DEFAULTS.searchLabel,\n  searchPlaceholder = DEFAULTS.searchPlaceholder,\n  onSearch,\n  destinationsLabel = DEFAULTS.destinationsLabel,\n  destinations = DEFAULTS.destinations,\n  reportEmail = DEFAULTS.reportEmail,\n  reportLabel = DEFAULTS.reportLabel,\n  className,\n  style,\n  ...props\n}: NotFoundIndexProps) {\n  const headingId = useId();\n  const inputId = useId();\n  const listLabelId = useId();\n  const [query, setQuery] = useState(\"\");\n  const [status, setStatus] = useState<\"idle\" | \"searching\" | \"done\">(\"idle\");\n  const [lastQuery, setLastQuery] = useState(\"\");\n\n  const handleSubmit = async (event: FormEvent<HTMLFormElement>) => {\n    event.preventDefault();\n    const trimmed = query.trim();\n    if (!trimmed) return;\n    setLastQuery(trimmed);\n    setStatus(\"searching\");\n    try {\n      await onSearch?.(trimmed);\n    } finally {\n      setStatus(\"done\");\n    }\n  };\n\n  const reportHref = `mailto:${reportEmail}?subject=${encodeURIComponent(\n    `Broken link: ${path}`\n  )}&body=${encodeURIComponent(`I followed a link to ${path} and got a 404.\\n\\nWhere I found the link:\\n`)}`;\n\n  return (\n    <section\n      data-slot=\"not-found-index\"\n      aria-labelledby={headingId}\n      className={cn(\"w-full bg-background text-foreground\", className)}\n      style={{ \"--block-accent\": accent, ...style } as CSSProperties}\n      {...props}\n    >\n      <div className=\"mx-auto grid max-w-6xl gap-16 px-6 py-20 md:grid-cols-12 md:gap-10 md:py-28\">\n        <div className=\"md:col-span-5\">\n          <p className=\"flex flex-wrap items-center gap-x-2 gap-y-1 font-mono text-xs text-muted-foreground\">\n            <span aria-hidden=\"true\" className=\"size-2.5 shrink-0 bg-[var(--block-accent)]\" />\n            <span className=\"text-foreground\">GET</span>\n            <span className=\"break-all\">{path}</span>\n            <span aria-hidden=\"true\">→</span>\n            <span className=\"text-foreground\">404</span>\n            <span aria-hidden=\"true\">·</span>\n            <span>{timestamp}</span>\n          </p>\n\n          <h2\n            id={headingId}\n            className=\"mt-8 text-4xl leading-[1.05] font-semibold tracking-[-0.03em] text-balance md:text-5xl\"\n          >\n            {title}\n          </h2>\n          <p className=\"mt-6 max-w-md text-base leading-relaxed text-muted-foreground\">\n            {description}\n          </p>\n\n          {suggestion && (\n            <p className=\"mt-6 text-sm\">\n              Did you mean{\" \"}\n              <a\n                href={suggestion}\n                className=\"font-mono underline decoration-[var(--block-accent)] decoration-2 underline-offset-4 hover:decoration-foreground\"\n              >\n                {suggestion}\n              </a>\n              ?\n            </p>\n          )}\n\n          <form onSubmit={handleSubmit} role=\"search\" className=\"mt-10 border-t pt-6\">\n            <Label\n              htmlFor={inputId}\n              className=\"font-mono text-xs uppercase tracking-wider text-muted-foreground\"\n            >\n              {searchLabel}\n            </Label>\n            <div className=\"mt-3 flex gap-2\">\n              <Input\n                id={inputId}\n                type=\"search\"\n                name=\"q\"\n                value={query}\n                onChange={(event) => setQuery(event.target.value)}\n                placeholder={searchPlaceholder}\n                required\n                className=\"rounded-none\"\n              />\n              <Button type=\"submit\" className=\"rounded-none\" disabled={status === \"searching\"}>\n                Search\n              </Button>\n            </div>\n            <p aria-live=\"polite\" className=\"mt-2 min-h-5 text-xs text-muted-foreground\">\n              {status === \"searching\" && `Searching for “${lastQuery}”…`}\n              {status === \"done\" && `Showing results for “${lastQuery}”.`}\n            </p>\n          </form>\n\n          <p className=\"mt-8 text-sm text-muted-foreground\">\n            Followed a link from somewhere else?{\" \"}\n            <a\n              href={reportHref}\n              className=\"text-foreground underline decoration-1 underline-offset-4 hover:decoration-[var(--block-accent)] hover:decoration-2\"\n            >\n              {reportLabel}\n            </a>\n            .\n          </p>\n        </div>\n\n        {destinations.length > 0 && (\n          <nav aria-labelledby={listLabelId} className=\"md:col-span-6 md:col-start-7 md:pt-1\">\n            <p\n              id={listLabelId}\n              className=\"flex items-baseline justify-between border-b pb-3 font-mono text-xs uppercase tracking-wider text-muted-foreground\"\n            >\n              <span>{destinationsLabel}</span>\n              <span className=\"tabular-nums\">{pad(destinations.length)}</span>\n            </p>\n            <ol className=\"divide-y border-b\">\n              {destinations.map((destination, i) => (\n                <li key={destination.href}>\n                  <a\n                    href={destination.href}\n                    className=\"group grid grid-cols-[2.5rem_1fr_auto] items-start gap-x-4 py-5 outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n                  >\n                    <span className=\"pt-1 font-mono text-xs tabular-nums text-muted-foreground\">\n                      {pad(i + 1)}\n                    </span>\n                    <span>\n                      <span className=\"block font-medium decoration-1 underline-offset-4 group-hover:underline\">\n                        {destination.title}\n                      </span>\n                      <span className=\"mt-1 block text-sm leading-relaxed text-muted-foreground\">\n                        {destination.description}\n                      </span>\n                    </span>\n                    <ArrowRight\n                      aria-hidden=\"true\"\n                      className=\"mt-1 size-4 text-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-foreground motion-reduce:transition-none\"\n                    />\n                  </a>\n                </li>\n              ))}\n            </ol>\n          </nav>\n        )}\n      </div>\n    </section>\n  );\n}\n"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "input",
    "label"
  ]
}
