<?php
/**
 * Input container template for Pixelio Cart Abandon Recovery More plugin.
 *
 * This template renders a single input field along with its label, description,
 * PRO badge, and handles dependency and visibility logic.
 *
 * It automatically generates the nonce for security and applies CSS classes
 * based on the input's state (disabled, pro feature, dependency, etc.).
 *
 * Usage:
 * Include this template within a reusable input class extending
 * Pixelio_Cart_Abandon_Recovery_More_All_Input.
 *
 * @package PixelioCartAbandonRecoveryMore\Admin\Views\Reusable
 * @since   0.1
 */

use PixelioCartAbandonRecoveryMore\Includes\Utils\Pixelio_Cart_Abandon_Recovery_More_Util;

if ( ! defined( 'ABSPATH' ) ) exit;
?>
<div
	class="pixelio-cart-abandon-recovery-more-input-container <?php echo esc_attr(($this->name !='') ? $this->name : '');?>
	<?php echo ( '' !== $this->dependency_name ) ?  esc_attr( $this->dependency_name ."-parent ") : '';
	echo ( '' !== $this->dependency_name ) ? esc_attr( 'pixelio-cart-abandon-recovery-more-all-input-dependency ' ) : esc_attr( '' );
	$pixelio_cart_abandon_recovery_more_should_hide = $this->disabled
		|| ( '' !== $this->dependency_name )
		|| ( ( '' !== $this->dependency_name ) && ! Pixelio_Cart_Abandon_Recovery_More_Util::pixelio_cart_abandon_recovery_more_dependency_is_checked( $this->dependency_name ) );
	echo $pixelio_cart_abandon_recovery_more_should_hide ? esc_attr('pixelio-cart-abandon-recovery-more-hide-it') : esc_attr('');
	echo ( $this->pro ) ? esc_attr( ' pixelio-cart-abandon-recovery-more-pro' ) : esc_attr( '' );
	?>
	">
	<input type="hidden"
			name="<?php echo esc_attr( $this->name ); ?>_wpnonce"
			value="<?php echo esc_attr( wp_create_nonce( $this->name ) ); ?>"/>
	<label class="pixelio-cart-abandon-recovery-more-input-label"
			for=""><?php echo esc_attr( $this->label ); ?>
		<span
			class="pixelio-cart-abandon-recovery-more-pro-feature">
			<?php
			if ( $this->pro ) {
				esc_html_e( '- PRO FEATURE', 'rivio-ai-cart-recovery-marketing-email-automation' );
			}
			?>
			</span></label>
	<p class="pixelio-cart-abandon-recovery-more-input-description
	<?php
	if ( empty( $this->description ) ) {
		echo 'pixelio-cart-abandon-recovery-more-hide-it';
	}
	?>
	"><?php echo wp_kses_post( $this->description ); ?></p>

