<?php

namespace ElementPack\Modules\Member\Widgets;

use ElementPack\Base\Module_Base;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Typography;
use Elementor\Group_Control_Image_Size;
use Elementor\Group_Control_Background;
use Elementor\Repeater;
use Elementor\Icons_Manager;

use ElementPack\Modules\Member\Skins;
use ElementPack\Traits\Global_Mask_Controls;

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

class Member extends Module_Base {

	use Global_Mask_Controls;

	public function get_name() {
		return 'bdt-member';
	}

	public function get_title() {
		return BDTEP . esc_html__( 'Member', 'bdthemes-element-pack' );
	}

	public function get_icon() {
		return 'bdt-wi-member';
	}

	public function get_categories() {
		return [ 'element-pack' ];
	}

	public function get_keywords() {
		return [ 'member', 'team', 'experts' ];
	}

	public function get_style_depends(): array {
		return $this->ep_is_edit_mode() ? [ 'ep-styles' ] : [ 'ep-member' ];
	}

	public function get_custom_help_url() {
		return 'https://youtu.be/m8_KOHzssPA';
	}

	protected function register_skins() {
		$this->add_skin( new Skins\Skin_Band( $this ) );
		$this->add_skin( new Skins\Skin_Calm( $this ) );
		$this->add_skin( new Skins\Skin_Ekip( $this ) );
		$this->add_skin( new Skins\Skin_Phaedra( $this ) );
		$this->add_skin( new Skins\Skin_Partait( $this ) );
		$this->add_skin( new Skins\Skin_Flip( $this ) );
	}

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

