use maskify::{MaskExt, Masker};

fn main() {
    println!("=========================================");
    println!("       maskify - Live Demo");
    println!("   by Daniyal Masih (@daniyalmasih)");
    println!("=========================================");
    println!();

    // Email
    let email = "rahul.sharma@gmail.com";
    println!("[Email]   {} -> {}", email, email.mask_email());

    // Phone
    let phone = "+91-9876543210";
    println!("[Phone]   {} -> {}", phone, phone.mask_phone());

    // Card
    let card = "4111-1111-1111-1111";
    println!("[Card]    {} -> {}", card, card.mask_card());

    // Name
    let name = "Daniyal Masih";
    println!("[Name]    {} -> {}", name, name.mask_name());

    // Aadhaar
    let aadhaar = "1234 5678 9012";
    println!("[Aadhaar] {} -> {}", aadhaar, aadhaar.mask_aadhaar());

    // PAN
    let pan = "ABCDE1234F";
    println!("[PAN]     {} -> {}", pan, pan.mask_pan());

    // IP
    let ip = "192.168.1.100";
    println!("[IP]      {} -> {}", ip, ip.mask_ip());

    // Password
    let password = "SuperSecret123";
    println!("[Pass]    {} -> {}", password, password.mask_all());

    println!();
    println!("--- Custom Masker (Builder Pattern) ---");
    println!();

    let masker = Masker::new()
        .keep_start(3)
        .keep_end(2)
        .mask_char('#');

    let data = "SensitiveData123";
    println!("[Custom]  {} -> {}", data, masker.apply(data));

    let token = "eyJhbGciOiJIUzI1NiJ9";
    println!("[Token]   {} -> {}", token, masker.apply(token));
}