<?php

/**
 * Views class for Shortcode generator options.
 *
 * @link       https://themeatelier.net
 * @since      1.0.0
 *
 * @package greet-bubble
 * @subpackage greet-bubble/Admin/Views/GreetBubbleAppearance
 * @author     ThemeAtelier<themeatelierbd@gmail.com>
 */

namespace ThemeAtelier\GreetBubble\Admin\Views;

use ThemeAtelier\GreetBubble\Admin\Framework\Classes\GREET_BUBBLE;

class GreetBubbleAppearance
{

    /**
     * Create Option fields for the setting options.
     *
     * @param string $prefix Option setting key prefix.
     * @return void
     */
    public static function options($prefix)
    {
        //
        // Validate
        //

        GREET_BUBBLE::createSection($prefix, array(
            'title'       => __('APPEARANCE', 'greet-bubble'),
            'icon'        => 'icofont-paint',
            'fields'      => array(

                array(
                    'type' => 'section_tab',
                    'tabs' => array(
                        array(
                            'title' => esc_html__('Bubble', 'greet-bubble'),
                            'icon'  => 'icofont-chat',
                            'fields' => array(
                                array(
                                    'id'    => 'hi_text',
                                    'title' => esc_html__('Hi Text', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Change the small "Hi" text displayed in the bubble.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DEMO_URL . '" target="_blank">' . __('Live Demo', 'greet-bubble') . '</a><a class="tooltip_btn_secondary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-bubble/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'type'  => 'text',
                                    'default' => esc_html__('Hi', 'greet-bubble'),
                                ),
                                array(
                                    'id' => 'time_based_load',
                                    'type'  => 'slider',
                                    'title' => esc_html__('Time-Based Loading', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Set how many seconds to wait before showing the bubble (0-100 seconds).', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-bubble/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'min' => 0,
                                    'max' => 100,
                                    'step' => 1,
                                    'default' => 0,
                                ),
                                array(
                                    'id' => 'session-hide',
                                    'type' => 'switcher',
                                    'class' => 'switcher_pro_only',
                                    'title' => esc_html__('Hide for Session', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Hide the bubble for the current session when the close button is clicked.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-bubble/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                ),
                                array(
                                    'id' => 'pause-video',
                                    'type' => 'switcher',
                                    'title' => esc_html__('Pause Video When Leaving Page', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Pause the video automatically when the user switches browser tabs.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-bubble/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                ),
                                array(
                                    'id' => 'border_color',
                                    'type' => 'color',
                                    'title' => esc_html__('Border Color', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Set the bubble border color.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-bubble/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'default' => '#7432ff',
                                ),
                                array(
                                    'id' => 'bubble_button_tooltip',
                                    'type' => 'switcher',
                                    'title' => esc_html__('Bubble Tooltip', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Show or hide the bubble tooltip.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-bubble/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'text_on' => esc_html__('Show', 'greet-bubble'),
                                    'text_off' => esc_html__('Hide', 'greet-bubble'),
                                    'text_width' => 80,
                                ),
                                array(
                                    'id' => 'bubble_button_tooltip_text',
                                    'type' => 'text',
                                    'title' => esc_html__('Bubble Tooltip Text', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Set the text for the bubble tooltip.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-bubble/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'default' => __('Welcome to Our Website', 'greet-bubble'),
                                    'dependency' => array('bubble_button_tooltip', '==', 'true'),
                                ),
                                array(
                                    'id' => 'bubble_button_tooltip_width',
                                    'type' => 'slider',
                                    'title' => esc_html__('Bubble Tooltip Width', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Adjust the width of the bubble tooltip.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-bubble/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'min' => 20,
                                    'max' => 500,
                                    'step' => 5,
                                    'unit' => 'px',
                                    'default' => 190,
                                    'dependency' => array('bubble_button_tooltip', '==', 'true'),
                                ),
                                array(
                                    'id'          => 'enable_bubble_attention',
                                    'type'        => 'switcher',
                                    'title'       => esc_html__('Bubble Attention Effect', 'greet-bubble'),
                                    'text_on'     => esc_html__('Enabled', 'greet-bubble'),
                                    'text_off'    => esc_html__('Disabled', 'greet-bubble'),
                                    'text_width'  => '100',
                                    'title_help'  => '<div class="greet-bubble-info-label">' . esc_html__('Enable an animation to draw visitor attention to the floating bubble.', 'greet-bubble') . '</div>',
                                ),
                                array(
                                    'id'          => 'bubble_attention_effect',
                                    'type'        => 'button_set',
                                    'title'       => esc_html__('Attention Effect Style', 'greet-bubble'),
                                    'title_help'  => '<div class="greet-bubble-info-label">' . esc_html__('Choose the animation style for the attention effect. Hover pauses the animation.', 'greet-bubble') . '</div>',
                                    'options' => array(
                                        'pulse' => array(
                                            'text' => esc_html__('Pulse', 'greet-bubble'),
                                        ),
                                        'radiance' => array(
                                            'text' => esc_html__('Radiance', 'greet-bubble'),
                                            'pro_only' => true,
                                        ),
                                        'leap' => array(
                                            'text' => esc_html__('Leap', 'greet-bubble'),
                                            'pro_only' => true,
                                        ),
                                        'swing' => array(
                                            'text' => esc_html__('Swing', 'greet-bubble'),
                                            'pro_only' => true,
                                        ),
                                        'drift' => array(
                                            'text' => esc_html__('Drift', 'greet-bubble'),
                                            'pro_only' => true,
                                        ),
                                        'nudge' => array(
                                            'text' => esc_html__('Nudge', 'greet-bubble'),
                                            'pro_only' => true,
                                        ),
                                    ),
                                    'default'     => 'pulse',
                                    'dependency'  => array('enable_bubble_attention', '==', 'true'),
                                ),
                                array(
                                    'id' => 'bubble_visibility',
                                    'type' => 'button_set',
                                    'title' => esc_html__('Bubble Visibility', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Select where the bubble should be visible.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-bubble/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'options' => array(
                                        'everywhere' => array(
                                            'text' => esc_html__('Everywhere', 'greet-bubble'),
                                        ),
                                        'desktop' => array(
                                            'text' => esc_html__('Desktop Only', 'greet-bubble'),
                                            'pro_only' => true,
                                        ),
                                        'tablet' => array(
                                            'text' => esc_html__('Tablet Only', 'greet-bubble'),
                                            'pro_only' => true,
                                        ),
                                        'mobile' => array(
                                            'text' => esc_html__('Mobile Only', 'greet-bubble'),
                                            'pro_only' => true,
                                        ),
                                    ),
                                    'default' => 'everywhere',
                                ),
                            ),
                        ),


                        array(
                            'title' => esc_html__('Position', 'greet-bubble'),
                            'icon'  => 'icofont-hand-drag',
                            'fields' => array(
                                array(
                                    'id'    => 'bubble_position',
                                    'type'  => 'button_set',
                                    'title' => esc_html__('Bubble Position', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Choose where the bubble appears on the screen.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DEMO_URL . '" target="_blank">' . __('Live Demo', 'greet-bubble') . '</a><a class="tooltip_btn_secondary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-positions/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'default' => 'right_bottom',
                                    'options' => array(
                                        'right_bottom' => array('text' => esc_html__('Right Bottom', 'greet-bubble')),
                                        'left_bottom'  => array('text' => esc_html__('Left Bottom', 'greet-bubble')),
                                        'right_middle' => array('text' => esc_html__('Right Middle', 'greet-bubble'), 'pro_only' => true),
                                        'left_middle'  => array('text' => esc_html__('Left Middle', 'greet-bubble'), 'pro_only' => true),
                                    ),
                                ),
                                array(
                                    'id'    => 'right_bottom',
                                    'type'  => 'spacing',
                                    'title' => esc_html__('Margin from Right Bottom', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Set spacing from the right bottom corner.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-positions/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'top'   => false,
                                    'left'  => false,
                                    'default' => array('right' => '30', 'bottom' => '30', 'unit' => 'px'),
                                    'dependency' => array('bubble_position', '==', 'right_bottom', 'any'),
                                ),
                                array(
                                    'id'    => 'left_bottom',
                                    'type'  => 'spacing',
                                    'title' => esc_html__('Margin from Left Bottom', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Set spacing from the left bottom corner.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-positions/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'top'   => false,
                                    'right' => false,
                                    'default' => array('left' => '30', 'bottom' => '30', 'unit' => 'px'),
                                    'dependency' => array('bubble_position', '==', 'left_bottom', 'any'),
                                ),
                                array(
                                    'id'    => 'right_middle',
                                    'type'  => 'spacing',
                                    'title' => esc_html__('Margin from Right Middle', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Set spacing from the right middle position.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-positions/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'top'   => false,
                                    'left'  => false,
                                    'bottom' => false,
                                    'default' => array('right' => '20', 'unit' => 'px'),
                                    'dependency' => array('bubble_position', '==', 'right_middle', 'any'),
                                ),
                                array(
                                    'id'    => 'left_middle',
                                    'type'  => 'spacing',
                                    'title' => esc_html__('Margin from Left Middle', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Set spacing from the left middle position.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-positions/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'top'   => false,
                                    'right' => false,
                                    'bottom' => false,
                                    'default' => array('left' => '20', 'unit' => 'px'),
                                    'dependency' => array('bubble_position', '==', 'left_middle', 'any'),
                                ),
                                array(
                                    'type'  => 'heading',
                                    'class'  => 'heading',
                                    'title' => esc_html__('Different Positioning on Tablets', 'greet-bubble'),
                                    'dependency' => array('bubble_visibility', '==', 'everywhere', 'any'),
                                ),
                                array(
                                    'id'    => 'enable-positioning-tablet',
                                    'type'  => 'switcher',
                                    'class' => 'switcher_pro_only',
                                    'title' => esc_html__('Tablet Positioning', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Use a different bubble position on tablet devices.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-positions/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'text_on' => esc_html__('Yes', 'greet-bubble'),
                                    'text_off' => esc_html__('No', 'greet-bubble'),
                                    'dependency' => array('bubble_visibility', '==', 'everywhere', 'any'),
                                ),
                                array(
                                    'type'  => 'heading',
                                    'title' => esc_html__('Different Positioning on Mobile', 'greet-bubble'),
                                    'dependency' => array('bubble_visibility', '==', 'everywhere', 'any'),
                                ),
                                array(
                                    'id'    => 'enable-positioning-mobile',
                                    'type'  => 'switcher',
                                    'class' => 'switcher_pro_only',
                                    'title' => esc_html__('Mobile Positioning', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Use a different bubble position on mobile devices.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-positions/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'text_on' => esc_html__('Yes', 'greet-bubble'),
                                    'text_off' => esc_html__('No', 'greet-bubble'),
                                    'dependency' => array('bubble_visibility', '==', 'everywhere', 'any'),
                                ),
                                array(
                                    'id'    => 'draggable_position_change',
                                    'type'  => 'switcher',
                                    'class' => 'switcher_pro_only',
                                    'title' => esc_html__('Draggable Position Change', 'greet-bubble'),
                                    'title_help' =>
                                    '<div class="greet-bubble-info-label">' .
                                        esc_html__('Enabled/Disabled users to change the floating bubble position by dragging to where they want.', 'greet-bubble') .
                                        '</div>' .
                                        '<a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-positions/?ref=1" target="_blank">' .
                                        esc_html__('Open Docs', 'greet-bubble') .
                                        '</a>',
                                    'text_width'  => '100',
                                    'text_on'    => esc_html__('Enabled', 'greet-bubble'),
                                    'text_off'   => esc_html__('Disabled', 'greet-bubble'),
                                ),
                            ),
                        ),

                        array(
                            'title' => esc_html__('Button', 'greet-bubble'),
                            'icon'  => 'icofont-external-link',
                            'fields' => array(

                                array(
                                    'id'    => 'button_display_type',
                                    'type'  => 'button_set',
                                    'title' => esc_html__('Button Display Type', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Choose how the button is displayed.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DEMO_URL . '" target="_blank">' . __('Live Demo', 'greet-bubble') . '</a><a class="tooltip_btn_secondary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-button/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'options' => array(
                                        'text_only' => array('text' => __('Text Only', 'greet-bubble')),
                                        'with_icon_and_text' => array('text' => __('With Icon and Text', 'greet-bubble')),
                                        'icon_only' => array('text' => __('Icon Only', 'greet-bubble'), 'pro_only' => true),
                                    ),
                                    'default' => 'text_only',
                                ),

                                array(
                                    'id'    => 'button_type',
                                    'type'  => 'button_set',
                                    'title' => esc_html__('Button Type', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Select the type of button.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-button/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'options' => array(
                                        'square' => array('text' => __('Square', 'greet-bubble')),
                                        'rounded' => array('text' => __('Rounded', 'greet-bubble')),
                                    ),
                                    'default' => 'rounded',
                                ),

                                array(
                                    'id'    => 'button_radius',
                                    'type'  => 'slider',
                                    'title' => esc_html__('Button Radius', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Set the border radius of the button in px.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-button/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'default' => 5,
                                    'dependency' => array('button_type', '==', 'rounded'),
                                ),

                                array(
                                    'id'    => 'buttonsColors',
                                    'type'  => 'color_group',
                                    'title' => esc_html__('Button Colors', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Set background, text, and hover colors for buttons.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-button/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'options' => array(
                                        'buttons_bg' => esc_html__('Background', 'greet-bubble'),
                                        'buttons_color' => esc_html__('Text Color', 'greet-bubble'),
                                        'buttons_hover_bg' => esc_html__('Background Hover', 'greet-bubble'),
                                        'buttons_hover_color' => esc_html__('Hover Text Color', 'greet-bubble'),
                                    ),
                                    'default' => array(
                                        'buttons_bg' => '#7432ff',
                                        'buttons_color' => '#ffffff',
                                        'buttons_hover_bg' => '#7113ff',
                                        'buttons_hover_color' => '#ffffff',
                                    ),
                                ),

                                array(
                                    'id'    => 'buttons_tooltip',
                                    'type'  => 'switcher',
                                    'title' => esc_html__('Button Tooltip', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Show or hide the button tooltip.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-button/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'text_on' => esc_html__('Show', 'greet-bubble'),
                                    'text_off' => esc_html__('Hide', 'greet-bubble'),
                                    'default' => true,
                                    'text_width' => 80,
                                ),

                                array(
                                    'id'    => 'buttons_tooltip_width',
                                    'type'  => 'slider',
                                    'title' => esc_html__('Button Tooltip Width', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Set the width of the button tooltip in px.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-button/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'min'   => 20,
                                    'max'   => 500,
                                    'step'  => 5,
                                    'unit'  => 'px',
                                    'default' => 190,
                                    'dependency' => array('buttons_tooltip', '==', 'true'),
                                ),

                                array(
                                    'id'    => 'buttons_tooltip_position',
                                    'type'  => 'button_set',
                                    'title' => esc_html__('Button Tooltip Position', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Select where the tooltip appears relative to the button.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-button/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'options' => array(
                                        'top' => array('text' => esc_html__('Top', 'greet-bubble')),
                                        'bottom' => array('text' => esc_html__('Bottom', 'greet-bubble')),
                                        'left' => array('text' => esc_html__('Left', 'greet-bubble')),
                                        'right' => array('text' => esc_html__('Right', 'greet-bubble')),
                                    ),
                                    'default' => 'top',
                                ),
                            )
                        ),
                        array(
                            'title' => esc_html__('Others', 'greet-bubble'),
                            'icon'  => 'icofont-swirl',
                            'fields' => array(

                                array(
                                    'id'      => 'scroll_bar_colors',
                                    'type'    => 'color_group',
                                    'class'   => 'greet-bubble-only',
                                    'title'   => esc_html__('Scrollbar Colors', 'greet-bubble'),
                                    'title_help' => '<div class="greet-bubble-info-label">' . __('Change the scrollbar track and thumb colors for popups such as contact forms.', 'greet-bubble') . '</div><a class="tooltip_btn_primary" href="' . GREET_BUBBLE_DOCS_URL . 'greet-bubble-settings/appearance-others/" target="_blank">' . __('Open Docs', 'greet-bubble') . '</a>',
                                    'options' => array(
                                        'track_bg' => esc_html__('Track Background', 'greet-bubble'),
                                        'thumb_bg' => esc_html__('Thumb Background', 'greet-bubble'),
                                    ),
                                    'default' => array(
                                        'thumb_bg' => '#7432ff',
                                        'track_bg' => '#eeeeee',
                                    ),
                                ),
                            ),
                        ),
                    )
                ),
            )
        ));
    }
}
