<?php

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

if ( !class_exists( 'Reon' ) ) {
    
    return;
}

if ( !class_exists( 'Pricely_Admin_Settings_CountDown_Inline_Fields' ) ) {

    class Pricely_Admin_Settings_CountDown_Inline_Fields {

        private $admin_page;
        private $admin_utils;

        public function __construct() {

            add_filter( 'reon_get-repeater-field-pricely_ui_inline_countdown-templates', array( $this, 'get_templates' ), 10, 2 );

            add_filter( 'reon_get-repeater-template-pricely_ui_inline_countdown-ui_default-fields', array( $this, 'get_template_fields' ), 10, 2 );
            add_filter( 'reon_get-repeater-template-pricely_ui_inline_countdown-ui_option-fields', array( $this, 'get_template_fields' ), 10, 2 );
        }

        public function get_templates( $in_templates, $repeater_args ) {

            $this->init_settings();

            $in_templates[] = array(
                'id' => 'ui_default',
                'head' => array(
                    'title' => '',
                    'defaut_title' => esc_html__( 'Countdown - Style 1', 'pricely-dynamic-pricing-cart-discounts' ),
                    'title_field' => 'admin_note',
                ),
                'empy_button' => true,
            );

            $in_templates[] = array(
                'id' => 'ui_option',
                'head' => array(
                    'title' => '',
                    'defaut_title' => esc_html__( 'Countdown - Style 1', 'pricely-dynamic-pricing-cart-discounts' ),
                    'title_field' => 'admin_note',
                ),
            );

            return $in_templates;
        }

        public function get_template_fields( $in_fields, $repeater_args ) {

            $in_fields[] = array(
                'id' => 'ui_id',
                'type' => 'autoid',
                'autoid' => 'pricely_ui',
            );

            $in_fields[] = array(
                'id' => 'any_ids',
                'type' => 'columns-field',
                'columns' => 1,
                'full_width' => true,
                'merge_fields' => false,
                'fields' => $this->admin_note_fields( array() ),
            );

            $in_fields[] = array(
                'id' => 'any_ids',
                'type' => 'columns-field',
                'columns' => 3,
                'full_width' => true,
                'center_head' => true,
                'merge_fields' => false,
                'title' => esc_html__( 'Title Settings', 'pricely-dynamic-pricing-cart-discounts' ),
                'desc' => esc_html__( 'Use these settings to control the title of the countdown', 'pricely-dynamic-pricing-cart-discounts' ),
                'field_css_class' => array( 'pricely_subtitles' ),
                'fields' => $this->title_fields( array() ),
            );

            $in_fields[] = array(
                'id' => 'any_ids',
                'type' => 'columns-field',
                'columns' => 5,
                'full_width' => true,
                'merge_fields' => false,
                'fields' => $this->title_two_fields( array() ),
            );

            $in_fields[] = array(
                'id' => 'any_ids',
                'type' => 'columns-field',
                'columns' => 2,
                'full_width' => true,
                'merge_fields' => false,
                'fields' => $this->title_three_fields( array() ),
            );

            $in_fields[] = array(
                'id' => 'any_ids',
                'type' => 'columns-field',
                'columns' => 4,
                'full_width' => true,
                'merge_fields' => false,
                'fields' => $this->title_four_fields( array() ),
            );

            $in_fields[] = array(
                'id' => 'any_ids',
                'type' => 'columns-field',
                'columns' => 4,
                'full_width' => true,
                'center_head' => true,
                'merge_fields' => false,
                'title' => esc_html__( 'Timer Settings', 'pricely-dynamic-pricing-cart-discounts' ),
                'desc' => esc_html__( 'Use these settings to control the timer of the countdown', 'pricely-dynamic-pricing-cart-discounts' ),
                'field_css_class' => array( 'pricely_subtitles' ),
                'fields' => $this->timer_fields( array() ),
            );

            $in_fields[] = array(
                'id' => 'any_ids',
                'type' => 'columns-field',
                'columns' => 5,
                'full_width' => true,
                'merge_fields' => false,
                'fields' => $this->timer_two_fields( array() ),
            );

            $in_fields[] = array(
                'id' => 'any_ids',
                'type' => 'columns-field',
                'columns' => 4,
                'full_width' => true,
                'center_head' => true,
                'merge_fields' => false,
                'title' => esc_html__( 'Counters Settings', 'pricely-dynamic-pricing-cart-discounts' ),
                'desc' => esc_html__( 'Use these settings to control the counters of the countdown', 'pricely-dynamic-pricing-cart-discounts' ),
                'field_css_class' => array( 'pricely_subtitles' ),
                'fields' => $this->counters_fields( array() ),
            );

            $in_fields[] = array(
                'id' => 'any_ids',
                'type' => 'columns-field',
                'columns' => 4,
                'full_width' => true,
                'center_head' => true,
                'merge_fields' => false,
                'title' => esc_html__( 'Labels Settings', 'pricely-dynamic-pricing-cart-discounts' ),
                'desc' => esc_html__( 'Use these settings to control the labels of the countdown', 'pricely-dynamic-pricing-cart-discounts' ),
                'field_css_class' => array( 'pricely_subtitles' ),
                'fields' => $this->labels_fields( array() ),
            );

            $in_fields[] = array(
                'id' => 'any_ids',
                'type' => 'columns-field',
                'columns' => 5,
                'full_width' => true,
                'merge_fields' => false,
                'fields' => $this->labels_two_fields( array() ),
            );

            $in_fields[] = array(
                'id' => 'any_ids',
                'type' => 'columns-field',
                'columns' => 3,
                'full_width' => true,
                'center_head' => true,
                'merge_fields' => false,
                'title' => esc_html__( 'Container Settings', 'pricely-dynamic-pricing-cart-discounts' ),
                'desc' => esc_html__( 'Use these settings to control the container of the countdown', 'pricely-dynamic-pricing-cart-discounts' ),
                'field_css_class' => array( 'pricely_subtitles' ),
                'fields' => $this->container_fields( array() ),
            );

            $in_fields[] = array(
                'id' => 'any_ids',
                'type' => 'columns-field',
                'columns' => 4,
                'full_width' => true,
                'merge_fields' => false,
                'fields' => $this->container_two_fields( array() ),
            );

            $in_fields[] = array(
                'id' => 'any_ids',
                'type' => 'columns-field',
                'columns' => 4,
                'full_width' => true,
                'merge_fields' => false,
                'fields' => $this->container_three_fields( array() ),
            );

            return $in_fields;
        }

        private function admin_note_fields( $in_fields ) {

            $in_fields[] = array(
                'id' => 'admin_note',
                'type' => 'textbox',
                'tooltip' => esc_html__( 'Adds a private note for reference purposes', 'pricely-dynamic-pricing-cart-discounts' ),
                'column_size' => 1,
                'column_title' => esc_html__( 'Admin Note', 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => '',
                'placeholder' => esc_html__( 'Type here...', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            return $in_fields;
        }

        private function title_fields( $in_fields ) {

            $in_fields[] = array(
                'id' => 'title_text',
                'type' => 'textbox',
                'column_size' => 2,
                'column_title' => esc_html__( 'Title Text', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( 'Determines the title text of the countdown', 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => esc_html__( 'SALES ENDS IN', 'pricely-dynamic-pricing-cart-discounts' ),
                'placeholder' => esc_html__( 'Type here...', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            $in_fields[] = array(
                'id' => 'title_tag',
                'type' => 'select2',
                'column_size' => 1,
                'column_title' => esc_html__( 'Title Tag', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Determines the HTML tag of the title", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => 'h4',
                'options' => array(
                    'h1' => esc_html__( 'H1 - Heading', 'pricely-dynamic-pricing-cart-discounts' ),
                    'h2' => esc_html__( 'H2 - Heading', 'pricely-dynamic-pricing-cart-discounts' ),
                    'h3' => esc_html__( 'H3 - Heading', 'pricely-dynamic-pricing-cart-discounts' ),
                    'h4' => esc_html__( 'H4 - Heading', 'pricely-dynamic-pricing-cart-discounts' ),
                    'h5' => esc_html__( 'H5 - Heading', 'pricely-dynamic-pricing-cart-discounts' ),
                    'h6' => esc_html__( 'H6 - Heading', 'pricely-dynamic-pricing-cart-discounts' ),
                ),
                'width' => '100%',
            );

            return $in_fields;
        }

        private function title_two_fields( $in_fields ) {

            $in_fields[] = array(
                'id' => 'title_color',
                'type' => 'colorpicker',
                'column_width' => '180px',
                'column_title' => esc_html__( 'Text Color', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the title's color of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => $this->admin_utils->get_theme_value( 'color_1' ),
                'buton_text' => esc_html__( 'Pick color', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            $in_fields[] = array(
                'id' => 'title_bg_color',
                'type' => 'colorpicker',
                'column_width' => '180px',
                'column_title' => esc_html__( 'Background Color', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the title's background color of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => '',
                'buton_text' => esc_html__( 'Pick color', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            $in_fields[] = array(
                'id' => 'title_font_size',
                'type' => 'group-field',
                'column_width' => '170px',
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Font Size', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the title's font size of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_size_fields( array( 'default_size' => 14, 'default_unit' => 'px' ) ),
            );

            $in_fields[] = array(
                'id' => 'title_font_weight',
                'type' => 'select2',
                'column_width' => '170px',
                'column_title' => esc_html__( 'Font Weight', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the title's font weight of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => '600',
                'options' => array(
                    '' => esc_html__( 'Defualt', 'pricely-dynamic-pricing-cart-discounts' ),
                    '100' => esc_html__( '100', 'pricely-dynamic-pricing-cart-discounts' ),
                    '200' => esc_html__( '200', 'pricely-dynamic-pricing-cart-discounts' ),
                    '300' => esc_html__( '300', 'pricely-dynamic-pricing-cart-discounts' ),
                    '400' => esc_html__( '400', 'pricely-dynamic-pricing-cart-discounts' ),
                    '500' => esc_html__( '500', 'pricely-dynamic-pricing-cart-discounts' ),
                    '600' => esc_html__( '600', 'pricely-dynamic-pricing-cart-discounts' ),
                    '700' => esc_html__( '700', 'pricely-dynamic-pricing-cart-discounts' ),
                    '800' => esc_html__( '800', 'pricely-dynamic-pricing-cart-discounts' ),
                    '900' => esc_html__( '900', 'pricely-dynamic-pricing-cart-discounts' ),
                    'lighter' => esc_html__( 'lighter', 'pricely-dynamic-pricing-cart-discounts' ),
                    'normal' => esc_html__( 'Normal', 'pricely-dynamic-pricing-cart-discounts' ),
                    'bold' => esc_html__( 'Bold', 'pricely-dynamic-pricing-cart-discounts' ),
                    'bolder' => esc_html__( 'Bolder', 'pricely-dynamic-pricing-cart-discounts' ),
                ),
                'width' => '100%',
            );

            $in_fields[] = array(
                'id' => 'title_font_family',
                'type' => 'textbox',
                'column_no_size' => true,
                'column_title' => esc_html__( 'Font Family', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the title's font family of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => '',
                'placeholder' => esc_html__( 'Font family...', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            return $in_fields;
        }

        private function title_three_fields( $in_fields ) {

            $in_fields[] = array(
                'id' => 'title_padding',
                'type' => 'group-field',
                'column_no_size' => true,
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Padding', 'pricely-dynamic-pricing-cart-discounts' ),
                'column_classes' => array( 'pricely_box_hint' ),
                'tooltip' => esc_html__( "Determines the padding of the title", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_boundary_sizes_fields( array( 'default_size' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '' ), 'placeholder' => '', 'default_unit' => 'px' ) ),
            );

            $in_fields[] = array(
                'id' => 'title_margin',
                'type' => 'group-field',
                'column_no_size' => true,
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Margin', 'pricely-dynamic-pricing-cart-discounts' ),
                'column_classes' => array( 'pricely_box_hint' ),
                'tooltip' => esc_html__( "Determines the margins of the title", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_boundary_sizes_fields( array( 'default_size' => array( 'top' => '', 'right' => '', 'bottom' => 10, 'left' => '' ), 'placeholder' => '', 'default_unit' => 'px' ) ),
            );


            return $in_fields;
        }

        private function title_four_fields( $in_fields ) {

            $in_fields[] = array(
                'id' => 'title_border_radius',
                'type' => 'group-field',
                'column_width' => '170px',
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Border Radius', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the title's border radius of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_size_fields( array( 'default_size' => '0', 'default_unit' => 'px' ) ),
            );

            $in_fields[] = array(
                'id' => 'title_border_style',
                'type' => 'select2',
                'column_no_size' => true,
                'column_title' => esc_html__( 'Border Style', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the title's border style of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => 'none',
                'options' => array(
                    'none' => esc_html__( 'None', 'pricely-dynamic-pricing-cart-discounts' ),
                    'solid' => esc_html__( 'Solid', 'pricely-dynamic-pricing-cart-discounts' ),
                    'dotted' => esc_html__( 'Dotted', 'pricely-dynamic-pricing-cart-discounts' ),
                    'dashed' => esc_html__( 'Dashed', 'pricely-dynamic-pricing-cart-discounts' )
                ),
                'width' => '100%',
                'column_attributes' => array(
                    'style' => 'min-width:170px;'
                ),
                'fold_id' => 'countdown_inline_title_border_style',
            );

            $in_fields[] = array(
                'id' => 'title_border_color',
                'type' => 'colorpicker',
                'column_no_size' => true,
                'column_title' => esc_html__( 'Border Color', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the title's border color of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => $this->admin_utils->get_theme_value( 'color_1' ),
                'buton_text' => esc_html__( 'Pick color', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'column_attributes' => array(
                    'style' => 'min-width:170px;'
                ),
                'fold' => array(
                    'target' => 'countdown_inline_title_border_style',
                    'attribute' => 'value',
                    'value' => array( 'none' ),
                    'oparator' => 'neq',
                    'clear' => false,
                ),
            );

            $in_fields[] = array(
                'id' => 'title_border_width',
                'type' => 'group-field',
                'merge_fields' => true,
                'fluid-group' => true,
                'column_no_size' => true,
                'column_title' => esc_html__( 'Border Width', 'pricely-dynamic-pricing-cart-discounts' ),
                'column_classes' => array( 'pricely_box_hint' ),
                'tooltip' => esc_html__( "Controls the title's border width of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_boundary_sizes_fields( array( 'default_size' => 1, 'default_unit' => 'px' ) ),
                'fold' => array(
                    'target' => 'countdown_inline_title_border_style',
                    'attribute' => 'value',
                    'value' => array( 'none' ),
                    'oparator' => 'neq',
                    'clear' => false,
                ),
            );

            return $in_fields;
        }

        private function timer_fields( $in_fields ) {

            $in_fields[] = array(
                'id' => 'timer_bg_color',
                'type' => 'colorpicker',
                'column_width' => '150px',
                'column_title' => esc_html__( 'Background Color', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the timer's background color of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => $this->admin_utils->get_theme_value( 'color_4' ),
                'buton_text' => esc_html__( 'Pick color', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            $in_fields[] = array(
                'id' => 'timer_padding',
                'type' => 'group-field',
                'column_no_size' => true,
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Padding', 'pricely-dynamic-pricing-cart-discounts' ),
                'column_classes' => array( 'pricely_box_hint' ),
                'tooltip' => esc_html__( 'Determines the padding of the timer', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_two_sides_sizes_fields( array( 'default_size' => array( 'top_bottom' => 10, 'left_right' => 10 ), 'placeholder' => '', 'default_unit' => 'px' ) ),
            );

            $in_fields[] = array(
                'id' => 'timer_margin',
                'type' => 'group-field',
                'column_no_size' => true,
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Margin', 'pricely-dynamic-pricing-cart-discounts' ),
                'column_classes' => array( 'pricely_box_hint' ),
                'tooltip' => esc_html__( "Determines the margins of the timer", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_boundary_sizes_fields( array( 'default_size' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '' ), 'placeholder' => '', 'default_unit' => 'px' ) ),
            );

            $in_fields[] = array(
                'id' => 'timer_counters_labels_gaps',
                'type' => 'group-field',
                'column_width' => '170px',
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Counter / Labels Gaps', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the spaces between counters and labels of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_size_fields( array( 'default_size' => '1', 'default_unit' => 'px' ) ),
            );

            return $in_fields;
        }

        private function timer_two_fields( $in_fields ) {

            $in_fields[] = array(
                'id' => 'timer_border_radius',
                'type' => 'group-field',
                'column_width' => '160px',
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Border Radius', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the timer's border radius of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_size_fields( array( 'default_size' => '4', 'default_unit' => 'px' ) ),
            );

            $in_fields[] = array(
                'id' => 'timer_counters_gaps',
                'type' => 'group-field',
                'column_width' => '160px',
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Counters Gaps', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the counter's gaps of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_size_fields( array( 'default_size' => '3', 'default_unit' => 'px' ) ),
            );


            $in_fields[] = array(
                'id' => 'timer_border_style',
                'type' => 'select2',
                'column_no_size' => true,
                'column_title' => esc_html__( 'Border Style', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the timer's border style of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => 'none',
                'options' => array(
                    'none' => esc_html__( 'None', 'pricely-dynamic-pricing-cart-discounts' ),
                    'solid' => esc_html__( 'Solid', 'pricely-dynamic-pricing-cart-discounts' ),
                    'dotted' => esc_html__( 'Dotted', 'pricely-dynamic-pricing-cart-discounts' ),
                    'dashed' => esc_html__( 'Dashed', 'pricely-dynamic-pricing-cart-discounts' )
                ),
                'width' => '100%',
                'column_attributes' => array(
                    'style' => 'min-width:120px;'
                ),
                'fold_id' => 'countdown_inline_timer_border_style',
            );

            $in_fields[] = array(
                'id' => 'timer_border_color',
                'type' => 'colorpicker',
                'column_no_size' => true,
                'column_title' => esc_html__( 'Border Color', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the timer's border color of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => $this->admin_utils->get_theme_value( 'color_1' ),
                'buton_text' => esc_html__( 'Pick color', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'column_attributes' => array(
                    'style' => 'min-width:170px;'
                ),
                'fold' => array(
                    'target' => 'countdown_inline_timer_border_style',
                    'attribute' => 'value',
                    'value' => array( 'none' ),
                    'oparator' => 'neq',
                    'clear' => false,
                ),
            );

            $in_fields[] = array(
                'id' => 'timer_border_width',
                'type' => 'group-field',
                'merge_fields' => true,
                'fluid-group' => true,
                'column_no_size' => true,
                'column_title' => esc_html__( 'Border Width', 'pricely-dynamic-pricing-cart-discounts' ),
                'column_classes' => array( 'pricely_box_hint' ),
                'tooltip' => esc_html__( "Controls the timer's border width of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_boundary_sizes_fields( array( 'default_size' => 1, 'default_unit' => 'px' ) ),
                'fold' => array(
                    'target' => 'countdown_inline_timer_border_style',
                    'attribute' => 'value',
                    'value' => array( 'none' ),
                    'oparator' => 'neq',
                    'clear' => false,
                ),
            );

            return $in_fields;
        }

        private function counters_fields( $in_fields ) {

            $in_fields[] = array(
                'id' => 'counter_color',
                'type' => 'colorpicker',
                'column_width' => '180px',
                'column_title' => esc_html__( 'Color', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the counter's color of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => $this->admin_utils->get_theme_value( 'accent_color_3' ),
                'buton_text' => esc_html__( 'Pick color', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            $in_fields[] = array(
                'id' => 'counter_font_size',
                'type' => 'group-field',
                'column_width' => '170px',
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Font Size', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the counter's font size of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_size_fields( array( 'default_size' => 18, 'default_unit' => 'px' ) ),
            );

            $in_fields[] = array(
                'id' => 'counter_font_weight',
                'type' => 'select2',
                'column_width' => '170px',
                'column_title' => esc_html__( 'Font Weight', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the counter's font weight of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => '',
                'options' => array(
                    '' => esc_html__( 'Defualt', 'pricely-dynamic-pricing-cart-discounts' ),
                    '100' => esc_html__( '100', 'pricely-dynamic-pricing-cart-discounts' ),
                    '200' => esc_html__( '200', 'pricely-dynamic-pricing-cart-discounts' ),
                    '300' => esc_html__( '300', 'pricely-dynamic-pricing-cart-discounts' ),
                    '400' => esc_html__( '400', 'pricely-dynamic-pricing-cart-discounts' ),
                    '500' => esc_html__( '500', 'pricely-dynamic-pricing-cart-discounts' ),
                    '600' => esc_html__( '600', 'pricely-dynamic-pricing-cart-discounts' ),
                    '700' => esc_html__( '700', 'pricely-dynamic-pricing-cart-discounts' ),
                    '800' => esc_html__( '800', 'pricely-dynamic-pricing-cart-discounts' ),
                    '900' => esc_html__( '900', 'pricely-dynamic-pricing-cart-discounts' ),
                    'lighter' => esc_html__( 'lighter', 'pricely-dynamic-pricing-cart-discounts' ),
                    'normal' => esc_html__( 'Normal', 'pricely-dynamic-pricing-cart-discounts' ),
                    'bold' => esc_html__( 'Bold', 'pricely-dynamic-pricing-cart-discounts' ),
                    'bolder' => esc_html__( 'Bolder', 'pricely-dynamic-pricing-cart-discounts' ),
                ),
                'width' => '100%',
            );

            $in_fields[] = array(
                'id' => 'counter_font_family',
                'type' => 'textbox',
                'column_no_size' => true,
                'column_title' => esc_html__( 'Font Family', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the counter's font family of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => '',
                'placeholder' => esc_html__( 'Font family...', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            return $in_fields;
        }

        private function labels_fields( $in_fields ) {

            $in_fields[] = array(
                'id' => 'label_color',
                'type' => 'colorpicker',
                'column_width' => '180px',
                'column_title' => esc_html__( 'Color', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the label's color of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => $this->admin_utils->get_theme_value( 'color_2' ),
                'buton_text' => esc_html__( 'Pick color', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            $in_fields[] = array(
                'id' => 'label_font_size',
                'type' => 'group-field',
                'column_width' => '170px',
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Font Size', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the label's font size of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_size_fields( array( 'default_size' => 10, 'default_unit' => 'px' ) ),
            );

            $in_fields[] = array(
                'id' => 'label_font_weight',
                'type' => 'select2',
                'column_width' => '170px',
                'column_title' => esc_html__( 'Font Weight', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the label's font weight of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => '',
                'options' => array(
                    '' => esc_html__( 'Defualt', 'pricely-dynamic-pricing-cart-discounts' ),
                    '100' => esc_html__( '100', 'pricely-dynamic-pricing-cart-discounts' ),
                    '200' => esc_html__( '200', 'pricely-dynamic-pricing-cart-discounts' ),
                    '300' => esc_html__( '300', 'pricely-dynamic-pricing-cart-discounts' ),
                    '400' => esc_html__( '400', 'pricely-dynamic-pricing-cart-discounts' ),
                    '500' => esc_html__( '500', 'pricely-dynamic-pricing-cart-discounts' ),
                    '600' => esc_html__( '600', 'pricely-dynamic-pricing-cart-discounts' ),
                    '700' => esc_html__( '700', 'pricely-dynamic-pricing-cart-discounts' ),
                    '800' => esc_html__( '800', 'pricely-dynamic-pricing-cart-discounts' ),
                    '900' => esc_html__( '900', 'pricely-dynamic-pricing-cart-discounts' ),
                    'lighter' => esc_html__( 'lighter', 'pricely-dynamic-pricing-cart-discounts' ),
                    'normal' => esc_html__( 'Normal', 'pricely-dynamic-pricing-cart-discounts' ),
                    'bold' => esc_html__( 'Bold', 'pricely-dynamic-pricing-cart-discounts' ),
                    'bolder' => esc_html__( 'Bolder', 'pricely-dynamic-pricing-cart-discounts' ),
                ),
                'width' => '100%',
            );

            $in_fields[] = array(
                'id' => 'label_font_family',
                'type' => 'textbox',
                'column_no_size' => true,
                'column_title' => esc_html__( 'Font Family', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the label's font family of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => '',
                'placeholder' => esc_html__( 'Font family...', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            return $in_fields;
        }

        private function labels_two_fields( $in_fields ) {

            $in_fields[] = array(
                'id' => 'vertical_align',
                'type' => 'group-field',
                'column_no_size' => true,
                'column_attributes' => array(
                    'style' => 'min-width:165px;'
                ),
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Vertical Alignment', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the labels vertical alignment", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_size_fields( array( 'default_size' => -2, 'default_unit' => 'px' ) ),
            );

            $in_fields[] = array(
                'id' => 'label_days_text',
                'type' => 'textbox',
                'column_width' => '21%',
                'column_title' => esc_html__( 'Days Text', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the days of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => esc_html__( 'days', 'pricely-dynamic-pricing-cart-discounts' ),
                'placeholder' => esc_html__( 'Type here...', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            $in_fields[] = array(
                'id' => 'label_hours_text',
                'type' => 'textbox',
                'column_width' => '21%',
                'column_title' => esc_html__( 'Hours Text', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the hours of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => esc_html__( 'hours', 'pricely-dynamic-pricing-cart-discounts' ),
                'placeholder' => esc_html__( 'Type here...', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            $in_fields[] = array(
                'id' => 'label_minutes_text',
                'type' => 'textbox',
                'column_width' => '21%',
                'column_title' => esc_html__( 'Minutes Text', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the minutes of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => esc_html__( 'mins', 'pricely-dynamic-pricing-cart-discounts' ),
                'placeholder' => esc_html__( 'Type here...', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            $in_fields[] = array(
                'id' => 'label_seconds_text',
                'type' => 'textbox',
                'column_width' => '21%',
                'column_title' => esc_html__( 'Seconds Text', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the seconds of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => esc_html__( 'secs', 'pricely-dynamic-pricing-cart-discounts' ),
                'placeholder' => esc_html__( 'Type here...', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            return $in_fields;
        }

        private function container_fields( $in_fields ) {

            $in_fields[] = array(
                'id' => 'justify_contents',
                'type' => 'select2',
                'column_no_size' => true,
                'column_title' => esc_html__( 'Justify Contents', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( 'Determines the content alignment of the countdown', 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => 'center',
                'options' => array(
                    'left' => esc_html__( 'Justify left', 'pricely-dynamic-pricing-cart-discounts' ),
                    'center' => esc_html__( 'Justify center', 'pricely-dynamic-pricing-cart-discounts' ),
                    'right' => esc_html__( 'Justify right', 'pricely-dynamic-pricing-cart-discounts' )
                ),
                'width' => '100%',
            );

            $in_fields[] = array(
                'id' => 'width',
                'type' => 'group-field',
                'column_width' => '200px',
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Width', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the container's width of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_size_fields( array( 'default_size' => '', 'default_unit' => 'px', 'placeholder' => 'auto' ) ),
            );

            $in_fields[] = array(
                'id' => 'bg_color',
                'type' => 'colorpicker',
                'column_width' => '200px',
                'column_title' => esc_html__( 'Background Color', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the container's background color of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => '',
                'buton_text' => esc_html__( 'Pick color', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
            );

            return $in_fields;
        }

        private function container_two_fields( $in_fields ) {

            $in_fields[] = array(
                'id' => 'padding',
                'type' => 'group-field',
                'column_no_size' => true,
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Padding', 'pricely-dynamic-pricing-cart-discounts' ),
                'column_classes' => array( 'pricely_box_hint' ),
                'tooltip' => esc_html__( "Determines the padding of the container", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_boundary_sizes_fields( array( 'default_size' => array( 'top' => '', 'right' => 10, 'bottom' => '', 'left' => 10 ), 'placeholder' => '', 'default_unit' => 'px' ) ),
            );

            $in_fields[] = array(
                'id' => 'margin',
                'type' => 'group-field',
                'column_no_size' => true,
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Margin', 'pricely-dynamic-pricing-cart-discounts' ),
                'column_classes' => array( 'pricely_box_hint' ),
                'tooltip' => esc_html__( "Determines the margins of the container", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_boundary_sizes_fields( array( 'default_size' => array( 'top' => '', 'right' => '', 'bottom' => 15, 'left' => '' ), 'placeholder' => '', 'default_unit' => 'px' ) ),
            );

            return $in_fields;
        }

        private function container_three_fields( $in_fields ) {

            $in_fields[] = array(
                'id' => 'border_radius',
                'type' => 'group-field',
                'column_width' => '170px',
                'merge_fields' => true,
                'fluid-group' => true,
                'column_title' => esc_html__( 'Border Radius', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the container's border radius of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_size_fields( array( 'default_size' => '0', 'default_unit' => 'px' ) ),
            );

            $in_fields[] = array(
                'id' => 'border_style',
                'type' => 'select2',
                'column_no_size' => true,
                'column_title' => esc_html__( 'Border Style', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the container's border style of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => 'none',
                'options' => array(
                    'none' => esc_html__( 'None', 'pricely-dynamic-pricing-cart-discounts' ),
                    'solid' => esc_html__( 'Solid', 'pricely-dynamic-pricing-cart-discounts' ),
                    'dotted' => esc_html__( 'Dotted', 'pricely-dynamic-pricing-cart-discounts' ),
                    'dashed' => esc_html__( 'Dashed', 'pricely-dynamic-pricing-cart-discounts' )
                ),
                'width' => '100%',
                'column_attributes' => array(
                    'style' => 'min-width:150px;'
                ),
                'fold_id' => 'countdown_inline_border_style',
            );

            $in_fields[] = array(
                'id' => 'border_color',
                'type' => 'colorpicker',
                'column_no_size' => true,
                'column_title' => esc_html__( 'Border Color', 'pricely-dynamic-pricing-cart-discounts' ),
                'tooltip' => esc_html__( "Controls the container's border color of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'default' => $this->admin_utils->get_theme_value( 'color_1' ),
                'buton_text' => esc_html__( 'Pick color', 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'column_attributes' => array(
                    'style' => 'min-width:180px;'
                ),
                'fold' => array(
                    'target' => 'countdown_inline_border_style',
                    'attribute' => 'value',
                    'value' => array( 'none' ),
                    'oparator' => 'neq',
                    'clear' => false,
                ),
            );

            $in_fields[] = array(
                'id' => 'border_width',
                'type' => 'group-field',
                'merge_fields' => true,
                'fluid-group' => true,
                'column_no_size' => true,
                'column_title' => esc_html__( 'Border Width', 'pricely-dynamic-pricing-cart-discounts' ),
                'column_classes' => array( 'pricely_box_hint' ),
                'tooltip' => esc_html__( "Controls the container's border width of the countdown", 'pricely-dynamic-pricing-cart-discounts' ),
                'width' => '100%',
                'fields' => $this->admin_utils->get_boundary_sizes_fields( array( 'default_size' => 1, 'default_unit' => 'px' ) ),
                'fold' => array(
                    'target' => 'countdown_inline_border_style',
                    'attribute' => 'value',
                    'value' => array( 'none' ),
                    'oparator' => 'neq',
                    'clear' => false,
                ),
            );

            return $in_fields;
        }

        private function init_settings() {

            if ( !$this->admin_page ) {

                $this->admin_page = Pricely_Admin_Page::get_instance();
            }

            if ( !$this->admin_utils ) {

                $this->admin_utils = Pricely_Admin_Utils::get_instance();
            }
        }

    }

    new Pricely_Admin_Settings_CountDown_Inline_Fields();
}