<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

/**
 * Frontpage Client Options
 *
 * @package pawfect
 */

if ( ! class_exists( 'Pawfect_Options_Client' ) ) :

    class Pawfect_Options_Client extends pawfect_Customize_Base_Option {

        /**
         * Arguments for options.
         *
         * @return array
         */
        public function elements() {

            return array(

                'pawfect_client_heading' => array(
                    'setting' => array(),
                    'control' => array(
                        'type'     => 'heading',
                        'priority' => 1,
                        'label'    => esc_html__( 'Client Options', 'pawfect' ),
                        'section'  => 'pawfect_theme_client',
                    ),
                ),
                
                'pawfect_client_disabled' => array(
                    'setting' => array(
                        'default'           => true,
                        'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_checkbox' ),
                    ),
                    'control' => array(
                        'type'     => 'toggle',
                        'priority' => 3,
                        'label'    => esc_html__( 'Client Enable/Disable', 'pawfect' ),
                        'section'  => 'pawfect_theme_client',
                    ),
                ),
                
                'pawfect_client_autoplay' => array(
                    'setting' => array(
                        'default'           => true,
                        'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_checkbox' ),
                    ),
                    'control' => array(
                        'type'     => 'toggle',
                        'priority' => 15,
                        'label'    => esc_html__( 'Client Autoplay', 'pawfect' ),
                        'section'  => 'pawfect_theme_client',
                        'active_callback' => [
                            [ $this, 'is_control_value_active' ],
                            'pawfect_client_disabled',
                            true
                        ],
                    ),
                ),
                
                'pawfect_client_animation_speed' => array(
                    'setting' => array(
                        'default'           => '4000',
                        'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_radio' ),
                    ),
                    'control' => array(
                        'type'            => 'select',
                        'priority'        => 20,
                        'is_default_type' => true,
                        'label'           => esc_html__( 'Client Animation Speed', 'pawfect' ),
                        'description'     => esc_html__( 'Note: Turn on Autoplay', 'pawfect' ),
                        'section'         => 'pawfect_theme_client',
                        'choices'         => array(
                            '2000' => esc_html__( '2.0', 'pawfect' ),
                            '3000' => esc_html__( '3.0', 'pawfect' ),
                            '4000' => esc_html__( '4.0', 'pawfect' ),
                            '5000' => esc_html__( '5.0', 'pawfect' ),
                            '6000' => esc_html__( '6.0', 'pawfect' ),
                        ),
                        'active_callback' => [ $this, 'is_client_autoplay_enabled' ], // We use a specific method for this complex check
                    ),
                ),
                
                'pawfect_client_container_size' => array(
                    'setting' => array(
                        'default'           => 'container',
                        'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_radio' ),
                    ),
                    'control' => array(
                        'type'            => 'radio',
                        'priority'        => 25,
                        'is_default_type' => true,
                        'label'           => esc_html__( 'Client Width', 'pawfect' ),
                        'section'         => 'pawfect_theme_client',
                        'choices'         => array(
                            'container'      => esc_html__( 'Container', 'pawfect' ),
                            'container-full' => esc_html__( 'Container Full', 'pawfect' ),
                        ),
                        'active_callback' => [
                            [ $this, 'is_control_value_active' ],
                            'pawfect_client_disabled',
                            true
                        ],
                    ),
                ),

                'pawfect_client_column_layout' => array(
                    'setting'  => array(
                        'default'           => 5,
                        'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_radio' ),
                    ),
                    'control'  => array(
                        'type'    => 'radio_image',
                        'priority' => 30,
                        'label'    => esc_html__( 'Column Layout', 'pawfect' ),
                        'section'  => 'pawfect_theme_client',
                        'choices'  => array(
                            '2' => PAWFECT_THEME_URL . '/assets/images/icons/column-2.png',
                            '3' => PAWFECT_THEME_URL . '/assets/images/icons/column-3.png',
                            '4' => PAWFECT_THEME_URL . '/assets/images/icons/column-4.png',
                            '5' => PAWFECT_THEME_URL . '/assets/images/icons/column-5.png',
                            '6' => PAWFECT_THEME_URL . '/assets/images/icons/column-6.png',
                            '7' => PAWFECT_THEME_URL . '/assets/images/icons/column-7.png',
                        ),
                        'active_callback' => [
                            [ $this, 'is_control_value_active' ],
                            'pawfect_client_disabled',
                            true
                        ],
                    ),
                ),
            );
        }
    }

new Pawfect_Options_Client();

endif;



