// Street-crime categories carried by the `crime_hotspots` vector tiles in the
// `crime_type` feature property. The `value` strings must match the police.uk
// "Crime type" values exactly (see pipeline/transform/crime_hotspot_tiles.py),
// because they are used directly in the MapLibre heatmap `filter` expression.
// `label` is a shorter, human-friendly name for the overlay-selector checkboxes.

export interface CrimeTypeDef {
  value: string;
  label: string;
}

export const CRIME_TYPES: readonly CrimeTypeDef[] = [
  { value: 'Violence and sexual offences', label: 'Violence & sexual offences' },
  { value: 'Anti-social behaviour', label: 'Anti-social behaviour' },
  { value: 'Criminal damage and arson', label: 'Criminal damage & arson' },
  { value: 'Public order', label: 'Public order' },
  { value: 'Shoplifting', label: 'Shoplifting' },
  { value: 'Vehicle crime', label: 'Vehicle crime' },
  { value: 'Burglary', label: 'Burglary' },
  { value: 'Other theft', label: 'Other theft' },
  { value: 'Theft from the person', label: 'Theft from the person' },
  { value: 'Bicycle theft', label: 'Bicycle theft' },
  { value: 'Drugs', label: 'Drugs' },
  { value: 'Robbery', label: 'Robbery' },
  { value: 'Possession of weapons', label: 'Possession of weapons' },
  { value: 'Other crime', label: 'Other crime' },
] as const;

export const CRIME_TYPE_VALUES: readonly string[] = CRIME_TYPES.map((c) => c.value);

const CRIME_TYPE_VALUE_SET = new Set<string>(CRIME_TYPE_VALUES);

export function isCrimeTypeValue(value: string): boolean {
  return CRIME_TYPE_VALUE_SET.has(value);
}
