<?php
/**
 * @package     productive-forms
 * @author      productiveminds.com
 * @copyright   productiveminds.com
 */


// Start:: Content
$this->start_controls_section(
    'section_content_layout',
    [
        'label' => esc_html__( 'Layout', 'productive-forms' ),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
    ]
);

$this->add_control(
    'google_map_address',
    [
        'label' => esc_html__( 'Map Address', 'productive-forms' ),
        'label_block' => true,
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => esc_html__( '1 Westminster Road, London, London, WC1 1AA', 'productive-forms' ),
        'dynamic' => [
            'active' => true,
        ],
    ]
);

$pass_addons_dev_g_map_api_key = '';
if( strpos( home_url(), PRODUCTIVE_FORMS_PLUGIN_DEVELOPER_NAME) !== false ) {
    $pass_addons_dev_g_map_api_key = 'AIzaSyAMeoGFRxOQ_pyv9uIvvNOo5SbNiVHnL-E';
}
$this->add_control(
    'google_map_api_key',
    [
        'label' => esc_html__( 'Your Google Maps API Key', 'productive-forms' ),
        'description' => esc_html__( "Don't have Google Maps API Key? ", 'productive-forms' ) . '<a target="_blank" href="https://console.cloud.google.com/projectselector2/google/maps-apis/credentials">Get API Key here</a>',
        'label_block' => true,
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => esc_html($pass_addons_dev_g_map_api_key),
        'ai' => [
            'active' => true,
        ],
    ]
);

$this->add_control(
    'google_map_container_width',
    [
        'label' => esc_html__( 'Width (%)', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::NUMBER,
        'default' => 100,
        'min' => 10,
        'max' => 100,
    ]
);

$this->add_control(
    'google_map_container_height',
    [
        'label' => esc_html__( 'Height (px)', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::NUMBER,
        'default' => 800,
        'min' => 100,
        'max' => 3000,
    ]
);

$this->add_control(
    'google_map_map_magnification',
    [
        'label' => esc_html__( 'Map Zoom', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::NUMBER,
        'default' => 16,
        'min' => 2,
        'max' => 50,
	'frontend_available' => true,
    ]
);

// Widget Container
$this->add_control(
    'section_style_each_widget_box_hr',
    [
        'type' => \Elementor\Controls_Manager::DIVIDER,
    ]
);
$this->add_control(
    'section_style_each_widget_box_hr_label',
    [
        'label' => esc_html__( 'Widget Container', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::RAW_HTML,
    ]
);

$this->add_responsive_control(
    'section_style_layout_width_content_box',
    [
        'label' => esc_html__( 'Width', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'px', '%' ],
        'range' => [
            'px' => [
                'min' => 100,
                'max' => 32000,
                'step' => 10,
            ],
            '%' => [
                'min' => 10,
                'max' => 100,
                'step' => 1,
            ],
        ],
        'default' => [
            'unit' => '%',
            'size' => 100,
        ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section .productiveminds_section_uno' => 'width: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'section_style_layout_max_width_content_box',
    [
        'label' => esc_html__( 'Max Width (px)', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'px' ],
        'range' => [
            'px' => [
                'min' => 100,
                'max' => 3000,
                'step' => 10,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section .productiveminds_section_uno' => 'max-width: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'section_content_layout_align_box',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Container Justification', 'productive-forms' ),
        'options' => [
        ] + productive_global_get_horizontal_css_align_options(),
        'default' => 'center',
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section' => 'justify-content: {{VALUE}}; justify-items: {{VALUE}}',
        ],
    ]
);

$this->end_controls_section();
// End:: Content




/**
 * 
 * Start:: Styles
 * 
 */
$this->start_controls_section(
    'section_style_layout',
    [
        'label' => esc_html__( 'Layout', 'productive-forms' ),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    ]
);


$this->add_responsive_control(
    'section_style_map_container_padding',
    [
        'label' => esc_html__( 'Padding', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => [ 'rem', 'px', '%' ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section.google-map .contact-map-box' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_control(
    'section_style_map_container_border_radius',
    [
        'label' => esc_html__( 'Border Radius', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => [ '%', 'px' ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section.google-map .contact-map-box-field' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'section_style_map_container_border',
        'selector' => '{{WRAPPER}} .productiveminds_section.google-map .contact-map-box-field',
    ]
);

// End:: Content Title

$this->end_controls_section();
// End:: Styles