import { clsx, type ClassValue } from 'clsx'; import { twMerge } from 'tailwind-merge'; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } /** * Normalize a Next.js dynamic-route param into its decoded human-readable * form. App Router usually decodes params automatically, but some runtime * + middleware combinations leak percent-encoded values for non-ASCII * slugs (e.g. Hebrew `%D7%A7…`), which then surface in canonical URLs and * SEO tags. Idempotent on already-decoded input. */ export function decodeSlug(slug: string): string { try { return decodeURIComponent(slug); } catch { return slug; } }