<?php

namespace Bot;

class ButtonsConfig
{
    private static $buttonProperties = [
        // success (green)
        'approve' => ['style' => 'success', 'icon_custom_emoji_id' => '5208880351690112495', 'text_fa' => 'تایید', 'text_en' => 'Approve'],
        'have_joined' => ['style' => 'success', 'icon_custom_emoji_id' => '5208880351690112495', 'text_fa' => 'عضو شده‌ام', 'text_en' => 'I have joined'],
        'on' => ['style' => 'success', 'icon_custom_emoji_id' => '5208880351690112495', 'text_fa' => 'روشن', 'text_en' => 'ON'],
        'unban_user' => ['style' => 'success', 'icon_custom_emoji_id' => '5208880351690112495', 'text_fa' => 'رفع مسدودیت کاربر', 'text_en' => 'Unban User'],
        'invite_friends' => ['style' => 'success', 'icon_custom_emoji_id' => '5409008750893734809', 'text_fa' => 'دعوت از دوستان', 'text_en' => 'Invite Friends'],
        'agent_one_buy' => ['style' => 'success', 'icon_custom_emoji_id' => '5208880351690112495', 'text_fa' => 'خرید تکی نماینده', 'text_en' => 'Agent Single Buy'],
        'agent_much_buy' => ['style' => 'success', 'icon_custom_emoji_id' => '5208880351690112495', 'text_fa' => 'خرید عمده نماینده', 'text_en' => 'Agent Bulk Buy'],
        'renew_config' => ['style' => 'success', 'icon_custom_emoji_id' => '5208880351690112495', 'text_fa' => 'تمدید کانفیگ', 'text_en' => 'Renew Config'],
        
        // danger (red)
        'decline' => ['style' => 'danger', 'icon_custom_emoji_id' => '5215680783863261658', 'text_fa' => 'رد کردن', 'text_en' => 'Decline'],
        'ban_user' => ['style' => 'danger', 'icon_custom_emoji_id' => '5215680783863261658', 'text_fa' => 'مسدود کردن کاربر', 'text_en' => 'Ban User'],
        'off' => ['style' => 'danger', 'icon_custom_emoji_id' => '5215680783863261658', 'text_fa' => 'خاموش', 'text_en' => 'OFF'],
        'delete_config' => ['style' => 'danger', 'icon_custom_emoji_id' => '5215680783863261658', 'text_fa' => 'حذف کانفیگ', 'text_en' => 'Delete Config'],
        'back_button' => ['style' => 'danger', 'icon_custom_emoji_id' => '5352759161945867747', 'text_fa' => 'بازگشت', 'text_en' => 'Back'],
        'renew_connection_link' => ['style' => 'danger', 'icon_custom_emoji_id' => '5215680783863261658', 'text_fa' => 'تمدید لینک اتصال', 'text_en' => 'Renew Connection Link'],
        'cancel' => ['style' => 'danger', 'icon_custom_emoji_id' => '5215680783863261658', 'text_fa' => 'انصراف', 'text_en' => 'Cancel'],
        'back_to_main' => ['style' => 'danger', 'icon_custom_emoji_id' => '5352759161945867747', 'text_fa' => 'بازگشت به منوی اصلی', 'text_en' => 'Back to Main Menu'],
        
        // primary (blue)
        'pay_with_wallet' => ['style' => 'primary', 'icon_custom_emoji_id' => '5332600543963522398', 'text_fa' => 'پرداخت با کیف پول', 'text_en' => 'Pay with Wallet'],
        'increase_wallet' => ['style' => 'primary', 'icon_custom_emoji_id' => '5332600543963522398', 'text_fa' => 'افزایش موجودی کیف پول', 'text_en' => 'Top-up Wallet'],
        'buy_subscriptions' => ['style' => 'primary', 'icon_custom_emoji_id' => '5388617496007817382', 'text_fa' => 'خرید اشتراک‌ها', 'text_en' => 'Buy Subscriptions'],
        'my_subscriptions' => ['style' => 'primary', 'icon_custom_emoji_id' => '5278467510604160626', 'text_fa' => 'اشتراک‌های من', 'text_en' => 'My Subscriptions'],
        'my_info' => ['style' => 'primary', 'icon_custom_emoji_id' => '5409008750893734809', 'text_fa' => 'اطلاعات من', 'text_en' => 'My Info'],
        'test_account' => ['style' => 'primary', 'icon_custom_emoji_id' => '5199749070830197566', 'text_fa' => 'اکانت تست', 'text_en' => 'Test Account'],
        'sharj' => ['style' => 'primary', 'icon_custom_emoji_id' => '5213403875670765022', 'text_fa' => 'شارژ', 'text_en' => 'Charge'],
        'cart_to_cart' => ['style' => 'primary', 'icon_custom_emoji_id' => '5213403875670765022', 'text_fa' => 'کارت به کارت', 'text_en' => 'Card-to-Card'],
        'gateways_settings' => ['style' => 'primary', 'icon_custom_emoji_id' => '5213403875670765022', 'text_fa' => 'تنظیمات درگاه‌ها', 'text_en' => 'Gateway Settings'],
        'my_tickets' => ['style' => 'primary', 'icon_custom_emoji_id' => '5303138782004924588', 'text_fa' => 'تیکت‌های من', 'text_en' => 'My Tickets'],
        'message_to_all' => ['style' => 'primary', 'icon_custom_emoji_id' => '5303138782004924588', 'text_fa' => 'پیام همگانی', 'text_en' => 'Message to All'],
        'forward_to_all' => ['style' => 'primary', 'icon_custom_emoji_id' => '5303138782004924588', 'text_fa' => 'فوروارد همگانی', 'text_en' => 'Forward to All'],
        'application_links' => ['style' => 'primary', 'icon_custom_emoji_id' => '5132131004097496494', 'text_fa' => 'لینک‌های برنامه', 'text_en' => 'App Links'],
        'search_config' => ['style' => 'primary', 'icon_custom_emoji_id' => '5379999674193172777', 'text_fa' => 'جستجوی کانفیگ', 'text_en' => 'Search Config'],
        'shared_existence' => ['style' => 'primary', 'icon_custom_emoji_id' => '5332600543963522398', 'text_fa' => 'موجودی مشترک', 'text_en' => 'Shared Balance'],
        'individual_existence' => ['style' => 'primary', 'icon_custom_emoji_id' => '5332600543963522398', 'text_fa' => 'موجودی انفرادی', 'text_en' => 'Individual Balance'],
        'request_agency' => ['style' => 'primary', 'icon_custom_emoji_id' => '5332600543963522398', 'text_fa' => 'درخواست نمایندگی', 'text_en' => 'Request Agency'],
        'agency_setting' => ['style' => 'primary', 'icon_custom_emoji_id' => '5332600543963522398', 'text_fa' => 'تنظیمات نمایندگی', 'text_en' => 'Agency Settings'],
        'change_config_location' => ['style' => 'primary', 'icon_custom_emoji_id' => '5132131004097496494', 'text_fa' => 'تغییر لوکیشن کانفیگ', 'text_en' => 'Change Location'],
        'increase_config_volume' => ['style' => 'primary', 'icon_custom_emoji_id' => '5213403875670765022', 'text_fa' => 'افزایش حجم کانفیگ', 'text_en' => 'Increase Config Volume'],
        'increase_config_days' => ['style' => 'primary', 'icon_custom_emoji_id' => '5213403875670765022', 'text_fa' => 'افزایش روزهای کانفیگ', 'text_en' => 'Increase Config Days'],
        'update_config_connection' => ['style' => 'primary', 'icon_custom_emoji_id' => '5352759161945867747', 'text_fa' => 'بروزرسانی اتصال کانفیگ', 'text_en' => 'Update Connection'],
    ];

    public static function getButton(string $key, string $lang = 'fa', string $callback = 'main_menu'): array
    {
        if (isset(self::$buttonProperties[$key])) {
            $prop = self::$buttonProperties[$key];
            return [
                'text' => ($lang === 'fa') ? $prop['text_fa'] : $prop['text_en'],
                'callback_data' => $callback,
                'style' => $prop['style'],
                'icon_custom_emoji_id' => $prop['icon_custom_emoji_id']
            ];
        }
        return [
            'text' => $key,
            'callback_data' => $callback
        ];
    }

    public static function cancelBtn(string $lang = 'fa', string $textFa = "انصراف", string $textEn = "Cancel", string $callback = 'main_menu'): array
    {
        return [
            "text" => ($lang === 'fa') ? $textFa : $textEn,
            "callback_data" => $callback,
            "style" => "danger",
            "icon_custom_emoji_id" => "5215680783863261658"
        ];
    }

    public static function backBtn(string $lang = 'fa', string $callback = 'main_menu'): array
    {
        return [
            "text" => ($lang === 'fa') ? "بازگشت" : "Back",
            "callback_data" => $callback,
            "style" => "danger",
            "icon_custom_emoji_id" => "5352759161945867747"
        ];
    }
}
