<?php

/**
 * The admin-specific functionality of the plugin.
 *
 * @link       https://wpconfiguratorbuilder.com
 * @since      1.0.0
 *
 * @package    wcb-configurator-builder
 * @subpackage wcb-configurator-builder/admin
 */

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

use Carbon_Fields\Container;
use Carbon_Fields\Field;

/**
 * The admin-specific functionality of the plugin.
 *
 * Defines the plugin name, version, and two examples hooks for how to
 * enqueue the admin-specific stylesheet and JavaScript.
 *
 * @package    wcb-configurator-builder
 * @subpackage wcb-configurator-builder/admin
 * @author     WPCB <support@wpconfiguratorbuilder.com>
 */
class WPCB_Settings {

	/**
	 * Constructor.
	 */
	public function __construct() {
		
		if ( defined( 'DOING_AJAX' ) ) {
			return;
		}

		add_action( 'carbon_fields_register_fields', array( $this, 'register_setting_fields' ) );

	}

	/**
	 * Registers the Carbon Fields for our settings page.
	 *
	 * @since    1.0.0
	 */
	public function register_setting_fields() {

		$repeater_labels = array(
			'plural_name' => __( 'Currencies', 'wcb-configurator-builder' ),
			'singular_name' => __( 'Currency', 'wcb-configurator-builder' ),
		);

		$discount_labels = array(
			'plural_name' => __( 'Discounts', 'wcb-configurator-builder' ),
			'singular_name' => __( 'Discount', 'wcb-configurator-builder' ),
		);

		$visual_type_options = array(
			'image' => WPCB_BASE_URL . 'admin/img/image.png',
			'model' => WPCB_BASE_URL . 'admin/img/model.png'
		);

		$visual_options = apply_filters( 'wpcb_settings_visual_type_options', $visual_type_options );

		$suffix = wpcb_get_i18n_suffix();

		$settings = Container::make( 'theme_options', __( 'Settings', 'wcb-configurator-builder' ) )
			->set_page_parent( 'edit.php?post_type=wpcb_configuration' )
			->set_layout( 'tabbed-vertical' )
			->set_page_file( 'wpcb-settings' );

		$setting_general_fields = array(

			Field::make( 'separator', 'wpcb_general_tab', __( 'General', 'wcb-configurator-builder' ) ),

			Field::make( 'radio_image', 'wpcb_configuration_visual_type', __( 'Visual type', 'wcb-configurator-builder' ) )
				->add_options( $visual_options ),

			Field::make( 'radio_image', 'wpcb_panel_view_type', __( 'Field description panel view', 'wcb-configurator-builder' ) )
				->add_options( array(
					'panel' => WPCB_BASE_URL . 'admin/img/panel.png',
					'popup' => WPCB_BASE_URL . 'admin/img/popup.png',
				)),

			Field::make( 'radio_image', 'wpcb_border_style', __( 'Border style', 'wcb-configurator-builder' ) )
				->add_options( array(
					'rounded' => WPCB_BASE_URL . 'admin/img/border-round.png',
					'square' => WPCB_BASE_URL . 'admin/img/border-square.png',
					'pill' => WPCB_BASE_URL . 'admin/img/border-pill.png',
				)),

			Field::make( 'select', 'wpcb_show_values_inline', __( 'Show values after label', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Choose to show option values behind label or not.', 'wcb-configurator-builder' ) )
				->set_width( 50 )
				->add_options( array(
					'no' => __( 'Hide values after label', 'wcb-configurator-builder' ),
					'yes' => __( 'Show values after label', 'wcb-configurator-builder' ),
				)),

			Field::make( 'select', 'wpcb_swatch_option_style', __( 'Swatch option style', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Choose to show swatches with spacing inside or not.', 'wcb-configurator-builder' ) )
				->set_width( 50 )
				->add_options( array(
					'inside' => __( 'Spacing inside', 'wcb-configurator-builder' ),
					'none' => __( 'No spacing', 'wcb-configurator-builder' ),
				)),

			Field::make( 'select', 'wpcb_checked_option_style', __( 'Checked option style', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Choose to show check icons or not.', 'wcb-configurator-builder' ) )
				->set_width( 50 )
				->add_options( array(
					'border' => __( 'Highlight border', 'wcb-configurator-builder' ),
					'icon' => __( 'Highlight border and show check icon', 'wcb-configurator-builder' ),
				)),

			Field::make( 'select', 'wpcb_lightbox_library', __( 'Default image lightbox', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Choose which lightbox library to use for option image zoom.', 'wcb-configurator-builder' ) )
				->set_width( 50 )
				->add_options( array(
					'plugin' => __( 'Use plugin lightbox', 'wcb-configurator-builder' ),
					'theme' => __( 'Use default theme lightbox', 'wcb-configurator-builder' ),
				)),

			Field::make( 'select', 'wpcb_default_summary_position', __( 'Default options summary position', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Select if the summary should appear above or below options.', 'wcb-configurator-builder' ) )
				->set_width( 50 )
				->add_options( array(
					'below' => __( 'Show below options', 'wcb-configurator-builder' ),
					'above' => __( 'Show above options', 'wcb-configurator-builder' ),
				)),

			Field::make( 'select', 'wpcb_default_note_position', __( 'Default short description position', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Select if the short description should appear above or below options.', 'wcb-configurator-builder' ) )
				->set_width( 50 )
				->add_options( array(
					'below' => __( 'Show below options', 'wcb-configurator-builder' ),
					'above' => __( 'Show above options', 'wcb-configurator-builder' ),
				)),

			Field::make( 'select', 'wpcb_default_description_button_position', __( 'Default description button position', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Select if the description button should appear above or below the options.', 'wcb-configurator-builder' ) )
				->set_width( 50 )
				->add_options( array(
					'above' => __( 'Show above options', 'wcb-configurator-builder' ),
					'below' => __( 'Show below options', 'wcb-configurator-builder' ),
				)),

			Field::make( 'select', 'wpcb_default_description_button_type', __( 'Default description button type', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Select if the description button should appear as icon, text or button.', 'wcb-configurator-builder' ) )
				->set_width( 50 )
				->add_options( array(
					'icon' => __( 'Icon', 'wcb-configurator-builder' ),
					'text' => __( 'Text', 'wcb-configurator-builder' ),
					'text_icon' => __( 'Text icon', 'wcb-configurator-builder' ),
					'button' => __( 'Button', 'wcb-configurator-builder' ),
					'button_icon' => __( 'Button icon', 'wcb-configurator-builder' ),
				)),

			Field::make( 'select', 'wpcb_tab_display', __( 'Form tabs display', 'wcb-configurator-builder' ) )
				->set_width( 50 )
				->set_options( array(
					'horizontal' => __( 'Horizontal', 'wcb-configurator-builder' ),
					'vertical' => __( 'Vertical', 'wcb-configurator-builder' ),
				)),

		);

		$setting_general_fields = apply_filters( 'wpcb_settings_general_tab_fields', $setting_general_fields );

		$settings->add_tab( __( 'General', 'wcb-configurator-builder' ), $setting_general_fields );

		$setting_configuration_fields = array(
			
			Field::make( 'separator', 'wpcb_configuration_tab', __( 'Configuration', 'wcb-configurator-builder' ) ),

			Field::make( 'multiselect', 'wpcb_forbidden_option_labels', __( 'Hidden option labels', 'wcb-configurator-builder' ) )
				->set_options( 'wpcb_get_configurator_fields' )
				->set_help_text( __( 'Optionally select fields that should not be included in checkout, pdf and summary', 'wcb-configurator-builder' ) ),

			Field::make( 'checkbox', 'wpcb_load_default_options', __( 'Make first available options active on load', 'wcb-configurator-builder' ) ),

			Field::make( 'checkbox', 'wpcb_allow_uncheck_options', __( 'Allow customers to uncheck optional form choice options', 'wcb-configurator-builder' ) ),

			Field::make( 'checkbox', 'wpcb_show_loader_indicator', __( 'Show gallery loading indicator on option change', 'wcb-configurator-builder' ) ),

			Field::make( 'checkbox', 'wpcb_collapse_attribute_on_value', __( 'Close collapsible attributes on value select', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Closes the current attribute automatically on attribute value select.', 'wcb-configurator-builder' ) ),

			// Field::make( 'checkbox', 'wpcb_scroll_next_attribute_on_collapse', __( 'Scoll to next attribute on collapse', 'wcb-configurator-builder' ) )
			// 	->set_help_text( __( 'Scrolls to (and opens) next attribute in the form automatically on attribute value select.', 'wcb-configurator-builder' ) ),

			Field::make( 'checkbox', 'wpcb_url_option_disable_click', __( 'Disable click for URL options', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Removes the default click handler for URL options so you can handle the link your own way.', 'wcb-configurator-builder' ) ),

			Field::make( 'checkbox', 'wpcb_url_option_new_tab', __( 'Open URL options in new tab', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Open URL options in a new tab.', 'wcb-configurator-builder' ) ),

			Field::make( 'checkbox', 'wpcb_enable_option_notes', __( 'Enable choice option notes', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Enable notes to include short additional discriptions to lists and cards.', 'wcb-configurator-builder' ) ),

			Field::make( 'checkbox', 'wpcb_enable_option_descriptions', __( 'Enable choice option descriptions', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Enable descriptions to include a detailed description for each choice option.', 'wcb-configurator-builder' ) ),

			Field::make( 'checkbox', 'wpcb_enable_option_summary_inline', __( 'Show configuration options summary table inside configuration form', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Displays choice option summary inline instead of in a separate panel.', 'wcb-configurator-builder' ) ),

		);

		$setting_configuration_fields = apply_filters( 'wpcb_settings_configuration_tab_fields', $setting_configuration_fields );

		$settings->add_tab( __( 'Configuration', 'wcb-configurator-builder' ), $setting_configuration_fields );

		$setting_color_fields = array(
	
			Field::make( 'separator', 'wpcb_colors_tab', __( 'Colors', 'wcb-configurator-builder' ) ),

			Field::make( 'color', 'wpcb_primary_color', __( 'Template background color', 'wcb-configurator-builder' ) )
				->set_default_value('#fff')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_accent_color', __( 'Template accent color', 'wcb-configurator-builder' ) )
				->set_default_value('#F4F5F7')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_gallery_color', __( 'Gallery background color', 'wcb-configurator-builder' ) )
				->set_default_value('#fff')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_template_border_color', __( 'Template border color', 'wcb-configurator-builder' ) )
				->set_default_value('#ccc')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_template_title_color', __( 'Template title color', 'wcb-configurator-builder' ) )
				->set_default_value('#000')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_template_color', __( 'Template text color', 'wcb-configurator-builder' ) )
				->set_default_value('#333')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_template_link_color', __( 'Template link color', 'wcb-configurator-builder' ) )
				->set_default_value('#1456A5')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_template_link_hover_color', __( 'Template link hover color', 'wcb-configurator-builder' ) )
				->set_default_value('#063E81')
				->set_width( 33 ),
			Field::make( 'select', 'wpcb_icon_set', __( 'Icon set', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Choose icon set to use or upload your own icons in the Icons tab.', 'wcb-configurator-builder' ) )
				->set_options( array(
					'dark' => __( 'Dark icons', 'wcb-configurator-builder' ),
					'light' => __( 'Light icons', 'wcb-configurator-builder' ),
				))
				->set_width( 33 ),

			Field::make( 'separator', 'wpcb_configuration_options_colors', __( 'Option colors', 'wcb-configurator-builder' ) ),
			
			Field::make( 'color', 'wpcb_option_background_color', __( 'Option background color', 'wcb-configurator-builder' ) )
				->set_default_value('#fff')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_option_text_color', __( 'Option text color', 'wcb-configurator-builder' ) )
				->set_default_value('#000')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_option_border_color', __( 'Option border color', 'wcb-configurator-builder' ) )
				->set_default_value('#ccc')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_option_hover_background_color', __( 'Option hover background color', 'wcb-configurator-builder' ) )
				->set_default_value('#fff')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_option_hover_text_color', __( 'Option hover text color', 'wcb-configurator-builder' ) )
				->set_default_value('#000')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_option_hover_border_color', __( 'Option hover border color', 'wcb-configurator-builder' ) )
				->set_default_value('#1456A5')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_option_active_background_color', __( 'Option active background color', 'wcb-configurator-builder' ) )
				->set_default_value('#F4F5F7')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_option_active_text_color', __( 'Option active text color', 'wcb-configurator-builder' ) )
				->set_default_value('#000')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_option_active_border_color', __( 'Option active border color', 'wcb-configurator-builder' ) )
				->set_default_value('#1456A5')
				->set_width( 33 ),

			Field::make( 'separator', 'wpcb_configuration_buttons_colors', __( 'Button colors', 'wcb-configurator-builder' ) ),
			
			Field::make( 'color', 'wpcb_button_background_color', __( 'Button background color', 'wcb-configurator-builder' ) )
				->set_default_value('#1456A5')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_button_border_color', __( 'Button border color', 'wcb-configurator-builder' ) )
				->set_default_value('#1456A5')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_button_text_color', __( 'Button text color', 'wcb-configurator-builder' ) )
				->set_default_value('#fff')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_button_hover_background_color', __( 'Button hover background color', 'wcb-configurator-builder' ) )
				->set_default_value('#063E81')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_button_hover_border_color', __( 'Button hover border color', 'wcb-configurator-builder' ) )
				->set_default_value('#063E81')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_button_hover_text_color', __( 'Button hover text color', 'wcb-configurator-builder' ) )
				->set_default_value('#fff')
				->set_width( 33 ),

			Field::make( 'color', 'wpcb_button_alt_background_color', __( 'Button alt background color', 'wcb-configurator-builder' ) )
				->set_default_value('#F4F5F7')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_button_alt_border_color', __( 'Button alt border color', 'wcb-configurator-builder' ) )
				->set_default_value('#F4F5F7')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_button_alt_text_color', __( 'Button alt text color', 'wcb-configurator-builder' ) )
				->set_default_value('#1456A5')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_button_alt_hover_background_color', __( 'Button alt hover background color', 'wcb-configurator-builder' ) )
				->set_default_value('#E3E9F5')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_button_alt_hover_border_color', __( 'Button alt hover border color', 'wcb-configurator-builder' ) )
				->set_default_value('#E3E9F5')
				->set_width( 33 ),
			Field::make( 'color', 'wpcb_button_alt_hover_text_color', __( 'Button alt hover text color', 'wcb-configurator-builder' ) )
				->set_default_value('#1456A5')
				->set_width( 33 ),

		);

		$setting_color_fields = apply_filters( 'wpcb_settings_color_tab_fields', $setting_color_fields );

		$settings->add_tab( __( 'Colors', 'wcb-configurator-builder' ), $setting_color_fields );

		$settings->add_tab( __( 'Fonts', 'wcb-configurator-builder' ), array(

			Field::make( 'separator', 'wpcb_fonts_tab', __( 'Fonts', 'wcb-configurator-builder' ) ),

			Field::make( 'text', 'wpcb_title_font_family', __( 'Title font family', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Optionally set font for titles. Enter full font family: "Open Sans", sans-serif', 'wcb-configurator-builder' ) )
				->set_width( 66 ),
			Field::make( 'text', 'wpcb_title_font_weight', __( 'Title font weight', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Enter CSS units (e.g. bold or 700)', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'select', 'wpcb_title_font_style', __( 'Title font style', 'wcb-configurator-builder' ) )
				->set_width( 33 )
				->set_options( array(
					'normal' => __( 'Normal', 'wcb-configurator-builder' ),
					'italic' => __( 'Italic', 'wcb-configurator-builder' ),
				)),
			Field::make( 'text', 'wpcb_title_font_size', __( 'Title font size', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Enter CSS units (e.g. 12px)', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_title_font_size_mobile', __( 'Title font size mobile', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Enter CSS units (e.g. 12px)', 'wcb-configurator-builder' ) )
				->set_width( 33 ),

			Field::make( 'text', 'wpcb_text_font_family', __( 'Text font family', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Optionally set font for texts. Enter full font family: "Open Sans", sans-serif', 'wcb-configurator-builder' ) )
				->set_width( 66 ),
			Field::make( 'text', 'wpcb_text_font_weight', __( 'Text font weight', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Enter CSS units, like bold or 700', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'select', 'wpcb_text_font_style', __( 'Text font style', 'wcb-configurator-builder' ) )
				->set_width( 33 )
				->set_options( array(
					'normal' => __( 'Normal', 'wcb-configurator-builder' ),
					'italic' => __( 'Italic', 'wcb-configurator-builder' ),
				)),
			Field::make( 'text', 'wpcb_text_font_size', __( 'Text font size', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Enter CSS units', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_text_font_size_mobile', __( 'Text font size mobile', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Enter CSS units', 'wcb-configurator-builder' ) )
				->set_width( 33 ),

			Field::make( 'text', 'wpcb_note_font_family', __( 'Note font family', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Optionally set font for buttons. Enter full font family: "Open Sans", sans-serif', 'wcb-configurator-builder' ) )
				->set_width( 66 ),
			Field::make( 'text', 'wpcb_note_font_weight', __( 'Note font weight', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Enter CSS units, like bold or 700', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'select', 'wpcb_note_font_style', __( 'Note font style', 'wcb-configurator-builder' ) )
				->set_width( 33 )
				->set_options( array(
					'normal' => __( 'Normal', 'wcb-configurator-builder' ),
					'italic' => __( 'Italic', 'wcb-configurator-builder' ),
				)),
			Field::make( 'text', 'wpcb_note_font_size', __( 'Note font size', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Enter CSS units', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_note_font_size_mobile', __( 'Note font size mobile', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Enter CSS units', 'wcb-configurator-builder' ) )
				->set_width( 33 ),

			Field::make( 'text', 'wpcb_button_font_family', __( 'Button font family', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Optionally set font for buttons. Enter full font family: "Open Sans", sans-serif', 'wcb-configurator-builder' ) )
				->set_width( 66 ),
			Field::make( 'text', 'wpcb_button_font_weight', __( 'Button font weight', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Enter CSS units, like bold or 700', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'select', 'wpcb_button_font_style', __( 'Button font style', 'wcb-configurator-builder' ) )
				->set_width( 33 )
				->set_options( array(
					'normal' => __( 'Normal', 'wcb-configurator-builder' ),
					'italic' => __( 'Italic', 'wcb-configurator-builder' ),
				)),
			Field::make( 'text', 'wpcb_button_font_size', __( 'Button font size', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Enter CSS units', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_button_font_size_mobile', __( 'Button font size mobile', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Enter CSS units', 'wcb-configurator-builder' ) )
				->set_width( 33 ),

		) );

		$setting_icon_fields = array(

			Field::make( 'separator', 'wpcb_icons_tab', __( 'Icons', 'wcb-configurator-builder' ) ),

			Field::make( 'image', 'wpcb_icon_fullscreen', __( 'Fullscreen icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'image', 'wpcb_icon_fullscreen_exit', __( 'Fullscreen exit icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'image', 'wpcb_icon_capture', __( 'Capture image icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),

			Field::make( 'image', 'wpcb_icon_reset', __( 'Reset configuration icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'image', 'wpcb_icon_close', __( 'Close icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'image', 'wpcb_icon_collapse', __( 'Collapse icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),

			Field::make( 'image', 'wpcb_icon_spinner', __( 'Spinner icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'image', 'wpcb_icon_reset_view', __( 'Reset camera view icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'image', 'wpcb_icon_dimensions', __( 'Dimensions icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),

			Field::make( 'image', 'wpcb_icon_chevron', __( 'Select arrow icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'image', 'wpcb_icon_info', __( 'Field info icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'image', 'wpcb_icon_zoom', __( 'Field zoom icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),

			Field::make( 'image', 'wpcb_icon_checkmark', __( 'Checkmark icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'image', 'wpcb_icon_price_summary', __( 'Total price summary icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'image', 'wpcb_icon_view_ar', __( 'View AR icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),

			Field::make( 'image', 'wpcb_icon_qr', __( 'QR code icon', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
		);

		$setting_icon_fields = apply_filters( 'wpcb_setting_icon_tab_fields', $setting_icon_fields );

		$settings->add_tab( __( 'Icons', 'wcb-configurator-builder' ), $setting_icon_fields );

		$setting_label_fields = array(

			Field::make( 'separator', 'wpcb_labels_tab', __( 'Labels', 'wcb-configurator-builder' ) ),

			Field::make( 'text', 'wpcb_configuration_collapsed_empty_message' . $suffix, __( 'Collapsed attribute empty value', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Select a value', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_configuration_summary_empty_message' . $suffix, __( 'Summary empty text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Your selected options will show up here', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_description_button_label' . $suffix, __( 'Description button text', 'wcb-configurator-builder' ) )
				->set_width( 33 ),

			Field::make( 'text', 'wpcb_summary_panel_label' . $suffix, __( 'Summary panel label', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Your configuration', 'wcb-configurator-builder' ) )
				->set_width( 50 ),
			Field::make( 'text', 'wpcb_request_quote_panel_label' . $suffix, __( 'Request quote panel label', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Request a quote', 'wcb-configurator-builder' ) )
				->set_width( 50 ),

			Field::make( 'text', 'wpcb_price_summary_text' . $suffix, __( 'Price total prefix', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( '', 'wcb-configurator-builder' ) )
				->set_width( 50 ),
			Field::make( 'text', 'wpcb_price_product_total_text' . $suffix, __( 'Price product total text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Product price', 'wcb-configurator-builder' ) )
				->set_width( 50 ),
			Field::make( 'text', 'wpcb_price_option_total_text' . $suffix, __( 'Price option total text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Option price', 'wcb-configurator-builder' ) )
				->set_width( 50 ),
			Field::make( 'text', 'wpcb_price_tax_total_text' . $suffix, __( 'Price tax total text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'VAT', 'wcb-configurator-builder' ) )
				->set_width( 50 ),
			Field::make( 'text', 'wpcb_price_subtotal_text' . $suffix, __( 'Price subtotal text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Subtotal price', 'wcb-configurator-builder' ) )
				->set_width( 50 ),
			Field::make( 'text', 'wpcb_price_total_text' . $suffix, __( 'Price grand total text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Total price', 'wcb-configurator-builder' ) )
				->set_width( 50 ),

			Field::make( 'text', 'wpcb_button_open_popup_text' . $suffix, __( 'Popup button text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Configure', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_button_personalize_text' . $suffix, __( 'Configure button text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Configure', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_button_personalize_tab_text' . $suffix, __( 'Configurator tab text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Configurator', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_button_loop_cart_text' . $suffix, __( 'Loop button text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Configure', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_button_cart_text' . $suffix, __( 'Cart button text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Add to cart', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_button_cart_update_text' . $suffix, __( 'Update cart item button text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Update cart item', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_button_quote_text' . $suffix, __( 'Request a quote button text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Request a quote', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_button_email_text' . $suffix, __( 'Send email button text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Send an email', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_button_pdf_text' . $suffix, __( 'Download PDF button text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Download to PDF', 'wcb-configurator-builder' ) )
				->set_width( 33 ),

			Field::make( 'text', 'wpcb_button_fullscreen_text' . $suffix, __( 'Fullscreen label', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Fullscreen', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_button_capture_text' . $suffix, __( 'Capture image text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Capture image', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_button_reset_view_text' . $suffix, __( 'Reset camera text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Reset camera view', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_button_reset_text' . $suffix, __( 'Reset configuration text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Reset configuration', 'wcb-configurator-builder' ) )
				->set_width( 50 ),
			Field::make( 'text', 'wpcb_button_configuration_text' . $suffix, __( 'View configuration text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'View configuration', 'wcb-configurator-builder' ) )
				->set_width( 50 ),
			Field::make( 'text', 'wpcb_button_dimensions_text' . $suffix, __( 'Toggle dimensions text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Show/hide dimensions', 'wcb-configurator-builder' ) )
				->set_width( 50 ),
			Field::make( 'text', 'wpcb_button_view_ar_text' . $suffix, __( 'View AR button text', 'wcb-configurator-builder' ) )
				->set_width( 50 ),

			Field::make( 'text', 'wpcb_button_instruction_text' . $suffix, __( 'View instruction text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'View instructions', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_instruction_popup_title' . $suffix, __( 'Instruction popup title', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Configuration viewer instructions', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_instruction_popup_intro' . $suffix, __( 'Instruction popup text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Here is a list of instructions:<br>1. Pan to zoom<br>2. Use mouse to zoom<br>3. Drag to rotate', 'wcb-configurator-builder' ) )
				->set_width( 33 ),

			Field::make( 'text', 'wpcb_button_qr_code_text' . $suffix, __( 'View QR code text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'View QR code', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_qr_code_popup_title' . $suffix, __( 'QR code popup title', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Your configuration QR code', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_qr_code_popup_intro' . $suffix, __( 'QR code popup text', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'Please scan the following QR with your mobile phone to view this model in your room.', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
		);

		$setting_label_fields = apply_filters( 'wpcb_settings_label_tab_fields', $setting_label_fields );

		$setting_error_fields = array(
			Field::make( 'separator', 'wpcb_error_labels_tab', __( 'Form messages', 'wcb-configurator-builder' ) ),

			Field::make( 'text', 'wpcb_form_field_required_error' . $suffix, __( 'Required field error message', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'This field is required', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_form_field_length_error' . $suffix, __( 'Invalid length error message', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'This field is required to have character length of min {min} and max {max}', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_form_field_value_error' . $suffix, __( 'Invalid value error message', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', __( 'This field is required to have value of min {min} and max {max}', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
		);

		$setting_error_fields = apply_filters( 'wpcb_settings_label_error_fields', $setting_error_fields );

		array_push( $setting_label_fields, ...$setting_error_fields );

		$settings->add_tab( __( 'Labels', 'wcb-configurator-builder' ), $setting_label_fields );

		$settings->add_tab( __( 'Pricing', 'wcb-configurator-builder' ), array(

			Field::make( 'separator', 'wpcb_pricing_tab', __( 'Pricing', 'wcb-configurator-builder' ) ),

			Field::make( 'select', 'wpcb_price_currency_pos' . $suffix, __( 'Currency symbol position', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Select the position of the currency symbol', 'wcb-configurator-builder' ) )
				->set_width( 33 )
				->add_options( array(
					'left_space' => __( 'Left with a space', 'wcb-configurator-builder' ),
					'left' => __( 'Left', 'wcb-configurator-builder' ),
					'right_space' => __( 'Right with a space', 'wcb-configurator-builder' ),
					'right' => __( 'Right', 'wcb-configurator-builder' ),
				)),
			Field::make( 'text', 'wpcb_price_currency_symbol' . $suffix, __( 'Currency symbol', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Optionally enter your currency symbol', 'wcb-configurator-builder' ) )
				->set_width( 33 ),
			Field::make( 'text', 'wpcb_price_thousand_sep' . $suffix, __( 'Thousand separator', 'wcb-configurator-builder' ) )
				->set_width( 33 )
				->set_attribute( 'placeholder', ',' ),
			Field::make( 'text', 'wpcb_price_decimal_sep' . $suffix, __( 'Decimal separator', 'wcb-configurator-builder' ) )
				->set_width( 33 )
				->set_attribute( 'placeholder', '.' ),
			Field::make( 'text', 'wpcb_price_decimal_number' . $suffix, __( 'Number of decimals', 'wcb-configurator-builder' ) )
				->set_width( 33 )
				->set_attribute( 'placeholder', '2' ),
			Field::make( 'text', 'wpcb_price_suffix' . $suffix, __( 'Price suffix', 'wcb-configurator-builder' ) )
				->set_width( 33 )
				->set_help_text( __( 'Optionally enter something else after price, like: ",-"', 'wcb-configurator-builder' ) ),

			Field::make( 'text', 'wpcb_free_price_label' . $suffix, __( 'Free price label', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Optionally indicate free options with a label (e.g. Included)', 'wcb-configurator-builder' ) ),

			Field::make( 'checkbox', 'wpcb_extra_price_plus_prefix', __( 'Display plus sign for additional costs', 'wcb-configurator-builder' ) ),
			Field::make( 'checkbox', 'wpcb_exclude_product_base_prices', __( 'Exclude base product price in regular price calculations', 'wcb-configurator-builder' ) ),
			Field::make( 'checkbox', 'wpcb_show_price_option_difference', __( 'Only show price difference in options', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Shows difference in price options regarding other options instead of full option price.', 'wcb-configurator-builder' ) ),
			Field::make( 'checkbox', 'wpcb_base_unit_price_on_min_value', __( 'Base unit price on minimum allowed input value', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Charges unit price costs based on input minimum value instead of zero.', 'wcb-configurator-builder' ) ),
			Field::make( 'checkbox', 'wpcb_show_price_discount_labels', __( 'Show sale price discount labels', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Highlight options on sale with a discount label (e.g. -20%).', 'wcb-configurator-builder' ) ),
			Field::make( 'checkbox', 'wpcb_show_prices_logged_in_users', __( 'Show prices for logged in users only', 'wcb-configurator-builder' ) ),
			Field::make( 'checkbox', 'wpcb_show_single_price_total', __( 'Show configuration total price based on single product quantity', 'wcb-configurator-builder' ) ),
			Field::make( 'checkbox', 'wpcb_show_price_totals_breakdown', __( 'Show price totals table breakdown', 'wcb-configurator-builder' ) ),
			Field::make( 'checkbox', 'wpcb_show_price_totals_inline', __( 'Show price totals table inside configuration form', 'wcb-configurator-builder' ) ),
			Field::make( 'checkbox', 'wpcb_show_price_totals_tax_row', __( 'Show tax totals in price totals table', 'wcb-configurator-builder' ) ),
			Field::make( 'checkbox', 'wpcb_show_totals_incl_excl_tax', __( 'Show total prices including and excluding tax', 'wcb-configurator-builder' ) ),

			Field::make( 'text', 'wpcb_product_tax_label' . $suffix, __( 'Price tax label', 'wcb-configurator-builder' ) )
				->set_width( 50 )
				->set_help_text( __( 'Optionally display tax label for total price in configurator totals.', 'wcb-configurator-builder' ) ),
			Field::make( 'text', 'wpcb_product_ex_tax_label' . $suffix, __( 'Price tax label (2)', 'wcb-configurator-builder' ) )
				->set_width( 50 )
				->set_help_text( __( 'Optionally display second tax label for total tax in configurator totals.', 'wcb-configurator-builder' ) )
				->set_conditional_logic( array( array(
					'field' => 'wpcb_show_totals_incl_excl_tax',
					'value' => true
				))),

			Field::make( 'checkbox', 'wpcb_use_woocommerce_multi_currencies', __( 'Use WooCommerce Multicurrency plugin currencies', 'wcb-configurator-builder' ) ),
			Field::make( 'complex', 'wpcb_multi_currencies', __( 'Multi currencies', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Define the exchange rates based on your base currency', 'wcb-configurator-builder' ) )
				->setup_labels( $repeater_labels )
				->add_fields( array(
					Field::make( 'text', 'currency_id', __( 'Currency Identifier', 'wcb-configurator-builder' ) )
						->set_help_text( __( 'Select your unique currency identifier, like USD, CAD, etc', 'wcb-configurator-builder' ) )
						->set_width(33),
					Field::make( 'text', 'exchange_rate', __( 'Exchange Rate', 'wcb-configurator-builder' ) )
						->set_width(33)
						->set_help_text( __( 'Set your unique currency exchange rate', 'wcb-configurator-builder' ) ),
					Field::make( 'select', 'exchange_rounding', __( 'Exchange Rounding', 'wcb-configurator-builder' ) )
						->set_width(33)
						->set_help_text( __( 'Select the rounding precision', 'wcb-configurator-builder' ) )
						->set_options( array(
							'2' => '0.01',
							'1' => '0.10',
							'0.25' => '0.25',
							'0.50' => '0.50',
							'0.00' => '1.00',
							'-1' => '10.00',
							'-2' => '100.00',
							'-3' => '1,000.00',
						))
				))
				->set_conditional_logic( array( array(
					'field' => 'wpcb_use_woocommerce_multi_currencies',
					'value' => false
				))),
		) );

		$discount_fields = array(
			Field::make( 'select', 'choice_id', __( 'Choice', 'wcb-configurator-builder' ) )
				->add_options( 'wpcb_get_configurator_choices' )
				->set_classes( 'cf-select-choice' )
				->set_help_text( __( 'Select choice to apply discount to', 'wcb-configurator-builder' ) )
				->set_width(25),
			Field::make( 'select', 'option_id', __( 'Option', 'wcb-configurator-builder' ) )
				->set_width(25)
				->set_classes( 'cf-select-default-option' )
				->set_help_text( __( 'Leave empty to apply discount to all options', 'wcb-configurator-builder' ) )
				->add_options( 'wpcb_get_configurator_choice_options' ),
			Field::make( 'select', 'discount_type', __( 'Discount type', 'wcb-configurator-builder' ) )
				->set_width(25)
				->set_help_text( __( 'Select the discount type', 'wcb-configurator-builder' ) )
				->set_options( array(
					'fixed' => __( 'Fixed', 'wcb-configurator-builder' ),
					'percentage' => __( 'Percentage', 'wcb-configurator-builder' ),
				)),
			Field::make( 'text', 'discount', __( 'Discount', 'wcb-configurator-builder' ) )
				->set_width(25)
				->set_help_text( __( 'Set your discount value', 'wcb-configurator-builder' ) ),
		);

		$discount_fields = apply_filters( 'wpcb_settings_discount_fields', $discount_fields );

		$settings->add_tab( __( 'Promotions', 'wcb-configurator-builder' ), array(
			Field::make( 'separator', 'wpcb_promotions_tab', __( 'Promotions', 'wcb-configurator-builder' ) ),

			Field::make( 'complex', 'wpcb_discounts', __( 'Promotions', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Run store-wide promotions', 'wcb-configurator-builder' ) )
				->set_classes( 'cf-discount-rules' )
				->setup_labels( $discount_labels )
				->add_fields( $discount_fields )
		));

		$setting_checkout_fields = array(
			Field::make( 'separator', 'wpcb_checkout_tab', __( 'Checkout', 'wcb-configurator-builder' ) ),

			Field::make( 'checkbox', 'wpcb_cart_enable_dynamic_pricing', __( 'Enable dynamic pricing for cart items', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Dynamically calculate pricings for cart items instead of saving calculated price to cart item.', 'wcb-configurator-builder' ) ),

			Field::make( 'checkbox', 'wpcb_cart_show_option_prices', __( 'Display configuration option prices in cart', 'wcb-addon-inventory' ) ),

			Field::make( 'checkbox', 'wpcb_checkout_show_image', __( 'Display configurator image preview in checkout', 'wcb-configurator-builder' ) ),

			Field::make( 'text', 'wpcb_checkout_image_width', __( 'Image width in checkout', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Defaults to 100 (value in px)', 'wcb-configurator-builder' ) )
				->set_width( 50 ),
			Field::make( 'text', 'wpcb_checkout_image_height', __( 'Image height in checkout', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Defaults to 100 (value in px)', 'wcb-configurator-builder' ) )
				->set_width( 50 ),

			Field::make( 'checkbox', 'wpcb_checkout_order_show_image', __( 'Display configurator image preview in orders', 'wcb-configurator-builder' ) ),
			Field::make( 'checkbox', 'wpcb_checkout_email_show_image', __( 'Display configurator image preview in emails', 'wcb-configurator-builder' ) ),

		);

		$setting_checkout_fields = apply_filters( 'wpcb_settings_checkout_tab_fields', $setting_checkout_fields );

		$settings->add_tab( __( 'Checkout', 'wcb-configurator-builder' ), $setting_checkout_fields );

		$settings = apply_filters( 'wpcb_settings_fields', $settings );

		$setting_email_fields = array(
			Field::make( 'separator', 'wpcb_mail_tab', __( 'Emails', 'wcb-configurator-builder' ) ),

			Field::make( 'text', 'wpcb_mail_recipient' . $suffix, __( 'Email recipient', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Sends all configuration emails and notifications to the given email address. Defaults to admin email address.', 'wcb-configurator-builder' ) ),
				
			Field::make( 'text', 'wpcb_mail_contact_subject' . $suffix, __( 'Contact email subject', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Default subject of email to store owner that is composed when customer clicks the button "Send email"', 'wcb-configurator-builder' ) ),
		);

		$setting_email_fields = apply_filters( 'wpcb_settings_email_tab_fields', $setting_email_fields );

		$settings->add_tab( __( 'Emails', 'wcb-configurator-builder' ), $setting_email_fields );

		$setting_advanced_fields = array(

			Field::make( 'separator', 'wpcb_advanced_tab', __( 'Advanced', 'wcb-configurator-builder' ) ),

			Field::make( 'multiselect', 'wpcb_access_roles', __( 'User role access', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Choose the roles who can access WCB', 'wcb-configurator-builder' ) )
				->set_options( 'wpcb_get_roles' ),

			Field::make( 'radio', 'wpcb_translation_type', __( 'Translation settings', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Set to string translation if you don\'t want to duplicate all options over and over again', 'wcb-configurator-builder' ) )
				->set_options( array(
					'posts' => __( 'Post translation', 'wcb-configurator-builder' ),
					'strings' => __( 'String translation', 'wcb-configurator-builder' ),
				)),

			Field::make( 'select', 'wpcb_post_type_order', __( 'Post types order', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Choose to order post types by name or date', 'wcb-configurator-builder' ) )
				->set_options( array(
					'date_desc' => __( 'Order by date descending', 'wcb-configurator-builder' ),
					'date_asc' => __( 'Order by date ascending', 'wcb-configurator-builder' ),
					'title_asc' => __( 'Order by post title ascending', 'wcb-configurator-builder' ),
					'title_desc' => __( 'Order by post title descending', 'wcb-configurator-builder' ),
				)),

			Field::make( 'text', 'wpcb_image_export_width', __( 'Image export width', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Optionally set a fixed visual image export width (in pixels). Defaults to canvas width.', 'wcb-configurator-builder' ) )
				->set_width( 50 ),
			Field::make( 'select', 'wpcb_image_export_type', __( 'Image export file type', 'wcb-configurator-builder' ) )
				->set_options( array(
					'png' => 'PNG image',
					'jpg' => 'JPG image'
				))
				->set_help_text( __( 'Optionally change the visual image export type', 'wcb-configurator-builder' ) )
				->set_width( 50 ),

			Field::make( 'text', 'wpcb_garbage_collector_days', __( 'Garbage collector', 'wcb-configurator-builder' ) )
				->set_help_text( __( 'Clean up generated configuration files after X amount of days to save server disk space.', 'wcb-configurator-builder' ) )
				->set_attribute( 'placeholder', '30' ),

		);

		$setting_advanced_fields = apply_filters( 'wpcb_settings_advanced_tab_fields', $setting_advanced_fields );

		$settings->add_tab( __( 'Advanced', 'wcb-configurator-builder' ), $setting_advanced_fields );

		$settings->add_tab( __( 'Custom CSS', 'wcb-configurator-builder' ), array(

			Field::make( 'separator', 'wpcb_custom_css_tab', __( 'Custom CSS', 'wcb-configurator-builder' ) ),

			Field::make( 'header_scripts', 'wpcb_header_scripts', __( 'Custom Scripts', 'wcb-configurator-builder' ) )
				->set_rows( 10 )
				->set_classes( 'cf-custom-script-input' )
				->set_help_text( __( 'If you need to add custom scripts (like Google Fonts), you should enter them here.', 'wcb-configurator-builder' ) ),

			Field::make( 'textarea', 'wpcb_custom_css', __( 'Custom CSS', 'wcb-configurator-builder' ) )
				->set_rows( 20 )
				->set_classes( 'cf-custom-script-input' )
				->set_help_text( __( 'If you need to add custom styling, you should enter the CSS here.', 'wcb-configurator-builder' ) ),

		) );

	}
}