	protected function register_controls() {
		$this->start_controls_section(
			'section_content_layout',
			[ 
				'label' => esc_html__( 'Layout', 'bdthemes-element-pack' ),
			]
		);

		$this->add_control(
			'photo',
			[ 
				'label'   => esc_html__( 'Choose Photo', 'bdthemes-element-pack' ),
				'type'    => Controls_Manager::MEDIA,
				'dynamic' => [ 'active' => true ],
				'default' => [ 
					'url' => BDTEP_ASSETS_URL . 'images/member.svg',
				],
			]
		);

		$this->add_control(
			'member_alternative_photo',
			[ 
				'label' => esc_html__( 'Alternative Photo', 'bdthemes-element-pack' ),
				'type'  => Controls_Manager::SWITCHER,
			]
		);

		$this->add_control(
			'alternative_photo',
			[ 
				'label'     => esc_html__( 'Choose Photo', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::MEDIA,
				'dynamic'   => [ 'active' => true ],
				'default'   => [ 
					'url' => BDTEP_ASSETS_URL . 'images/member.svg',
				],
				'condition' => [ 
					'member_alternative_photo' => 'yes',
				],
			]
		);

		$this->add_control(
			'image_mask_popover',
			[ 
				'label'        => esc_html__( 'Image Mask', 'bdthemes-element-pack' ),
				'type'         => Controls_Manager::POPOVER_TOGGLE,
				'render_type'  => 'template',
				'return_value' => 'yes',
			]
		);

		//Global Image Mask Controls
		$this->register_image_mask_controls();

		$this->add_control(
			'name',
			[ 
				'label'       => esc_html__( 'Name', 'bdthemes-element-pack' ),
				'type'        => Controls_Manager::TEXT,
				'default'     => esc_html__( 'John Doe', 'bdthemes-element-pack' ),
				'placeholder' => esc_html__( 'Member Name', 'bdthemes-element-pack' ),
				'dynamic'     => [ 'active' => true ],
			]
		);

		$this->add_control(
			'role',
			[ 
				'label'       => esc_html__( 'Role', 'bdthemes-element-pack' ),
				'type'        => Controls_Manager::TEXT,
				'default'     => esc_html__( 'Managing Director', 'bdthemes-element-pack' ),
				'placeholder' => esc_html__( 'Member Role', 'bdthemes-element-pack' ),
				'dynamic'     => [ 'active' => true ],
			]
		);

		$this->add_control(
			'description_text',
			[ 
				'label'       => esc_html__( 'Description', 'bdthemes-element-pack' ),
				'type'        => Controls_Manager::TEXTAREA,
				'default'     => esc_html__( 'Type here some info about this team member, the man very important person of our company.', 'bdthemes-element-pack' ),
				'placeholder' => esc_html__( 'Member Description', 'bdthemes-element-pack' ),
				'rows'        => 10,
				'condition'   => [ '_skin' => [ '', 'bdt-partait', 'bdt-band', 'bdt-flip' ] ],
				'dynamic'     => [ 'active' => true ],
			]
		);

		$this->add_control(
			'member_social_icon',
			[ 
				'label'   => esc_html__( 'Social Icon', 'bdthemes-element-pack' ),
				'type'    => Controls_Manager::SWITCHER,
				'default' => 'yes',
			]
		);

		$this->add_responsive_control(
			'skin_partait_align',
			[ 
				'label'     => esc_html__( 'Alignment', 'bdthemes-element-pack' ) . BDTEP_NC,
				'type'      => Controls_Manager::CHOOSE,
				'options'   => [ 
					'left'    => [ 
						'title' => esc_html__( 'Left', 'bdthemes-element-pack' ),
						'icon'  => 'eicon-text-align-left',
					],
					'center'  => [ 
						'title' => esc_html__( 'Center', 'bdthemes-element-pack' ),
						'icon'  => 'eicon-text-align-center',
					],
					'right'   => [ 
						'title' => esc_html__( 'Right', 'bdthemes-element-pack' ),
						'icon'  => 'eicon-text-align-right',
					],
					'justify' => [ 
						'title' => esc_html__( 'Justified', 'bdthemes-element-pack' ),
						'icon'  => 'eicon-text-align-justify',
					],
				],
				'selectors' => [ 
					'{{WRAPPER}} .skin-partait .bdt-member-desc-wrapper' => 'text-align: {{VALUE}} !important;',
				],
				'condition' => [ 
					'_skin' => 'bdt-partait'
				]
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_content_social_link',
			[ 
				'label'     => esc_html__( 'Social Icon', 'bdthemes-element-pack' ),
				'condition' => [ 'member_social_icon' => 'yes' ],
			]
		);

		$repeater = new Repeater();

		$repeater->add_control(
			'social_link_title',
			[ 
				'label'   => esc_html__( 'Title', 'bdthemes-element-pack' ),
				'type'    => Controls_Manager::TEXT,
				'dynamic' => ['active' => true],
				'default' => 'Facebook',
			]
		);

		/**
		 * TODO: It should be removed after v8.0 release
		 */
        $repeater->add_control(
            'social_link',
            [ 
                'label'   => __( 'Link', 'bdthemes-element-pack' ),
                'type'    => Controls_Manager::HIDDEN,
            ]
        );
        $repeater->add_control(
            'social_icon_link',
            [ 
                'label'   => __( 'Link', 'bdthemes-element-pack' ),
                'type'    => Controls_Manager::URL,
            ]
        );

		$repeater->add_control(
			'social_share_icon',
			[ 
				'label'            => esc_html__( 'Choose Icon', 'bdthemes-element-pack' ),
				'type'             => Controls_Manager::ICONS,
				'fa4compatibility' => 'social_icon',
			]
		);

		$repeater->add_control(
			'icon_background',
			[ 
				'label'     => esc_html__( 'Icon Background', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-icons {{CURRENT_ITEM}}' => 'background-color: {{VALUE}}',
				],
				'condition' => [ 
					'_skin!' => 'bdt-band',
				],
			]
		);

		$repeater->add_control(
			'icon_color',
			[ 
				'label'     => esc_html__( 'Icon Color', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-icons {{CURRENT_ITEM}}'     => 'color: {{VALUE}}',
					'{{WRAPPER}} .bdt-member .bdt-member-icons {{CURRENT_ITEM}} svg' => 'fill: {{VALUE}}',
				],
				'condition' => [ 
					'_skin!' => 'bdt-band',
				],
			]
		);

		$this->add_control(
			'social_link_list',
			[ 
				'type'        => Controls_Manager::REPEATER,
				'fields'      => $repeater->get_controls(),
				'default'     => [ 
					[ 
						'social_icon_link'       => [ 'url' => 'http://www.facebook.com/sigmative/' ],
						'social_share_icon'       => [ 
							'value'   => 'fab fa-facebook-f',
							'library' => 'fa-brands',
						],
						'social_link_title' => __( 'Facebook', 'bdthemes-element-pack' ),
					],
					[ 
						'social_icon_link'       => [ 'url' => 'http://www.x.com/bdthemescom/' ],
						'social_share_icon'       => [ 
							'value'   => 'fab fa-x-twitter',
							'library' => 'fa-brands',
						],
						'social_link_title' => __( 'X', 'bdthemes-element-pack' ),
					],
					[ 
						'social_icon_link'       => [ 'url' => 'http://www.instagram.com/sigmative/' ],
						'social_share_icon'       => [ 
							'value'   => 'fab fa-instagram',
							'library' => 'fa-brands',
						],
						'social_link_title' => __( 'Instagram', 'bdthemes-element-pack' ),
					],
				],
				'title_field' => '{{{ social_link_title }}}',
			]
		);

		$this->end_controls_section();

		//style
		$this->start_controls_section(
			'section_style',
			[ 
				'label'     => esc_html__( 'Member', 'bdthemes-element-pack' ),
				'tab'       => Controls_Manager::TAB_STYLE,
				'condition' => [ 
					'_skin' => [ '', 'bdt-band', 'bdt-partait' ],
				],
			]
		);

		$this->add_control(
			'band_overlay_color',
			[ 
				'label'     => __( 'Overlay Color', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .skin-band .bdt-member-photo:before' => 'background: {{VALUE}};',
				],
				'condition' => [ 
					'_skin' => [ 'bdt-band' ],
				],
			]
		);
		$this->add_control(
			'band_item_background_color',
			[ 
				'label'     => __( 'Background Color', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .skin-band .bdt-member-item-wrapper' => 'background: {{VALUE}};',
				],
				'condition' => [ 
					'_skin' => [ 'bdt-band' ],
				],
			]
		);

		$this->add_group_control(
			Group_Control_Background::get_type(),
			[ 
				'name'     => 'member_bg_color',
				'selector' => '{{WRAPPER}} .bdt-member',
				'condition' => [ 
					'_skin!' => 'bdt-band',
				],
			]
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			[ 
				'name'     => 'member_border',
				'selector' => '{{WRAPPER}} .bdt-member',
				'separator' => 'before',
			]
		);
		$this->add_responsive_control(
			'member_border_radius',
			[ 
				'label'      => esc_html__( 'Border Radius', 'bdthemes-element-pack' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', '%' ],
				'selectors'  => [ 
					'{{WRAPPER}} .bdt-member' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
			]
		);
		$this->add_responsive_control(
			'member_padding',
			[ 
				'label'      => esc_html__( 'Padding', 'bdthemes-element-pack' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', 'em', '%' ],
				'selectors'  => [ 
					'{{WRAPPER}} .bdt-member' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
			]
		);

		$this->add_control(
			'desc_padding',
			[ 
				'label'      => esc_html__( 'Content Padding', 'bdthemes-element-pack' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', 'em', '%' ],
				'selectors'  => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
			]
		);

		$this->add_responsive_control(
			'text_align',
			[ 
				'label'     => esc_html__( 'Text Alignment', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::CHOOSE,
				'options'   => [ 
					'left'    => [ 
						'title' => esc_html__( 'Left', 'bdthemes-element-pack' ),
						'icon'  => 'eicon-text-align-left',
					],
					'center'  => [ 
						'title' => esc_html__( 'Center', 'bdthemes-element-pack' ),
						'icon'  => 'eicon-text-align-center',
					],
					'right'   => [ 
						'title' => esc_html__( 'Right', 'bdthemes-element-pack' ),
						'icon'  => 'eicon-text-align-right',
					],
					'justify' => [ 
						'title' => esc_html__( 'Justified', 'bdthemes-element-pack' ),
						'icon'  => 'eicon-text-align-justify',
					],
				],
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member' => 'text-align: {{VALUE}};',
				],
				'separator' => 'before',
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_flip_style',
			[ 
				'label'     => __( 'Flip Style', 'bdthemes-element-pack' ),
				'tab'       => Controls_Manager::TAB_STYLE,
				'condition' => [ 
					'_skin' => 'bdt-flip',
				],
			]
		);

		$this->add_control(
			'back_background_color',
			[ 
				'label'     => __( 'Back Background Color', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-skin-flip-back' => 'background-color: {{VALUE}};',
				],
				'condition' => [ 
					'member_alternative_photo' => '',
				],
			]
		);

		$this->add_responsive_control(
			'skin_flip_height',
			[ 
				'label'      => __( 'Height', 'bdthemes-element-pack' ),
				'type'       => Controls_Manager::SLIDER,
				'range'      => [ 
					'px' => [ 
						'min' => 100,
						'max' => 1000,
					],
					'vh' => [ 
						'min' => 10,
						'max' => 100,
					],
				],
				'size_units' => [ 'px', 'vh' ],
				'selectors'  => [ 
					'{{WRAPPER}} .skin-flip' => 'height: {{SIZE}}{{UNIT}};',
				],
			]
		);

		$this->add_responsive_control(
			'flip_border_radius',
			[ 
				'label'      => __( 'Border Radius', 'bdthemes-element-pack' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => [ 'px', '%' ],
				'range'      => [ 
					'px' => [ 
						'min' => 0,
						'max' => 200,
					],
				],
				'selectors'  => [ 
					'{{WRAPPER}} .bdt-skin-flip-layer, {{WRAPPER}} .bdt-skin-flip-layer-overlay' => 'border-radius: {{SIZE}}{{UNIT}}',
				],
			]
		);

		$this->add_responsive_control(
			'flip_desc_padding',
			[ 
				'label'      => esc_html__( 'Padding', 'bdthemes-element-pack' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', 'em', '%' ],
				'selectors'  => [ 
					'{{WRAPPER}} .bdt-skin-flip-layer-overlay' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
			]
		);

		$this->add_responsive_control(
			'flip_text_align',
			[ 
				'label'     => esc_html__( 'Text Alignment', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::CHOOSE,
				'options'   => [ 
					'left'    => [ 
						'title' => esc_html__( 'Left', 'bdthemes-element-pack' ),
						'icon'  => 'eicon-text-align-left',
					],
					'center'  => [ 
						'title' => esc_html__( 'Center', 'bdthemes-element-pack' ),
						'icon'  => 'eicon-text-align-center',
					],
					'right'   => [ 
						'title' => esc_html__( 'Right', 'bdthemes-element-pack' ),
						'icon'  => 'eicon-text-align-right',
					],
					'justify' => [ 
						'title' => esc_html__( 'Justified', 'bdthemes-element-pack' ),
						'icon'  => 'eicon-text-align-justify',
					],
				],
				'selectors' => [ 
					'{{WRAPPER}} .skin-flip .bdt-member-content' => 'text-align: {{VALUE}};',
				],
			]
		);

		$this->add_group_control(
			Group_Control_Image_Size::get_type(),
			[ 
				'name'         => 'thumbnail_size',
				'label'        => esc_html__( 'Image Size', 'bdthemes-element-pack' ),
				'exclude'      => [ 'custom' ],
				'default'      => 'full',
				'prefix_class' => 'bdt-member--thumbnail-size-',
			]
		);

		$this->add_control(
			'flip_effect',
			[ 
				'label'        => __( 'Flip Effect', 'bdthemes-element-pack' ),
				'type'         => Controls_Manager::SELECT,
				'default'      => 'flip',
				'options'      => [ 
					'flip'  => __( 'Flip', 'bdthemes-element-pack' ),
					'slide' => __( 'Slide', 'bdthemes-element-pack' ),
					'push'  => __( 'Push', 'bdthemes-element-pack' ),
				],
				'prefix_class' => 'bdt-skin-flip-effect-',
			]
		);

		$this->add_control(
			'flip_direction',
			[ 
				'label'        => __( 'Flip Direction', 'bdthemes-element-pack' ),
				'type'         => Controls_Manager::SELECT,
				'default'      => 'left',
				'options'      => [ 
					'left'  => __( 'Left', 'bdthemes-element-pack' ),
					'right' => __( 'Right', 'bdthemes-element-pack' ),
					'up'    => __( 'Up', 'bdthemes-element-pack' ),
					'down'  => __( 'Down', 'bdthemes-element-pack' ),
				],
				'prefix_class' => 'bdt-skin-flip-direction-',
			]
		);

		$this->add_control(
			'flip_3d',
			[ 
				'label'        => __( '3D Depth', 'bdthemes-element-pack' ),
				'type'         => Controls_Manager::SWITCHER,
				'default'      => 'yes',
				'prefix_class' => 'bdt-skin-flip-3d-',
				'condition'    => [ 
					'flip_effect' => 'flip',
				],
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_style_photo',
			[ 
				'label'     => esc_html__( 'Photo', 'bdthemes-element-pack' ),
				'tab'       => Controls_Manager::TAB_STYLE,
				'condition' => [ 
					'_skin!' => 'bdt-flip',
				],
			]
		);

		$this->start_controls_tabs( 'tabs_photo_style' );

		$this->start_controls_tab(
			'tab_photo_normal',
			[ 
				'label' => esc_html__( 'Normal', 'bdthemes-element-pack' ),
			]
		);

		$this->add_control(
			'photo_background',
			[ 
				'label'     => esc_html__( 'Background', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-photo' => 'background-color: {{VALUE}};',
				],
			]
		);

		$this->add_group_control(
			Group_Control_Border::get_type(),
			[ 
				'name'        => 'photo_border',
				'label'       => esc_html__( 'Border', 'bdthemes-element-pack' ),
				'placeholder' => '1px',
				'default'     => '1px',
				'selector'    => '{{WRAPPER}} .bdt-member .bdt-member-photo',
				'separator'   => 'before',
			]
		);

		$this->add_control(
			'photo_border_radius',
			[ 
				'label'      => esc_html__( 'Border Radius', 'bdthemes-element-pack' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', '%' ],
				'selectors'  => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-photo' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
				],
			]
		);

		$this->add_control(
			'photo_opacity',
			[ 
				'label'     => esc_html__( 'Opacity (%)', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::SLIDER,
				'default'   => [ 
					'size' => 1,
				],
				'range'     => [ 
					'px' => [ 
						'max'  => 1,
						'min'  => 0.10,
						'step' => 0.01,
					],
				],
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-photo img' => 'opacity: {{SIZE}};',
				],
			]
		);

		$this->add_control(
			'photo_spacing',
			[ 
				'label'     => esc_html__( 'Spacing', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::SLIDER,
				'range'     => [ 
					'px' => [ 
						'max' => 100,
					],
				],
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-photo' => 'margin-bottom: {{SIZE}}{{UNIT}}',
				],
				'condition' => [ 
					'_skin!' => [ 'bdt-band' ],
				],
			]
		);

		$this->end_controls_tab();

		$this->start_controls_tab(
			'tab_photo_hover',
			[ 
				'label' => esc_html__( 'Hover', 'bdthemes-element-pack' ),
			]
		);

		$this->add_control(
			'photo_hover_border_color',
			[ 
				'label'     => esc_html__( 'Border Color', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'condition' => [ 
					'border_border!' => '',
				],
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-photo:hover' => 'border-color: {{VALUE}};',
				],
			]
		);

		$this->add_control(
			'photo_hover_opacity',
			[ 
				'label'     => esc_html__( 'Opacity (%)', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::SLIDER,
				'default'   => [ 
					'size' => 1,
				],
				'range'     => [ 
					'px' => [ 
						'max'  => 1,
						'min'  => 0.10,
						'step' => 0.01,
					],
				],
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-photo:hover img' => 'opacity: {{SIZE}};',
				],
			]
		);

		$this->add_control(
			'photo_hover_animation',
			[ 
				'label'   => esc_html__( 'Animation', 'bdthemes-element-pack' ),
				'type'    => Controls_Manager::SELECT,
				'default' => '',
				'options' => [ 
					''     => 'None',
					'up'   => 'Scale Up',
					'down' => 'Scale Down',
				],
			]
		);

		$this->end_controls_tab();

		$this->end_controls_tabs();

		$this->end_controls_section();

		$this->start_controls_section(
			'section_style_name',
			[ 
				'label' => esc_html__( 'Name', 'bdthemes-element-pack' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			]
		);

		$this->add_control(
			'name_color',
			[ 
				'label'     => esc_html__( 'Color', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-name' => 'color: {{VALUE}};',
				],
			]
		);

		$this->add_group_control(
			Group_Control_Typography::get_type(),
			[ 
				'name'     => 'name_typography',
				'selector' => '{{WRAPPER}} .bdt-member .bdt-member-name',
			]
		);

		$this->add_responsive_control(
			'name_bottom_space',
			[ 
				'label'     => esc_html__( 'Spacing', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::SLIDER,
				'range'     => [ 
					'px' => [ 
						'min' => 0,
						'max' => 100,
					],
				],
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member-name' => 'margin-bottom: {{SIZE}}{{UNIT}};',
				],
				'condition' => [ 
					'_skin!' => 'bdt-ekip',
				],
			]
		);

		$this->add_responsive_control(
			'ekip_name_bottom_space',
			[ 
				'label'      => esc_html__( 'Spacing', 'bdthemes-element-pack' ),
				'type'       => Controls_Manager::SLIDER,
				'default'    => [ 
					'unit' => '%',
				],
				'size_units' => [ '%' ],
				'range'      => [ 
					'%' => [ 
						'min' => 0,
						'max' => 100,
					],
				],
				'selectors'  => [ 
					'{{WRAPPER}} .skin-ekip:hover .bdt-member-name' => 'top: {{SIZE}}{{UNIT}};',
				],
				'condition'  => [ 
					'_skin' => 'bdt-ekip',
				],
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_style_role',
			[ 
				'label' => esc_html__( 'Role', 'bdthemes-element-pack' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			]
		);

		$this->add_control(
			'role_color',
			[ 
				'label'     => esc_html__( 'Color', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-role' => 'color: {{VALUE}};',
				],
			]
		);

		$this->add_responsive_control(
			'role_bottom_space',
			[ 
				'label'     => esc_html__( 'Spacing', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::SLIDER,
				'range'     => [ 
					'px' => [ 
						'min' => 0,
						'max' => 100,
					],
				],
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-role' => 'margin-bottom: {{SIZE}}{{UNIT}};',
				],
				'condition' => [ 
					'_skin!' => 'bdt-ekip',
				],
			]
		);

		$this->add_responsive_control(
			'ekip_role_bottom_space',
			[ 
				'label'      => esc_html__( 'Spacing', 'bdthemes-element-pack' ),
				'type'       => Controls_Manager::SLIDER,
				'default'    => [ 
					'unit' => '%',
				],
				'size_units' => [ '%' ],
				'range'      => [ 
					'%' => [ 
						'min' => 0,
						'max' => 100,
					],
				],
				'selectors'  => [ 
					'{{WRAPPER}} .skin-ekip:hover .bdt-member-role' => 'top: {{SIZE}}{{UNIT}};',
				],
				'condition'  => [ 
					'_skin' => 'bdt-ekip',
				],
			]
		);

		$this->add_group_control(
			Group_Control_Typography::get_type(),
			[ 
				'name'     => 'role_typography',
				'selector' => '{{WRAPPER}} .bdt-member .bdt-member-role',
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_style_text',
			[ 
				'label'     => esc_html__( 'Text', 'bdthemes-element-pack' ),
				'tab'       => Controls_Manager::TAB_STYLE,
				'condition' => [ 
					'_skin' => [ '', 'bdt-band', 'bdt-flip', 'bdt-partait' ],
				],
			]
		);

		$this->add_control(
			'text_color',
			[ 
				'label'     => esc_html__( 'Color', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-text' => 'color: {{VALUE}};',
				],
			]
		);

		$this->add_group_control(
			Group_Control_Typography::get_type(),
			[ 
				'name'     => 'text_typography',
				'selector' => '{{WRAPPER}} .bdt-member .bdt-member-text',
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_style_social_icon',
			[ 
				'label'     => esc_html__( 'Social Icon', 'bdthemes-element-pack' ),
				'tab'       => Controls_Manager::TAB_STYLE,
				'condition' => [ 'member_social_icon' => 'yes' ],
			]
		);

		$this->add_control(
			'icon_content_background',
			[ 
				'label'     => esc_html__( 'Icons Background', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-icons' => 'background-color: {{VALUE}}',
				],
				'condition' => [ 
					'_skin!' => 'bdt-band',
				],
			]
		);

		$this->add_responsive_control(
			'social_icon_content_padding',
			[ 
				'label'      => esc_html__( 'Icons Padding', 'bdthemes-element-pack' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', 'em', '%' ],
				'selectors'  => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-icons' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
				'condition'  => [ 
					'_skin!' => 'bdt-band',
				],
			]
		);

		$this->start_controls_tabs( 'tabs_social_icon_style' );

		$this->start_controls_tab(
			'tab_social_icon_normal',
			[ 
				'label' => esc_html__( 'Normal', 'bdthemes-element-pack' ),
			]
		);

		$this->add_control(
			'icon_background',
			[ 
				'label'     => esc_html__( 'Background', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-icon' => 'background-color: {{VALUE}}',
				],
				'condition' => [ 
					'_skin!' => 'bdt-band',
				],
			]
		);

		$this->add_control(
			'band_icon_background',
			[ 
				'label'     => esc_html__( 'Background', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .skin-band .bdt-member-icons .bdt-member-icon:before' => 'background: {{VALUE}}',
				],
				'condition' => [ 
					'_skin' => 'bdt-band',
				],
			]
		);

		$this->add_control(
			'icon_color',
			[ 
				'label'     => esc_html__( 'Color', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-icon i'   => 'color: {{VALUE}};',
					'{{WRAPPER}} .bdt-member .bdt-member-icon svg' => 'fill: {{VALUE}};',
				],
			]
		);

		$this->add_control(
			'social_icons_top_border_color',
			[ 
				'label'     => esc_html__( 'Top Border Color', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-icons' => 'border-top-color: {{VALUE}}',
				],
				'condition' => [ 
					'_skin!' => 'bdt-band',
				],
			]
		);

		$this->add_group_control(
			Group_Control_Border::get_type(),
			[ 
				'name'        => 'social_icon_border',
				'label'       => esc_html__( 'Border', 'bdthemes-element-pack' ),
				'placeholder' => '1px',
				'default'     => '1px',
				'selector'    => '{{WRAPPER}} .bdt-member .bdt-member-icon',
				'condition'   => [ 
					'_skin!' => 'bdt-band',
				],
			]
		);

		$this->add_control(
			'social_icon_border_radius',
			[ 
				'label'      => esc_html__( 'Border Radius', 'bdthemes-element-pack' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', '%' ],
				'selectors'  => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
				'condition'  => [ 
					'_skin!' => 'bdt-band',
				],
			]
		);

		$this->add_responsive_control(
			'social_icon_padding',
			[ 
				'label'      => esc_html__( 'Padding', 'bdthemes-element-pack' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', 'em', '%' ],
				'selectors'  => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
				'condition'  => [ 
					'_skin!' => 'bdt-band',
				],
			]
		);

		$this->add_responsive_control(
			'social_icon_size',
			[ 
				'label'     => esc_html__( 'Icon Size', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::SLIDER,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-icon i'        => 'min-width: {{SIZE}}{{UNIT}};',
					'{{WRAPPER}} .bdt-member .bdt-member-icon i:before' => 'font-size: {{SIZE}}{{UNIT}};',
					'{{WRAPPER}} .bdt-member .bdt-member-icon svg'      => 'font-size: {{SIZE}}{{UNIT}};',
				],
				// 'condition' => [
				//     '_skin!' => 'bdt-band',
				// ],
			]
		);
		//icon box size
		$this->add_responsive_control(
			'social_icon_box_size',
			[ 
				'label'     => esc_html__( 'Icon Background Size', 'bdthemes-element-pack' ) . BDTEP_NC,
				'type'      => Controls_Manager::SLIDER,
				'selectors' => [ 
					'{{WRAPPER}} .skin-band .bdt-member-icon:before, {{WRAPPER}} .skin-band .bdt-member-icon' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
				],
				'condition' => [ 
					'_skin' => 'bdt-band',
				],
			]
		);

		$this->add_responsive_control(
			'social_icon_indent',
			[ 
				'label'     => esc_html__( 'Icon Space Between', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::SLIDER,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-icon + .bdt-member-icon' => 'margin-left: {{SIZE}}{{UNIT}};',
				],
			]
		);

		//icon vertical spacing
		$this->add_responsive_control(
			'social_icon_vertical_space',
			[ 
				'label'     => esc_html__( 'Vertical Spacing', 'bdthemes-element-pack' ) . BDTEP_NC,
				'type'      => Controls_Manager::SLIDER,
				'selectors' => [ 
					'{{WRAPPER}} .skin-band .bdt-member-icons' => 'bottom: {{SIZE}}{{UNIT}};',
				],
				'condition' => [ 
					'_skin' => 'bdt-band',
				],
			]
		);

		$this->add_responsive_control(
			'ekip_icon_vertical_space',
			[ 
				'label'      => esc_html__( 'Vertical Spacing', 'bdthemes-element-pack' ),
				'type'       => Controls_Manager::SLIDER,
				'default'    => [ 
					'unit' => '%',
				],
				'size_units' => [ '%' ],
				'range'      => [ 
					'%' => [ 
						'min' => 0,
						'max' => 100,
					],
				],
				'selectors'  => [ 
					'{{WRAPPER}} .skin-ekip:hover .bdt-member-icons' => 'top: {{SIZE}}{{UNIT}};',
				],
				'condition'  => [ 
					'_skin' => 'bdt-ekip',
				],
			]
		);

		$this->add_control(
			'social_icon_tooltip',
			[ 
				'label'   => esc_html__( 'Tooltip', 'bdthemes-element-pack' ),
				'type'    => Controls_Manager::SWITCHER,
				'default' => 'yes',
			]
		);

		$this->end_controls_tab();

		$this->start_controls_tab(
			'tab_social_icon_hover',
			[ 
				'label' => esc_html__( 'Hover', 'bdthemes-element-pack' ),
			]
		);

		$this->add_control(
			'icon_hover_background',
			[ 
				'label'     => esc_html__( 'Background', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-icon:hover' => 'background-color: {{VALUE}}',
				],
				'condition' => [ 
					'_skin!' => 'bdt-band',
				],
			]
		);

		$this->add_control(
			'icon_hover_color',
			[ 
				'label'     => esc_html__( 'Color', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-icon:hover i'   => 'color: {{VALUE}};',
					'{{WRAPPER}} .bdt-member .bdt-member-icon:hover svg' => 'fill: {{VALUE}};',
				],
			]
		);

		$this->add_control(
			'icon_hover_border_color',
			[ 
				'label'     => esc_html__( 'Border Color', 'bdthemes-element-pack' ),
				'type'      => Controls_Manager::COLOR,
				'condition' => [ 
					'social_icon_border_border!' => '',
					'_skin!'                     => 'bdt-band',
				],
				'selectors' => [ 
					'{{WRAPPER}} .bdt-member .bdt-member-icon:hover' => 'border-color: {{VALUE}}',
				],
			]
		);

		$this->end_controls_tab();

		$this->end_controls_tabs();

		$this->end_controls_section();
	}

	/**
	 * Renders social icons. Called from default skin (with $settings) and from other skins (with class string only).
	 *
	 * @param array<string, mixed>|string|null $settings_or_class Settings from render (single call site) or class name when invoked by skins.
	 * @param string                           $class            Extra CSS class when first argument is settings.
	 */
	public function render_social_icons( $settings_or_class = null, string $class = '' ) {
		if ( is_array( $settings_or_class ) ) {
			$settings = $settings_or_class;
		} else {
			$settings = $this->get_settings_for_display();
			$class    = is_string( $settings_or_class ) ? $settings_or_class : '';
		}

		if ( ( isset( $settings['member_social_icon'] ) && $settings['member_social_icon'] !== 'yes' )
			|| empty( $settings['social_link_list'] )
			|| ! is_array( $settings['social_link_list'] ) ) {
			return;
		}

		$this->add_render_attribute( 'social_icons', 'class', 'bdt-member-icons ' . esc_attr( $class ) );
		?>
		<div <?php $this->print_render_attribute_string( 'social_icons' ); ?>>
			<?php
			foreach ( $settings['social_link_list'] as $index => $link ) {
				$link_key = 'link_' . $index;

				$tooltip = '';
				if ( isset( $settings['social_icon_tooltip'] ) && $settings['social_icon_tooltip'] === 'yes' ) {
					$title_raw   = isset( $link['social_link_title'] ) ? $link['social_link_title'] : '';
					$tooltip_raw = wp_kses_post( strip_tags( (string) $title_raw ) );
					$tooltip     = 'title: ' . esc_attr( $tooltip_raw ) . ';';
				}

				$link_id = isset( $link['_id'] ) ? $link['_id'] : '';
				$this->add_render_attribute( $link_key, 'class', 'bdt-member-icon elementor-repeater-item-' . esc_attr( $link_id ) );

				$link_url = isset( $link['social_icon_link']['url'] ) ? $link['social_icon_link']['url'] : '';
				if ( $link_url !== '' ) {
					$this->add_link_attributes( $link_key, $link['social_icon_link'] );
				} else {
					$fallback_url = isset( $link['social_link'] ) ? $link['social_link'] : '#';
					$this->add_render_attribute(
						[ $link_key => [ 'href' => esc_url( $fallback_url ), 'target' => '_blank' ] ],
						'',
						'',
						true
					);
				}

				$migrated = isset( $link['__fa4_migrated']['social_share_icon'] );
				$is_new   = empty( $link['social_icon'] ) && Icons_Manager::is_migration_allowed();
				?>
				<a <?php $this->print_render_attribute_string( $link_key ); ?> data-bdt-tooltip="<?php echo esc_attr( $tooltip ); ?>">
					<?php
					if ( $is_new || $migrated ) {
						Icons_Manager::render_icon( $link['social_share_icon'], [ 'aria-hidden' => 'true', 'class' => 'fa-fw' ] );
					} else {
						echo '<i class="' . esc_attr( $link['social_icon'] ?? '' ) . '" aria-hidden="true"></i>';
					}
					?>
				</a>
				<?php
			}
			?>
		</div>
		<?php
	}

	protected function render() {
		$settings = $this->get_settings_for_display();

		if ( ! isset( $settings['social_icon'] ) && ! Icons_Manager::is_migration_allowed() ) {
			$settings['social_icon'] = 'fab fa-facebook-f';
		}

		$image_mask = ( isset( $settings['image_mask_popover'] ) && $settings['image_mask_popover'] === 'yes' ) ? ' bdt-image-mask' : '';
		$this->add_render_attribute( 'image-wrap', 'class', 'bdt-member-photo-wrapper' . $image_mask );

		$member_name = isset( $settings['name'] ) ? $settings['name'] : '';
		$thumb_size  = isset( $settings['thumbnail_size_size'] ) ? $settings['thumbnail_size_size'] : 'full';
		?>
		<div class="bdt-member skin-default bdt-transition-toggle">
			<?php
			if ( ! empty( $settings['photo']['url'] ) ) {
				$photo_hover_animation = ( isset( $settings['photo_hover_animation'] ) && $settings['photo_hover_animation'] !== '' )
					? ' bdt-transition-scale-' . esc_attr( $settings['photo_hover_animation'] )
					: '';
				$has_alt_photo = ! empty( $settings['member_alternative_photo'] ) && ! empty( $settings['alternative_photo']['url'] );
				?>
				<div <?php $this->print_render_attribute_string( 'image-wrap' ); ?>>
					<?php if ( $has_alt_photo ) : ?>
						<div class="bdt-position-relative bdt-overflow-hidden bdt-position-z-index"
							data-bdt-toggle="target: > .bdt-member-photo-flip; mode: hover; animation: bdt-animation-fade; queued: true; duration: 300;">
							<div class="bdt-member-photo-flip bdt-position-absolute bdt-position-z-index">
								<?php $this->render_member_image( $settings['alternative_photo'], $thumb_size, $member_name, $settings ); ?>
							</div>
						<?php endif; ?>

					<div class="bdt-member-photo">
						<div class="<?php echo esc_attr( $photo_hover_animation ); ?>">
							<?php $this->render_member_image( $settings['photo'], $thumb_size, $member_name, $settings ); ?>
						</div>
					</div>
					<?php if ( $has_alt_photo ) : ?>
						</div>
					<?php endif; ?>
				</div>
			<?php } ?>

			<div class="bdt-member-content">
				<?php if ( $member_name !== '' ) : ?>
					<span class="bdt-member-name"><?php echo wp_kses( $member_name, element_pack_allow_tags( 'title' ) ); ?></span>
				<?php endif; ?>
				<?php if ( ! empty( $settings['role'] ) ) : ?>
					<span class="bdt-member-role"><?php echo wp_kses( $settings['role'], element_pack_allow_tags( 'title' ) ); ?></span>
				<?php endif; ?>
				<?php if ( ! empty( $settings['description_text'] ) ) : ?>
					<div class="bdt-member-text bdt-content-wrap"><?php echo wp_kses( $settings['description_text'], element_pack_allow_tags( 'text' ) ); ?></div>
				<?php endif; ?>
			</div>
			<?php $this->render_social_icons( $settings, '' ); ?>
		</div>
		<?php
	}

	/**
	 * Outputs member photo (img or wp_get_attachment_image). Single place for image logic and escaping.
	 *
	 * @param array<string, mixed> $photo    Media control value (id, url).
	 * @param string               $size     Image size key.
	 * @param string               $alt_text Alt attribute value.
	 * @param array<string, mixed> $settings Widget settings (from render) for image size control.
	 */
	protected function render_member_image( array $photo, string $size, string $alt_text, array $settings ) {
		$id  = isset( $photo['id'] ) ? (int) $photo['id'] : 0;
		$url = isset( $photo['url'] ) ? $photo['url'] : '';
		if ( $url === '' ) {
			return;
		}
		$thumb_url = $id > 0 ? Group_Control_Image_Size::get_attachment_image_src( $id, 'thumbnail_size', $settings ) : null;
		if ( ! $thumb_url ) {
			printf( '<img src="%1$s" alt="%2$s">', esc_url( $url ), esc_attr( $alt_text ) );
			return;
		}
		echo wp_get_attachment_image( $id, $size, false, [ 'alt' => esc_attr( $alt_text ) ] );
	}

	/**
	 * Shared JS template fragment for social icons (Member editor preview).
	 *
	 * @param string $icons_extra_class Extra classes for `.bdt-member-icons` (matches skin render_social_icons() second arg).
	 */
	protected function print_member_social_icons_content_template( string $icons_extra_class = '' ) {
		$class = 'bdt-member-icons' . ( $icons_extra_class !== '' ? ' ' . esc_attr( $icons_extra_class ) : '' );
		?>
			<# if ( settings.member_social_icon === 'yes' && settings.social_link_list && settings.social_link_list.length ) { #>
				<div class="<?php echo esc_attr( $class ); ?>">
					<# _.each( settings.social_link_list, function( link ) {
						var socialIconHTML = elementor.helpers.renderIcon( view, link.social_share_icon, { 'aria-hidden': true, 'class': 'fa-fw' }, 'i', 'object' );
						var migrated = link.__fa4_migrated && link.__fa4_migrated.social_share_icon;
						var linkUrl = ( link.social_icon_link && link.social_icon_link.url ) ? link.social_icon_link.url : '';
						var linkExtra = '';
						if ( linkUrl !== '' ) {
							if ( link.social_icon_link.is_external ) {
								linkExtra += ' target="_blank"';
								var rp = [ 'noopener', 'noreferrer' ];
								if ( link.social_icon_link.nofollow ) {
									rp.push( 'nofollow' );
								}
								linkExtra += ' rel="' + rp.join( ' ' ) + '"';
							} else if ( link.social_icon_link.nofollow ) {
								linkExtra += ' rel="nofollow"';
							}
						} else {
							linkUrl = link.social_link || '#';
							linkExtra = ' target="_blank"';
						}
						var tooltipAttr = '';
						if ( settings.social_icon_tooltip === 'yes' && link.social_link_title ) {
							var tipText = String( link.social_link_title ).replace( /<[^>]+>/g, '' ).replace( /"/g, '&quot;' );
							tooltipAttr = ' data-bdt-tooltip="title: ' + tipText + ';"';
						}
					#>
						<a class="bdt-member-icon elementor-repeater-item-{{ link._id }}" href="<# print( linkUrl ); #>"<# print( linkExtra ); #><# print( tooltipAttr ); #>>
							<# if ( socialIconHTML && socialIconHTML.rendered && ( ! link.social_icon || migrated ) ) { #>
								{{{ socialIconHTML.value }}}
							<# } else if ( link.social_icon ) { #>
								<i class="{{ link.social_icon }}" aria-hidden="true"></i>
							<# } #>
						</a>
					<# } ); #>
				</div>
			<# } #>
		<?php
	}

	protected function content_template() {
		?>
		<#
		var skin = settings._skin || '';
		var hasAltPhoto = settings.member_alternative_photo && settings.alternative_photo && settings.alternative_photo.url;
		var hoverAnimClass = ( settings.photo_hover_animation && settings.photo_hover_animation !== '' ) ? 'bdt-transition-scale-' + settings.photo_hover_animation : '';
		var maskClass = ( settings.image_mask_popover === 'yes' ) ? ' bdt-image-mask' : '';
		#>

		<# if ( skin === 'bdt-band' ) { #>
		<div class="bdt-member skin-band bdt-transition-toggle">
			<div class="bdt-member-item-wrapper">
				<# if ( settings.photo && settings.photo.url ) { #>
				<div class="bdt-member-photo-wrapper<# print( maskClass ); #>">
					<# if ( hasAltPhoto ) { #>
					<div class="bdt-position-relative bdt-overflow-hidden"
						bdt-toggle="target: &gt; .bdt-member-photo-flip; mode: hover; animation: bdt-animation-fade; queued: true; duration: 300;">
						<div class="bdt-member-photo-flip bdt-position-absolute bdt-position-z-index">
							<img src="{{ settings.alternative_photo.url }}" alt="{{ settings.name }}">
						</div>
					<# } #>
					<div class="bdt-member-photo">
						<div class="<# print( hoverAnimClass ); #>">
							<img src="{{ settings.photo.url }}" alt="{{ settings.name }}">
						</div>
					</div>
					<# if ( hasAltPhoto ) { #>
					</div>
					<# } #>
					<?php $this->print_member_social_icons_content_template(); ?>
				</div>
				<# } #>
				<div class="bdt-member-content">
					<# if ( settings.name ) { #><span class="bdt-member-name">{{{ settings.name }}}</span><# } #>
					<# if ( settings.role ) { #><span class="bdt-member-role">{{{ settings.role }}}</span><# } #>
					<# if ( settings.description_text ) { #><div class="bdt-member-text bdt-content-wrap">{{{ settings.description_text }}}</div><# } #>
				</div>
			</div>
		</div>

		<# } else if ( skin === 'bdt-calm' ) { #>
		<div class="bdt-member skin-calm bdt-transition-toggle bdt-inline<# print( maskClass ); #><# if ( hasAltPhoto ) { #> bdt-position-relative bdt-overflow-hidden bdt-transition-toggle<# } #>"<# if ( hasAltPhoto ) { #> bdt-toggle="target: &gt; div &gt; .bdt-member-photo-flip; mode: hover; animation: bdt-animation-fade; queued: true; duration: 300;"<# } #>>
			<# if ( settings.photo && settings.photo.url ) { #>
			<div class="bdt-member-photo-wrapper">
				<# if ( hasAltPhoto ) { #>
				<div class="bdt-member-photo-flip bdt-position-absolute bdt-position-z-index">
					<img src="{{ settings.alternative_photo.url }}" alt="{{ settings.name }}">
				</div>
				<# } #>
				<div class="bdt-member-photo">
					<div class="<# print( hoverAnimClass ); #>">
						<img src="{{ settings.photo.url }}" alt="{{ settings.name }}">
					</div>
				</div>
			</div>
			<# } #>
			<div class="bdt-member-overlay bdt-overlay bdt-position-bottom bdt-text-center bdt-position-z-index">
				<div class="bdt-member-desc">
					<div class="bdt-member-content bdt-transition-slide-bottom-small">
						<# if ( settings.name ) { #><span class="bdt-member-name">{{{ settings.name }}}</span><# } #>
						<# if ( settings.role ) { #><span class="bdt-member-role">{{{ settings.role }}}</span><# } #>
					</div>
					<?php $this->print_member_social_icons_content_template( 'bdt-transition-slide-bottom' ); ?>
				</div>
			</div>
		</div>

		<# } else if ( skin === 'bdt-ekip' ) { #>
		<div class="bdt-member skin-ekip bdt-transition-toggle<# print( maskClass ); #><# if ( hasAltPhoto ) { #> bdt-position-relative bdt-overflow-hidden bdt-transition-toggle<# } #>"<# if ( hasAltPhoto ) { #> bdt-toggle="target: &gt; div &gt; .bdt-member-photo-flip; mode: hover; animation: bdt-animation-fade; queued: true; duration: 300;"<# } #>>
			<# if ( settings.photo && settings.photo.url ) { #>
			<div class="bdt-member-photo-wrapper">
				<# if ( hasAltPhoto ) { #>
				<div class="bdt-member-photo-flip bdt-position-absolute bdt-position-z-index">
					<img src="{{ settings.alternative_photo.url }}" alt="{{ settings.name }}">
				</div>
				<# } #>
				<div class="bdt-member-photo">
					<div class="<# print( hoverAnimClass ); #>">
						<img src="{{ settings.photo.url }}" alt="{{ settings.name }}">
					</div>
				</div>
			</div>
			<# } #>
			<div class="ekip-overlay bdt-position-z-index">
				<div class="bdt-member-desc">
					<div class="bdt-member-content">
						<# if ( settings.role ) { #><span class="bdt-member-role">{{{ settings.role }}}</span><# } #>
						<# if ( settings.name ) { #><span class="bdt-member-name">{{{ settings.name }}}</span><# } #>
					</div>
					<?php $this->print_member_social_icons_content_template(); ?>
				</div>
			</div>
		</div>

		<# } else if ( skin === 'bdt-phaedra' ) { #>
		<div class="bdt-member skin-phaedra bdt-transition-toggle<# print( maskClass ); #><# if ( hasAltPhoto ) { #> bdt-position-relative bdt-overflow-hidden bdt-transition-toggle<# } #>"<# if ( hasAltPhoto ) { #> bdt-toggle="target: &gt; div &gt; .bdt-member-photo-flip; mode: hover; animation: bdt-animation-fade; queued: true; duration: 300;"<# } #>>
			<# if ( settings.photo && settings.photo.url ) { #>
			<div class="bdt-member-photo-wrapper">
				<# if ( hasAltPhoto ) { #>
				<div class="bdt-member-photo-flip bdt-position-absolute bdt-position-z-index">
					<img src="{{ settings.alternative_photo.url }}" alt="{{ settings.name }}">
				</div>
				<# } #>
				<div class="bdt-member-photo">
					<div class="<# print( hoverAnimClass ); #>">
						<img src="{{ settings.photo.url }}" alt="{{ settings.name }}">
					</div>
				</div>
			</div>
			<# } #>
			<div class="bdt-member-overlay bdt-overlay-default bdt-position-cover bdt-transition-fade bdt-position-z-index">
				<div class="bdt-member-desc bdt-position-center bdt-text-center">
					<div class="bdt-member-content bdt-transition-slide-top-small">
						<# if ( settings.name ) { #><span class="bdt-member-name">{{{ settings.name }}}</span><# } #>
						<# if ( settings.role ) { #><span class="bdt-member-role">{{{ settings.role }}}</span><# } #>
					</div>
					<?php $this->print_member_social_icons_content_template( 'bdt-transition-slide-bottom-small' ); ?>
				</div>
			</div>
		</div>

		<# } else if ( skin === 'bdt-partait' ) { #>
		<div class="bdt-member skin-partait">
			<div class="bdt-grid bdt-grid-collapse bdt-child-width-1-2@m" data-bdt-grid>
				<# if ( settings.photo && settings.photo.url ) { #>
				<div class="bdt-member-photo-wrapper<# print( maskClass ); #>">
					<# if ( hasAltPhoto ) { #>
					<div class="bdt-position-relative bdt-overflow-hidden"
						bdt-toggle="target: &gt; .bdt-member-photo-flip; mode: hover; animation: bdt-animation-fade; queued: true; duration: 300;">
						<div class="bdt-member-photo-flip bdt-position-absolute bdt-position-z-index">
							<img src="{{ settings.alternative_photo.url }}" alt="{{ settings.name }}">
						</div>
					<# } #>
					<div class="bdt-member-photo">
						<div class="<# print( hoverAnimClass ); #>">
							<img src="{{ settings.photo.url }}" alt="{{ settings.name }}">
						</div>
					</div>
					<# if ( hasAltPhoto ) { #>
					</div>
					<# } #>
				</div>
				<# } #>
				<div class="bdt-member-desc bdt-position-relative bdt-flex bdt-flex-middle">
					<div class="bdt-text-center bdt-member-desc-wrapper">
						<div class="bdt-member-content">
							<# if ( settings.name ) { #><span class="bdt-member-name">{{{ settings.name }}}</span><# } #>
							<# if ( settings.role ) { #><span class="bdt-member-role">{{{ settings.role }}}</span><# } #>
							<# if ( settings.description_text ) { #><div class="bdt-member-text bdt-content-wrap">{{{ settings.description_text }}}</div><# } #>
						</div>
						<?php $this->print_member_social_icons_content_template(); ?>
					</div>
				</div>
			</div>
		</div>

		<# } else if ( skin === 'bdt-flip' ) { #>
		<div class="bdt-member skin-flip bdt-transition-toggle bdt-inline<# print( maskClass ); #>">
			<# var flipFrontUrl = ( settings.photo && settings.photo.url ) ? settings.photo.url : '';
			var flipBackUrl = ( settings.member_alternative_photo === 'yes' && settings.alternative_photo && settings.alternative_photo.url ) ? settings.alternative_photo.url : '';
			#>
			<div class="bdt-skin-flip-layer bdt-skin-flip-front" style="background-image: url('<# print( flipFrontUrl ); #>');">
				<div class="bdt-skin-flip-layer-overlay">
					<div class="bdt-skin-flip-layer-inner">
						<div class="bdt-member-content bdt-position-bottom-center">
							<# if ( settings.name ) { #><span class="bdt-member-name">{{{ settings.name }}}</span><# } #>
							<# if ( settings.role ) { #><span class="bdt-member-role">{{{ settings.role }}}</span><# } #>
						</div>
					</div>
				</div>
			</div>
			<div class="bdt-skin-flip-layer bdt-skin-flip-back" style="background-image: url('<# print( flipBackUrl ); #>');">
				<div class="bdt-skin-flip-layer-overlay">
					<div class="bdt-skin-flip-layer-inner">
						<?php $this->print_member_social_icons_content_template( 'bdt-position-bottom-center' ); ?>
						<# if ( settings.description_text ) { #>
						<div class="bdt-member-text bdt-position-center">{{{ settings.description_text }}}</div>
						<# } #>
					</div>
				</div>
			</div>
		</div>

		<# } else { #>
		<div class="bdt-member skin-default bdt-transition-toggle">
			<# if ( settings.photo && settings.photo.url ) { #>
				<div class="bdt-member-photo-wrapper<# if ( settings.image_mask_popover === 'yes' ) { #> bdt-image-mask<# } #>">
					<# if ( hasAltPhoto ) { #>
						<div class="bdt-position-relative bdt-overflow-hidden bdt-position-z-index"
							data-bdt-toggle="target: &gt; .bdt-member-photo-flip; mode: hover; animation: bdt-animation-fade; queued: true; duration: 300;">
							<div class="bdt-member-photo-flip bdt-position-absolute bdt-position-z-index">
								<img src="{{ settings.alternative_photo.url }}" alt="{{ settings.name }}">
							</div>
					<# } #>
					<div class="bdt-member-photo">
						<div class="<# print( hoverAnimClass ); #>">
							<img src="{{ settings.photo.url }}" alt="{{ settings.name }}">
						</div>
					</div>
					<# if ( hasAltPhoto ) { #>
						</div>
					<# } #>
				</div>
			<# } #>

			<div class="bdt-member-content">
				<# if ( settings.name ) { #>
					<span class="bdt-member-name">{{{ settings.name }}}</span>
				<# } #>
				<# if ( settings.role ) { #>
					<span class="bdt-member-role">{{{ settings.role }}}</span>
				<# } #>
				<# if ( settings.description_text ) { #>
					<div class="bdt-member-text bdt-content-wrap">{{{ settings.description_text }}}</div>
				<# } #>
			</div>

			<?php $this->print_member_social_icons_content_template(); ?>
		</div>
		<# } #>
		<?php
	}
}
