<?php
namespace EcafeAddons\Widgets;

use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Typography;
use Elementor\Group_Control_Border;
use Elementor\Core\Schemes\Typography;
use Elementor\Group_Control_Background;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Text_Shadow;

use EcafeAddons\EcafeElementLoad;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class Ecafe_Post_Comment extends Widget_Base {

	public function get_name() {
		return 'ecafe-post-comment';
	}

	public function get_title() {
		return esc_html__( 'Post Comment', 'essential-classy-addons-for-elementor' );
	}

	public function get_icon() {
		return 'ecafe-ele-back-icon ecafe-post-comment-icon';
	}

	public function get_categories() {
		return array( 'essential' );
	}

	public function get_keywords() {
		return array( 'post', 'comment', 'post comment' );
	}

	public function get_custom_help_url() {
		return 'https://store.kapasias.com/helpdesk/';
	}

	public function has_widget_inner_wrapper(): bool {
		return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
	}

	protected function register_controls() {

		$this->start_controls_section(
			'contentSection',
			array(
				'label' => esc_html__( 'Post Comment', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_CONTENT,
			)
		);
		$this->add_control(
			'titleReply',
			array(
				'type'    => Controls_Manager::TEXT,
				'label'   => esc_html__( 'Heading Title', 'essential-classy-addons-for-elementor' ),
				'default' => esc_html__( 'Leave Your Comment', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'commentPlacerholder',
			array(
				'type'    => Controls_Manager::TEXT,
				'label'   => esc_html__( 'Comment Placerholder', 'essential-classy-addons-for-elementor' ),
				'default' => esc_html__( 'Comment', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'commentBeforeText',
			array(
				'type'  => Controls_Manager::TEXT,
				'label' => esc_html__( 'Comment Before Text', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'commentAfterText',
			array(
				'type'  => Controls_Manager::TEXT,
				'label' => esc_html__( 'Comment After Text', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'labelSubmit',
			array(
				'type'    => Controls_Manager::TEXT,
				'label'   => esc_html__( 'Button Text', 'essential-classy-addons-for-elementor' ),
				'default' => esc_html__( 'Submit', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'titleReplyTo',
			array(
				'type'    => Controls_Manager::TEXT,
				'label'   => esc_html__( 'Leave Reply Text', 'essential-classy-addons-for-elementor' ),
				'default' => esc_html__( 'Leave A Reply To', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'CancelReplyText',
			array(
				'type'    => Controls_Manager::TEXT,
				'label'   => esc_html__( 'Cancel Reply Text', 'essential-classy-addons-for-elementor' ),
				'default' => esc_html__( 'Cancel Reply', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'commentCount',
			array(
				'label'     => esc_html__( 'Comment Count', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::SWITCHER,
				'default'   => 'yes',
				'label_on'  => esc_html__( 'Enable', 'essential-classy-addons-for-elementor' ),
				'label_off' => esc_html__( 'Disable', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'commentText',
			array(
				'type'    => Controls_Manager::TEXT,
				'label'   => esc_html__( 'Comment Text', 'essential-classy-addons-for-elementor' ),
				'default' => esc_html__( 'Comment', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->end_controls_section();

		/*Notice panel*/
		$ecwidgetdoclink = esc_url( 'https://ecaddons.com/docs/post-comment-blog-builder-tutorial/' );
		include ECAFE_PATH . 'element/widgets/ecafe-widgetpanel-help.php';

		/*heading start*/
		$this->start_controls_section(
			'headingStyling',
			array(
				'label' => esc_html__( 'Heading', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'headingTypo',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-reply-title',
			)
		);
		$this->add_control(
			'headingColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-reply-title' => 'color: {{VALUE}};',
				),
			)
		);
		$this->end_controls_section();
		/*heading end*/

		/*comment section start*/
		$this->start_controls_section(
			'commentSectionStyling',
			array(
				'label' => esc_html__( 'Comment Section', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_control(
			'cHeadingHeading',
			array(
				'label' => esc_html__( 'Count Heading', 'essential-classy-addons-for-elementor' ),
				'type'  => Controls_Manager::HEADING,
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'cHeadingTypo',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-section-title',
			)
		);
		$this->add_control(
			'cHeadingColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-section-title' => 'color: {{VALUE}};',
				),
			)
		);

		$this->add_control(
			'avatarHeading',
			array(
				'label'     => esc_html__( 'Avatar', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_responsive_control(
			'avatarMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-list .comment-author img' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'avatarSize',
			array(
				'label'      => esc_html__( 'Size', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px', '%' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 200,
					),
					'%'  => array(
						'min'  => 1,
						'max'  => 100,
						'step' => 1,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-list .comment-author img' => 'width:{{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->start_controls_tabs( 'tabsAvatarStyle' );
		$this->start_controls_tab(
			'tabAvatarN',
			array(
				'label' => esc_html__( 'Normal', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'avatarBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list .comment-author img',
			)
		);
		$this->add_responsive_control(
			'avatarBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-list .comment-author img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'avatarShadow',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list .comment-author img',
			)
		);
		$this->end_controls_tab();
		$this->start_controls_tab(
			'tabAvatarHover',
			array(
				'label' => esc_html__( 'Hover', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'avatarBorderH',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list li:hover .comment-author img',
			)
		);
		$this->add_responsive_control(
			'avatarBrH',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-list li:hover .comment-author img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'avatarShadowH',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list li:hover .comment-author img',
			)
		);
		$this->end_controls_tab();
		$this->end_controls_tabs();

		$this->add_control(
			'usernameHeading',
			array(
				'label'     => esc_html__( 'Username', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'usernameTypo',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list li .comment-author a',
			)
		);
		$this->add_control(
			'usernameColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-list li .comment-author a' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_control(
			'usernameColorH',
			array(
				'label'     => esc_html__( 'Hover Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-list li:hover .comment-author a' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'usernameatTypo',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list li .comment-author .says',
			)
		);
		$this->add_control(
			'usernameatColor',
			array(
				'label'     => esc_html__( 'After Text Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-list li .comment-author .says' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_control(
			'usernameatatColorH',
			array(
				'label'     => esc_html__( 'After Text Hover Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-list li:hover .comment-author .says' => 'color: {{VALUE}};',
				),
			)
		);

		$this->add_control(
			'metaHeading',
			array(
				'label'     => esc_html__( 'Meta', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_responsive_control(
			'metaPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment div#comments .comment-list li article.comment-body' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'metaTypo',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list li .comment-metadata a',
			)
		);
		$this->add_control(
			'metaColor',
			array(
				'label'     => esc_html__( 'Meta Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-list li .comment-metadata a' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_control(
			'metaColorH',
			array(
				'label'     => esc_html__( 'Meta Hover Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-list li:hover .comment-metadata a' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_control(
			'metaEColor',
			array(
				'label'     => esc_html__( 'Edit Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-list li .comment-metadata .edit-link .comment-edit-link' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_control(
			'metaEColorH',
			array(
				'label'     => esc_html__( 'Edit Hover Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-list li:hover .comment-metadata .edit-link .comment-edit-link' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_control(
			'messageHeading',
			array(
				'label'     => esc_html__( 'Message', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'messageTypo',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list li .comment-content',
			)
		);
		$this->add_control(
			'messageColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-list li .comment-content' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_control(
			'messageColorH',
			array(
				'label'     => esc_html__( 'Hover Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-list li:hover .comment-content' => 'color: {{VALUE}};',
				),
			)
		);

		$this->add_control(
			'cseprateHeading',
			array(
				'label'     => esc_html__( 'Gap Options', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_responsive_control(
			'csepMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-list li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'csepBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment div#comments .comment-list li article.comment-body',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'csepBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment div#comments .comment-list li article.comment-body',
			)
		);
		$this->add_responsive_control(
			'csepBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment div#comments .comment-list li article.comment-body' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'csepShadow',
				'selector' => '{{WRAPPER}} .ec-post-comment div#comments .comment-list li article.comment-body',
			)
		);

		$this->add_control(
			'csboxHeading',
			array(
				'label'     => esc_html__( 'Box', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_responsive_control(
			'csboxPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment #comments.comments-area .comment-list' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'csboxMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment #comments.comments-area .comment-list' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'csboxBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment #comments.comments-area .comment-list',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'csboxBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment #comments.comments-area .comment-list',
			)
		);
		$this->add_responsive_control(
			'csboxBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment #comments.comments-area .comment-list' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'csboxShadow',
				'selector' => '{{WRAPPER}} .ec-post-comment #comments.comments-area .comment-list',
			)
		);
		$this->end_controls_section();
		/*comment section end*/

		/*reply button start*/
		$this->start_controls_section(
			'replyButtonStyling',
			array(
				'label' => esc_html__( 'Reply Button', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'rbPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-list .reply .comment-reply-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'rbMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-list .reply .comment-reply-link' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'rbTypo',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list .reply .comment-reply-link',
			)
		);
		$this->start_controls_tabs( 'tabsReplyButton' );
		$this->start_controls_tab(
			'rbN',
			array(
				'label' => esc_html__( 'Normal', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'rbColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-list .reply .comment-reply-link' => 'color: {{VALUE}}',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'rbBg',
				'label'    => esc_html__( 'Background', 'essential-classy-addons-for-elementor' ),
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list .reply .comment-reply-link',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'rbBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list .reply .comment-reply-link',
			)
		);
		$this->add_responsive_control(
			'rbBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-list .reply .comment-reply-link' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'rbShadow',
				'label'    => esc_html__( 'Box Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list .reply .comment-reply-link',
			)
		);
		$this->end_controls_tab();
		$this->start_controls_tab(
			'rbH',
			array(
				'label' => esc_html__( 'Hover', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'rbColorH',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-list .reply .comment-reply-link:hover' => 'color: {{VALUE}}',
				),

			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'rbBgH',
				'label'    => esc_html__( 'Background', 'essential-classy-addons-for-elementor' ),
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list .reply .comment-reply-link:hover',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'rbBorderH',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list .reply .comment-reply-link:hover',
			)
		);
		$this->add_responsive_control(
			'rbBrH',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-list .reply .comment-reply-link:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'rbShadowH',
				'label'    => esc_html__( 'Box Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-list .reply .comment-reply-link:hover',
			)
		);
		$this->end_controls_tab();
		$this->end_controls_tabs();
		$this->end_controls_section();
		/*reply button end*/

		/*comment form label start*/
		$this->start_controls_section(
			'commentFormLabelStyling',
			array(
				'label' => esc_html__( 'Comment Form Label', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'cflPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'cflMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'cflTypo',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form label',
			)
		);
		$this->add_control(
			'cflColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form label' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'cflBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form label',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'cflBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form label',
			)
		);
		$this->add_responsive_control(
			'cflBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form label' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'cflShadow',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form label',
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'cflTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form label',
			)
		);
		$this->end_controls_section();
		/*comment form label end*/

		/*comment form input start*/
		$this->start_controls_section(
			'commentFormInputStyling',
			array(
				'label' => esc_html__( 'Comment Form Input', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'cfiPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'cfiTypo',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input',
			)
		);
		$this->add_control(
			'cfiPColor',
			array(
				'label'     => esc_html__( 'Placeholder Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input::placeholder' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_control(
			'cfiRColor',
			array(
				'label'     => esc_html__( 'Required Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form label .required' => 'color: {{VALUE}};',
				),
			)
		);
		$this->start_controls_tabs( 'tabsCfistyle' );
		$this->start_controls_tab(
			'tabCfiN',
			array(
				'label' => esc_html__( 'Normal', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'cfiColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'cfiBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'cfiBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input',
			)
		);
		$this->add_responsive_control(
			'cfiBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'cfiShadow',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input',
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'cfiTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input',
			)
		);
		$this->end_controls_tab();
		$this->start_controls_tab(
			'tabCfiFocus',
			array(
				'label' => esc_html__( 'Focus', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'cfiColorF',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input:focus' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'cfiBgF',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input:focus',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'cfiBorderF',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input:focus',
			)
		);
		$this->add_responsive_control(
			'cfiBrF',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input:focus' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'cfiShadowF',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input:focus',
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'cfiTextShadowF',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form input:focus',
			)
		);
		$this->end_controls_tab();
		$this->end_controls_tabs();
		$this->end_controls_section();
		/*comment form input end*/

		/*comment form textarea start*/
		$this->start_controls_section(
			'commentFormTextareaStyling',
			array(
				'label' => esc_html__( 'Comment Form Textarea', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'cftaPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'cftaHeight',
			array(
				'label'      => esc_html__( 'Height', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px', '%' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 500,
					),
					'%'  => array(
						'min'  => 1,
						'max'  => 100,
						'step' => 1,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea' => 'height:{{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'cftaTypo',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea',
			)
		);
		$this->add_control(
			'cftaPColor',
			array(
				'label'     => esc_html__( 'Placeholder Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea::placeholder' => 'color: {{VALUE}};',
				),
			)
		);
		$this->start_controls_tabs( 'tabsCftaStyle' );
		$this->start_controls_tab(
			'tabCftaN',
			array(
				'label' => esc_html__( 'Normal', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'cftaColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'cftaBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'cftaBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea',
			)
		);
		$this->add_responsive_control(
			'cftaBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'cftaShadow',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea',
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'cftaTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea',
			)
		);
		$this->end_controls_tab();
		$this->start_controls_tab(
			'tabCftaF',
			array(
				'label' => esc_html__( 'Focus', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'cftaColorF',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea:focus' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'cftaBgF',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea:focus',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'cftaBorderF',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea:focus',
			)
		);
		$this->add_responsive_control(
			'cftaBrF',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea:focus' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'cftaShadowF',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea:focus',
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'cftaTextShadowF',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form textarea:focus',
			)
		);
		$this->end_controls_tab();
		$this->end_controls_tabs();

		$this->add_control(
			'cftabaHeading',
			array(
				'label'     => esc_html__( 'Before After Text', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'cftabaTypo',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form .ec-comment-before-after',
			)
		);
		$this->add_control(
			'cftabaColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form .ec-comment-before-after' => 'color: {{VALUE}};',
				),
			)
		);
		$this->end_controls_section();
		/*comment form textarea end*/

		/*comment form cookies consent start*/
		$this->start_controls_section(
			'commentFormCookiesStyling',
			array(
				'label' => esc_html__( 'Comment Form Cookies Consent', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_control(
			'cfcLabelHeading',
			array(
				'label' => esc_html__( 'Label', 'essential-classy-addons-for-elementor' ),
				'type'  => Controls_Manager::HEADING,
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'cfcLTypo',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form .comment-form-cookies-consent label',
			)
		);
		$this->add_control(
			'cfcLColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form .comment-form-cookies-consent label' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'cfcLBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form .comment-form-cookies-consent label',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'cfcLBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form .comment-form-cookies-consent label',
			)
		);
		$this->add_responsive_control(
			'cfcLBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond .comment-form .comment-form-cookies-consent label' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'cfcLShadow',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form .comment-form-cookies-consent label',
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'cfcLTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond .comment-form .comment-form-cookies-consent label',
			)
		);
		$this->add_control(
			'cfcCheckboxHeading',
			array(
				'label'     => esc_html__( 'Checkbox', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->start_controls_tabs( 'tabsCfcCBStyle' );
		$this->start_controls_tab(
			'tabCfcCBN',
			array(
				'label' => esc_html__( 'Checked', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'cfcbIColor',
			array(
				'label'     => esc_html__( 'Check Icon Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-form-cookies-consent input[type=checkbox]:checked:before' => 'border-color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'cfcbBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-form-cookies-consent input[type=checkbox]:checked',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'cfcbBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-form-cookies-consent input[type=checkbox]:checked',
			)
		);
		$this->add_responsive_control(
			'cfcbBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-form-cookies-consent input[type=checkbox]:checked' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'cfcbShadow',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-form-cookies-consent input[type=checkbox]:checked',
			)
		);
		$this->end_controls_tab();
		$this->start_controls_tab(
			'tabCfcbUN',
			array(
				'label' => esc_html__( 'Unchecked', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'cfcbColorU',
			array(
				'label'     => esc_html__( 'Unheck Icon Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .comment-form-cookies-consent input[type=checkbox]:before' => 'border-color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'cfcbBgU',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-form-cookies-consent input[type=checkbox]',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'cfcbBorderU',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-form-cookies-consent input[type=checkbox]',
			)
		);
		$this->add_responsive_control(
			'cfcbBrU',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-form-cookies-consent input[type=checkbox]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'cfcbShadowU',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-form-cookies-consent input[type=checkbox]',
			)
		);
		$this->end_controls_tab();
		$this->end_controls_tabs();
		$this->end_controls_section();
		/*comment form cookies consent end*/

		/*comment form box start*/
		$this->start_controls_section(
			'commentFormBoxStyling',
			array(
				'label' => esc_html__( 'Comment Form Box', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'cfBoxPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'cfBoxMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->start_controls_tabs( 'tabscfBoxStyle' );
		$this->start_controls_tab(
			'tabcfBoxNorm',
			array(
				'label' => esc_html__( 'Normal', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'cfBoxBgN',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'cfBoxBorderN',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond',
			)
		);
		$this->add_responsive_control(
			'cfBoxBrN',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'cfBoxShadowN',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond',
			)
		);
		$this->end_controls_tab();
		$this->start_controls_tab(
			'tabcfBoxHover',
			array(
				'label' => esc_html__( 'Hover', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'cfBoxBgH',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond:hover',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'cfBoxBorderH',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond:hover',
			)
		);
		$this->add_responsive_control(
			'cfBoxBrH',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .comment-respond:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'cfBoxShadowH',
				'selector' => '{{WRAPPER}} .ec-post-comment .comment-respond:hover',
			)
		);
		$this->end_controls_tab();
		$this->end_controls_tabs();
		$this->end_controls_section();
		/*comment form box end*/

		/*submit button start*/
		$this->start_controls_section(
			'submitButtonStyling',
			array(
				'label' => esc_html__( 'Submit Button', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'sbPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .form-submit input.submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'sbMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .form-submit input.submit' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'sbTypo',
				'selector' => '{{WRAPPER}} .ec-post-comment .form-submit input.submit',
			)
		);
		$this->start_controls_tabs( 'tabsSubmitButton' );
		$this->start_controls_tab(
			'sbN',
			array(
				'label' => esc_html__( 'Normal', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'sbColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .form-submit input.submit' => 'color: {{VALUE}}',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'sbBg',
				'label'    => esc_html__( 'Background', 'essential-classy-addons-for-elementor' ),
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .form-submit input.submit',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'sbBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .form-submit input.submit',
			)
		);
		$this->add_responsive_control(
			'sbBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .form-submit input.submit' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'sbShadow',
				'label'    => esc_html__( 'Box Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .form-submit input.submit',
			)
		);
		$this->end_controls_tab();
		$this->start_controls_tab(
			'sbH',
			array(
				'label' => esc_html__( 'Hover', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'sbColorH',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-comment .form-submit input.submit:hover' => 'color: {{VALUE}}',
				),

			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'sbBgH',
				'label'    => esc_html__( 'Background', 'essential-classy-addons-for-elementor' ),
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .form-submit input.submit:hover',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'sbBorderH',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .form-submit input.submit:hover',
			)
		);
		$this->add_responsive_control(
			'sbBrH',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment .form-submit input.submit:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'sbShadowH',
				'label'    => esc_html__( 'Box Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment .form-submit input.submit:hover',
			)
		);
		$this->end_controls_tab();
		$this->end_controls_tabs();
		$this->end_controls_section();
		/*submit button end*/

		/*box start*/
		$this->start_controls_section(
			'commentBoxStyling',
			array(
				'label' => esc_html__( 'Box', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'cBoxPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'cBoxbg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-comment',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'cBoxBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-comment',
			)
		);
		$this->add_responsive_control(
			'cBoxBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-comment' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'cBoxShadow',
				'selector' => '{{WRAPPER}} .ec-post-comment',
			)
		);
		$this->end_controls_section();
		/*box end*/
	}

	protected function render() {
		$settings            = $this->get_settings_for_display();
		$titleReply          = ! empty( $settings['titleReply'] ) ? $settings['titleReply'] : '';
		$commentPlacerholder = ! empty( $settings['commentPlacerholder'] ) ? $settings['commentPlacerholder'] : '';
		$commentBeforeText   = ! empty( $settings['commentBeforeText'] ) ? $settings['commentBeforeText'] : '';
		$commentAfterText    = ! empty( $settings['commentAfterText'] ) ? $settings['commentAfterText'] : '';
		$labelSubmit         = ! empty( $settings['labelSubmit'] ) ? $settings['labelSubmit'] : '';
		$titleReplyTo        = ! empty( $settings['titleReplyTo'] ) ? $settings['titleReplyTo'] : '';
		$CancelReplyText     = ! empty( $settings['CancelReplyText'] ) ? $settings['CancelReplyText'] : '';

		$user     = wp_get_current_user();
		$userName = $user->exists() ? $user->display_name : '';

		$commentArgs = array(
			'comment_notes_before' => '<span class="ec-comment-before ec-comment-before-after">' . esc_html( $commentBeforeText ) . '</span>',
			'id_form'              => 'commentform',
			'class_form'           => 'comment-form',
			'id_submit'            => 'submit',
			'title_reply'          => esc_html( $titleReply ),
			// translators: %s is a placeholder for additional text
			'title_reply_to'       => esc_html( $titleReplyTo ) . esc_html__( ' %s', 'essential-classy-addons-for-elementor' ),
			'cancel_reply_link'    => esc_html( $CancelReplyText ),
			'label_submit'         => esc_html( $labelSubmit ),
			'comment_field'        => '<div class="ec-comment-textarea"><textarea id="comment" name="comment" cols="45" rows="6" placeholder="' . esc_attr( $commentPlacerholder ) . '" aria-required="true"></textarea></div>',
			// translators: This message is shown to users when they must log in to post a comment. It contains HTML links for logging in.
			'must_log_in'          => '<p class="must-log-in">' . sprintf( esc_html__( 'You must be %1$slogged in%2$s to post a comment.', 'essential-classy-addons-for-elementor' ), '<a href="' . wp_login_url( apply_filters( 'the_permalink', get_permalink() ) ) . '">', '</a>' ) . '</p>',
			// translators: This message is shown to users who are logged in. It contains their username and options to log out.
			'logged_in_as'         => '<p class="logged-in-as">' . sprintf( esc_html__( 'Logged in as %1$s%2$s. %3$sLog out?%4$s', 'essential-classy-addons-for-elementor' ), '<a href="' . admin_url( 'profile.php' ) . '">' . $userName, '</a>', '<a href="' . wp_logout_url( apply_filters( 'the_permalink', get_permalink() ) ) . '" title="' . esc_attr__( 'Log out of this account', 'essential-classy-addons-for-elementor' ) . '">', '</a>' ) . '</p>',
			'comment_notes_after'  => '<span class="ec-comment-after ec-comment-before-after">' . esc_html( $commentAfterText ) . '</span>',
		);

		$comment  = get_comments( get_queried_object() );
		$listArgs = array(
			'style'       => 'ul',
			'avatar_size' => 40,
			'short_ping'  => true,
			'page'        => get_queried_object_id(),
		);

		$commentCount = ! empty( $settings['commentCount'] ) ? $settings['commentCount'] : '';
		$count        = 0;
		if ( ! empty( $commentCount ) && $commentCount == 'yes' ) {
			$count = get_comments_number( get_queried_object_id() );
		}

		ob_start();
			echo '<div class="ec-post-comment">';
				echo '<div id="comments" class="comments-area">';
		if ( get_comments_number( get_queried_object_id() ) > 0 ) {
			echo '<ul class="comment-list">';
			echo '<li>';
			$commentText = ! empty( $settings['commentText'] ) ? $settings['commentText'] : '';
			if ( ! empty( $count ) && ! empty( $commentCount ) && $commentCount == 'yes' ) {
							echo '<div class="comment-section-title">' . esc_attr( $commentText ) . ' (' . $count . ')</div>';
			} else {
									echo '<div class="comment-section-title">' . esc_attr( $commentText ) . '</div>';
			}
									echo '</li>';
									wp_list_comments( $listArgs, $comment );
									echo '</ul>';
		}
					comment_form( $commentArgs, get_queried_object_id() );
				echo '</div>';
			echo '</div>';
		$output = ob_get_clean();

		echo wp_kses_normalize_entities( $output );
	}
}
