"use client";

// src/lib/utils.ts
import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";
function cn(...inputs) {
  return twMerge(clsx(inputs));
}

// src/components/ui/list-page-view-frame.tsx
import { jsx } from "react/jsx-runtime";
var LIST_PAGE_VIEW_FRAME_GUTTER = "mx-4 mb-6 lg:mx-6";
function ListPageViewFrame({
  children,
  className,
  maxWidthClassName,
  gutterClassName = LIST_PAGE_VIEW_FRAME_GUTTER,
  ...rest
}) {
  return /* @__PURE__ */ jsx("div", { className: cn(gutterClassName, className), ...rest, children: maxWidthClassName ? /* @__PURE__ */ jsx("div", { className: cn("mx-auto w-full min-w-0", maxWidthClassName), children }) : children });
}

// src/components/ui/dot-pattern.tsx
import * as React from "react";
import { LazyMotion, domAnimation, m } from "motion/react";
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
function mulberry32(seed) {
  let s = seed >>> 0;
  return () => {
    s = s + 1831565813 >>> 0;
    let t = s;
    t = Math.imul(t ^ t >>> 15, t | 1);
    t ^= t + Math.imul(t ^ t >>> 7, t | 61);
    return ((t ^ t >>> 14) >>> 0) / 4294967296;
  };
}
function hashString(str) {
  let h = 2166136261;
  for (let i = 0; i < str.length; i++) {
    h ^= str.charCodeAt(i);
    h = Math.imul(h, 16777619);
  }
  return h >>> 0;
}
function DotPattern({
  width = 14,
  height = 14,
  x = 0,
  y = 0,
  cx = 1,
  cy = 1,
  cr = 0.8,
  className,
  glow = false,
  glowCount = 2,
  glowRadius = 240,
  ...props
}) {
  const id = React.useId();
  const maskId = `${id}-mask`;
  const gradId = `${id}-grad`;
  const clouds = React.useMemo(() => {
    const rng = mulberry32(hashString(`${id}|${glowCount}`));
    const rand = (min, max) => min + rng() * (max - min);
    return Array.from({ length: glowCount }).map((_, i) => {
      const startX = rand(85, 120);
      const endX = rand(-20, 15);
      const midX = (startX + endX) / 2 + rand(-6, 6);
      const startY = rand(85, 115);
      const endY = rand(-15, 10);
      const midY = (startY + endY) / 2 + rand(-4, 4);
      const duration = rand(8, 12);
      const delay = -(i / glowCount) * duration;
      return {
        key: i,
        xs: [`${startX}%`, `${midX}%`, `${endX}%`],
        ys: [`${startY}%`, `${midY}%`, `${endY}%`],
        duration,
        delay
      };
    });
  }, [glowCount, id]);
  return /* @__PURE__ */ jsxs(
    "svg",
    {
      "aria-hidden": "true",
      className: cn(
        "pointer-events-none absolute inset-0 size-full fill-neutral-400/80",
        className
      ),
      ...props,
      children: [
        /* @__PURE__ */ jsxs("defs", { children: [
          /* @__PURE__ */ jsx2(
            "pattern",
            {
              id,
              width,
              height,
              patternUnits: "userSpaceOnUse",
              patternContentUnits: "userSpaceOnUse",
              x,
              y,
              children: /* @__PURE__ */ jsx2("circle", { cx, cy, r: cr })
            }
          ),
          glow ? /* @__PURE__ */ jsxs(Fragment, { children: [
            /* @__PURE__ */ jsxs("radialGradient", { id: gradId, children: [
              /* @__PURE__ */ jsx2("stop", { offset: "0%", stopColor: "white", stopOpacity: "0.9" }),
              /* @__PURE__ */ jsx2("stop", { offset: "40%", stopColor: "white", stopOpacity: "0.55" }),
              /* @__PURE__ */ jsx2("stop", { offset: "75%", stopColor: "white", stopOpacity: "0.18" }),
              /* @__PURE__ */ jsx2("stop", { offset: "100%", stopColor: "white", stopOpacity: "0" })
            ] }),
            /* @__PURE__ */ jsx2("mask", { id: maskId, children: /* @__PURE__ */ jsx2(LazyMotion, { features: domAnimation, children: clouds.map((c) => /* @__PURE__ */ jsx2(
              m.circle,
              {
                r: glowRadius,
                fill: `url(#${gradId})`,
                initial: { cx: c.xs[0], cy: c.ys[0], opacity: 0 },
                animate: {
                  cx: c.xs,
                  cy: c.ys,
                  // Long hold with soft fade at both ends.
                  opacity: [0, 1, 1, 0]
                },
                transition: {
                  duration: c.duration,
                  delay: c.delay,
                  repeat: Infinity,
                  ease: "linear",
                  times: [0, 0.3, 0.7, 1]
                }
              },
              `cloud-${c.key}`
            )) }) })
          ] }) : null
        ] }),
        /* @__PURE__ */ jsx2(
          "rect",
          {
            width: "100%",
            height: "100%",
            strokeWidth: 0,
            fill: `url(#${id})`,
            mask: glow ? `url(#${maskId})` : void 0
          }
        )
      ]
    }
  );
}

