<?php
declare(strict_types=1);

namespace Help4BuilderSuite\Support;

if (! defined('ABSPATH')) {
    exit;
}

final class ContactRoutes
{
    public const SALES_PHONE_E164 = '+17575286321';
    public const SALES_PHONE_DISPLAY = '(757) 528-6321';
    public const SUPPORT_TICKET_DEFAULT = 'https://help4wordpress.com/contact-us/';
    public const SUPPORT_REP_DEFAULT = 'https://help4wordpress.com/contact-us/';
    public const SUPPORT_CLIENT_AREA_DEFAULT = 'https://help4wordpress.com/';

    public static function salesPhoneE164(): string
    {
        return self::SALES_PHONE_E164;
    }

    public static function salesPhoneDisplay(): string
    {
        return self::SALES_PHONE_DISPLAY;
    }

    public static function salesCallUrl(): string
    {
        return 'tel:' . self::SALES_PHONE_E164;
    }

    public static function salesSmsUrl(): string
    {
        return 'sms:' . self::SALES_PHONE_E164;
    }

    public static function salesWhatsAppUrl(): string
    {
        return 'https://help4wordpress.com/contact-us/';
    }

    /**
     * @param array<string, mixed> $settings
     */
    public static function supportTicketUrl(array $settings = []): string
    {
        $configured = esc_url_raw((string) ($settings['support_url'] ?? ''));
        if ($configured !== '') {
            return $configured;
        }

        return self::SUPPORT_TICKET_DEFAULT;
    }

    public static function supportRepUrl(): string
    {
        return self::SUPPORT_REP_DEFAULT;
    }

    public static function supportClientAreaUrl(): string
    {
        return self::SUPPORT_CLIENT_AREA_DEFAULT;
    }
}
