/**
 * Finite public projection contract for onboarding gates.
 * Bounded enums + sanitized labels only.
 */
import { isUnsafePublicString } from "../runs/runProjectionContract.js";
export const ONBOARDING_PROJECTION_PUBLIC_SOURCE = "onboarding";
export const ONBOARDING_PROJECTION_GATES = [
    "account",
    "organization",
    "github_app",
    "repository",
    "provider",
    "bridge_pairing",
];
export const ONBOARDING_PROJECTION_STATUSES = [
    "ready",
    "in-progress",
    "blocked",
    "skipped",
];
export const ONBOARDING_PROJECTION_TONES = [
    "primary",
    "success",
    "warning",
    "destructive",
    "muted",
];
const MAX_LABEL = 120;
export function readOnboardingLabel(value) {
    if (value === null || value === undefined)
        return null;
    const trimmed = value.trim();
    if (!trimmed)
        return null;
    if (trimmed.length > MAX_LABEL)
        return null;
    if (isUnsafePublicString(trimmed))
        return null;
    return trimmed;
}
export function toneForOnboardingStatus(status) {
    switch (status) {
        case "ready":
            return "success";
        case "in-progress":
            return "primary";
        case "blocked":
            return "destructive";
        case "skipped":
            return "muted";
    }
}