// src/components/templates/dedicated-search-landing-template.tsx
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
var DEFAULT_GUTTER = "mx-auto flex min-h-[min(72vh,36rem)] w-full min-w-0 flex-col justify-center gap-0 px-6 py-8 sm:px-8 sm:py-10 md:px-12 md:py-12 lg:px-16";
var HERO_BACKDROP_MASK = "[mask-image:linear-gradient(to_bottom,transparent_0%,black_5%,black_95%,transparent_100%)] [-webkit-mask-image:linear-gradient(to_bottom,transparent_0%,black_5%,black_95%,transparent_100%)]";
function DedicatedSearchLandingBackdrop() {
  return /* @__PURE__ */ jsxs2(
    "div",
    {
      "aria-hidden": true,
      className: cn(
        "pointer-events-none absolute inset-0 -z-10 select-none overflow-hidden",
        HERO_BACKDROP_MASK
      ),
      children: [
        /* @__PURE__ */ jsx3(
          "div",
          {
            className: "absolute -left-[20%] -top-[30%] size-[min(54vmin,27rem)] rounded-full blur-[76px]",
            style: {
              background: "radial-gradient(circle at 42% 36%, var(--leo-surface-tint-b) 0%, transparent 68%)"
            }
          }
        ),
        /* @__PURE__ */ jsx3(
          "div",
          {
            className: "absolute -right-[12%] top-[2%] size-[min(46vmin,23rem)] rounded-full blur-[68px]",
            style: {
              background: "radial-gradient(circle at 48% 48%, var(--leo-surface-tint-a) 0%, transparent 66%)"
            }
          }
        ),
        /* @__PURE__ */ jsx3(
          "div",
          {
            className: "absolute bottom-[-16%] left-[14%] size-[min(50vmin,25rem)] rounded-full blur-[84px]",
            style: {
              background: "radial-gradient(circle at 44% 40%, var(--leo-surface-tint-b) 0%, transparent 70%)"
            }
          }
        ),
        /* @__PURE__ */ jsx3(
          "div",
          {
            className: "absolute bottom-[4%] right-[6%] size-[min(40vmin,20rem)] rounded-full blur-[60px]",
            style: {
              background: "radial-gradient(circle at 52% 44%, var(--leo-surface-tint-a) 0%, transparent 72%)"
            }
          }
        ),
        /* @__PURE__ */ jsx3(
          "div",
          {
            className: "absolute left-[36%] top-[32%] size-[min(38vmin,19rem)] -translate-x-1/2 rounded-full blur-[74px]",
            style: {
              background: "radial-gradient(circle at 50% 50%, var(--leo-surface-tint-b) 0%, transparent 68%)"
            }
          }
        ),
        /* @__PURE__ */ jsx3(
          DotPattern,
          {
            width: 15,
            height: 15,
            cr: 0.65,
            className: cn(
              "absolute inset-0 opacity-[0.34] mix-blend-multiply dark:opacity-[0.22] dark:mix-blend-soft-light",
              "fill-[color-mix(in_oklch,var(--brand-color)_14%,var(--background))]"
            )
          }
        )
      ]
    }
  );
}
function DedicatedSearchLandingTemplate({
  title,
  composer,
  trailing,
  maxWidthClassName = "max-w-5xl",
  frameClassName = "min-w-0",
  gutterClassName = DEFAULT_GUTTER
}) {
  return /* @__PURE__ */ jsxs2("div", { className: "relative isolate min-w-0 w-full overflow-hidden", children: [
    /* @__PURE__ */ jsx3(DedicatedSearchLandingBackdrop, {}),
    /* @__PURE__ */ jsxs2(
      ListPageViewFrame,
      {
        maxWidthClassName,
        className: cn("relative z-10", frameClassName),
        gutterClassName,
        children: [
          /* @__PURE__ */ jsx3("header", { className: "min-w-0", children: typeof title === "string" ? /* @__PURE__ */ jsx3(
            "h1",
            {
              className: "text-balance text-3xl font-semibold tracking-tight text-foreground sm:text-4xl",
              style: { fontFamily: "var(--font-heading)" },
              children: title
            }
          ) : title }),
          /* @__PURE__ */ jsx3("div", { className: "min-w-0 mt-6 sm:mt-8", children: composer }),
          trailing ? /* @__PURE__ */ jsx3("div", { className: "min-w-0 mt-10 sm:mt-12 md:mt-14 lg:mt-16", children: trailing }) : null
        ]
      }
    )
  ] });
}
export {
  DedicatedSearchLandingTemplate
};
//# sourceMappingURL=dedicated-search-landing-template.js.map