/**
 * Parse dependency string utility
 *
 * Dependencies use "field_id:value" format to express conditional visibility.
 * A field with dependency="country:AU" is only visible when country field equals "AU".
 */
/**
 * Parse a dependency string in "field_id:value" format
 *
 * @param dependency - Dependency string (e.g., "country:AU", "has_spouse:true")
 * @returns Parsed dependency object with field_id and value, or null if invalid format
 *
 * @example
 * ```ts
 * parse_dependency("country:AU")
 * // => { field_id: "country", value: "AU" }
 *
 * parse_dependency("invalid")
 * // => null
 *
 * parse_dependency("has_spouse:true")
 * // => { field_id: "has_spouse", value: "true" }
 * ```
 */
export function parse_dependency(dependency) {
    const parts = dependency.split(':');
    if (parts.length !== 2) {
        return null;
    }
    return {
        field_id: parts[0].trim(),
        value: parts[1].trim(),
    };
}
//# sourceMappingURL=parse_dependency.js.map