<?php

namespace FinchCart\Admin\Edith\includes\ShortcodeBuilder;

use function FinchCart\Admin\Edith\includes\edith_kses_allowed_svg;

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

/**
 * Shortcode Builder Options Class
 */
class ShortCodeBuilderOptions {

	/**
	 * SVG icons for the builder
	 *
	 * @var array
	 */
	public $svg_icons = array(
		'list'        => '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" xml:space="preserve"><g><path d="M15.8,13.7H61c1,0,1.8-0.8,1.8-1.8S62,10.2,61,10.2H15.8c-1,0-1.8,0.8-1.8,1.8S14.9,13.7,15.8,13.7z"/><path d="M61,30.3H15.8c-1,0-1.8,0.8-1.8,1.8s0.8,1.8,1.8,1.8H61c1,0,1.8-0.8,1.8-1.8S62,30.3,61,30.3z"/><path d="M61,50.3H15.8c-1,0-1.8,0.8-1.8,1.8s0.8,1.8,1.8,1.8H61c1,0,1.8-0.8,1.8-1.8S62,50.3,61,50.3z"/><path d="M5.8,9.1C4.2,9.1,3,10.4,3,11.9s1.2,2.8,2.8,2.8s2.8-1.2,2.8-2.8S7.3,9.1,5.8,9.1z"/><path d="M5.8,29.2C4.2,29.2,3,30.5,3,32c0,1.5,1.2,2.8,2.8,2.8s2.8-1.2,2.8-2.8C8.6,30.5,7.3,29.2,5.8,29.2z"/><path d="M5.8,49.3c-1.5,0-2.8,1.2-2.8,2.8s1.2,2.8,2.8,2.8s2.8-1.2,2.8-2.8S7.3,49.3,5.8,49.3z"/></g></svg>',
		'plus'        => '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" xml:space="preserve"><path d="M61,30.3H33.8V3c0-1-0.8-1.8-1.8-1.8S30.3,2,30.3,3v27.3H3c-1,0-1.8,0.8-1.8,1.8S2,33.8,3,33.8h27.3V61c0,1,0.8,1.8,1.8,1.8s1.8-0.8,1.8-1.8V33.8H61c1,0,1.8-0.8,1.8-1.8S62,30.3,61,30.3z" /></svg>',
		'delete'      => '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>',
		'duplicate'   => '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>',
		'shortcode'   => '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg>',
		'right_arrow' => '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"/></svg>',
		'prev_arrow'  => '<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" /></svg>',
		'next_arrow'  => '<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" /></svg>',
	);

	/**
	 * The unique id of each shortcode builder.
	 *
	 * @var string
	 */
	public $unique = '';

	/**
	 * The shortcode builder parameters array.
	 *
	 * @var array
	 */
	public $args = array(
		'shortcode_tag' => 'edith-shortcode',
		'menu_type'     => 'menu',                  // or submenu.
		'parent_slug'   => 'options-general.php',   // for submenu only.
		'capability'    => 'manage_options',
		'position'      => 10,
		'defaults'      => array(),
		'options'       => array(),
	);

	/**
	 * Class Constructor
	 *
	 * @param atring $key The unique id of each shortcode builder.
	 * @param array  $params The shortcode builder parameters array.
	 */
	public function __construct( $key, $params ) {
		$this->unique = $key;
		$this->args   = apply_filters( "edith_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );

		add_filter( 'admin_body_class', array( $this, 'add_admin_body_classes' ) );
		add_action( 'admin_menu', array( $this, 'create_menu_page' ), 9 );

		if ( is_admin() && wp_doing_ajax() ) {
			add_action( 'wp_ajax_edith_delete_shortcode', array( $this, 'delete_shortcode' ) );
			add_action( 'wp_ajax_edith_duplicate_shortcode', array( $this, 'duplicate_shortcode' ) );
			add_action( 'wp_ajax_edith_fire_show_shortcode', array( $this, 'show_shortcode' ) );
		}
	}

	/**
	 * ShortCode Builder Instance
	 *
	 * @param atring $key The unique id of each shortcode builder.
	 * @param array  $params The shortcode builder parameters array.
	 * @return mixed
	 */
	public static function instance( $key, $params ) {
		return new self( $key, $params );
	}

	/**
	 * CSS classes for the body tag in the admin.
	 *
	 * @param string $classes Space-separated list of CSS classes.
	 * @return string
	 */
	public function add_admin_body_classes( $classes ) {
		$args     = $this->args;
		$wpscreen = get_current_screen();

		if ( substr( $wpscreen->id, -strlen( $args['menu_slug'] ) ) === $args['menu_slug'] ) {
			$classes .= ' edith-admin-page';
		}

		if ( isset( $args['sub_menu_items'] ) ) {
			foreach ( $args['sub_menu_items'] as $sub_menu_item ) {
				if ( substr( $wpscreen->id, -strlen( $sub_menu_item ) ) === $sub_menu_item ) {
					$classes .= ' edith-plugin-settings-page edith_shortcode_edit_page';
				}
			}
		}

		return $classes;
	}

	/**
	 * Create admin menu for the shortcode builder.
	 *
	 * @return void
	 */
	public function create_menu_page() {
		$args = $this->args;

		if ( 'menu' === $args['menu_type'] ) {
			add_menu_page(
				( $args['page_title'] ? $args['page_title'] : $args['menu_title'] ),
				$args['menu_title'],
				$args['capability'],
				$args['menu_slug'],
				array( $this, 'menu_page_content' ),
				$args['icon_url'],
				$args['position']
			);
		} elseif ( 'submenu' === $args['menu_type'] ) {
			add_submenu_page(
				$args['parent_slug'],
				( $args['page_title'] ? $args['page_title'] : $args['menu_title'] ),
				$args['menu_title'],
				$args['capability'],
				$args['menu_slug'],
				array( $this, 'menu_page_content' )
			);
		}
	}

	/**
	 * Admin Page Content
	 *
	 * @return mixed
	 */
	public function menu_page_content() {
		$args           = $this->args;
		$prefix         = $this->unique;
		$sections_count = '';
		if ( isset( $args['options']['sections'] ) ) {
			$sections_count = count( $args['options']['sections'] );
		}
		?>
		<div class="edith-shortcode-list-page-content" >
			<div class="edith-list-header">
				<div class="edith-logo-and-page-title">
					<?php
						echo ( isset( $args['options']['header']['icon'] ) ? sprintf( '<img class="edith-list-header-icon" src="%s">', esc_url( $args['options']['header']['icon'] ) ) : '' );
						echo ( isset( $args['options']['header']['logo'] ) ? sprintf( '<img class="edith-list-header-logo" src="%s">', esc_url( $args['options']['header']['logo'] ) ) : '' );
						echo ( isset( $args['options']['header']['title'] ) ? sprintf( '<h3>%s</h3>', esc_html( $args['options']['header']['title'] ) ) : '' );
					?>
				</div>
				<div class="edith-pro-and-version">
					<?php
						echo ( isset( $args['options']['header']['meta']['plan'] ) ? sprintf( '<span class="edith-plan-status"><span class="edith-label">%s</span><span class="edith-text">%s</span></span>', esc_html__( 'You are on the', 'finch-cart-product-recommendations' ), esc_html( $args['options']['header']['meta']['plan'] ) ) : '' );
						echo ( isset( $args['options']['header']['meta']['version'] ) ? sprintf( '<span class="edith-version"><span class="edith-label">%s</span><span class="edith-text">%s</span></span>', esc_html__( 'Version', 'finch-cart-product-recommendations' ), esc_html( $args['options']['header']['meta']['version'] ) ) : '' );
						echo ( isset( $args['options']['header']['meta']['pro'] ) ? sprintf( '<a class="button" href="%s" target="_blank">%s</a>', esc_url( $args['options']['header']['meta']['pro'] ), esc_html__( 'Go Pro', 'finch-cart-product-recommendations' ) ) : '' );
					?>
				</div>
			</div>
			<div class="edith-list-content <?php echo esc_attr( 1 === $sections_count ? 'edith-one-section' : 'edith-two-sections' ); ?>">
				<?php if ( isset( $args['options']['sections']['left'] ) ) : ?>
					<div class="edith-list-content-left">
						<?php do_action( 'finchcart_before_shortcode_list' ); ?>
						<div class="edith-list-wrapper">
							<div class="edith-section-header edith-list-items-header">
								<?php echo ( isset( $args['options']['sections']['left']['title'] ) ? sprintf( '<h3>%s %s</h3>', wp_kses( $this->svg_icons['list'], edith_kses_allowed_svg() ), esc_html( $args['options']['sections']['left']['title'] ) ) : '' ); ?>
								<?php if ( isset( $args['post_type'] ) && isset( $args['options']['sections']['left']['add_btn_text'] ) ) : ?>
								<a href="<?php echo esc_url( add_query_arg( array( 'post_type' => $args['post_type'] ), admin_url( 'post-new.php' ) ) ); ?>" class="button button-primary edith-button"><?php echo esc_html( $args['options']['sections']['left']['add_btn_text'] ); ?> <?php echo wp_kses( $this->svg_icons['plus'], edith_kses_allowed_svg() ); ?></a>
								<?php endif; ?>
							</div>
							<div class="edith-section-content">
								<?php
								if ( isset( $args['post_type'] ) ) {
									$this->shortcodes_list_items();
								} else {
									do_action( 'finchcart_section_left_content' );
								}
								?>
							</div>
						</div>
						<?php do_action( 'finchcart_after_shortcode_list' ); ?>
					</div>
				<?php endif; ?>
				<?php if ( isset( $args['options']['sections']['right'] ) ) : ?>
					<div class="edith-list-content-right">
						<div class="edith-list-additional-informations">
							<?php if ( isset( $args['options']['sections']['right']['title'] ) ) : ?>
								<div class="edith-section-header edith-info-header"><h3><?php echo wp_kses( $this->svg_icons['list'], edith_kses_allowed_svg() ); ?> <?php echo esc_html( $args['options']['sections']['right']['title'] ); ?></h3></div>
							<?php endif; ?>
							<?php if ( isset( $args['options']['sections']['right']['infos'] ) ) : ?>
							<div class="edith-info-items">
								<?php foreach ( $args['options']['sections']['right']['infos'] as $info ) : ?>
									<div class="edith-info-item">
										<h3><?php echo esc_html( $info['title'] ); ?></h3>
										<p><?php echo esc_html( $info['content'] ); ?></p>
										<?php if ( isset( $info['btn_link'] ) && isset( $info['btn_text'] ) ) : ?>
											<a href="<?php echo esc_url( $info['btn_link'] ); ?>" target="_blank" class="button button-secondary"><?php echo esc_html( $info['btn_text'] ); ?></a>
										<?php endif; ?>
									</div>
								<?php endforeach; ?>
							</div>
							<?php endif; ?>
						</div>
					</div>
				<?php endif; ?>
			</div>
		</div>
		<?php
	}

	/**
	 * The shortcode items list.
	 *
	 * @return mixed
	 */
	public function shortcodes_list_items() {
		$args       = $this->args;
		$paged      = empty( $_GET['paged'] ) ? null : (int) $_GET['paged']; // phpcs:ignore
		$query_args = array(
			'post_type'   => $args['post_type'],
			'numberposts' => 10,
			'paged'       => ( isset( $paged ) ? $paged : 1 ),
			'post_status' => 'publish',
		);

		$wp_query = new \WP_Query( $query_args );

		if ( $wp_query->have_posts() ) {
			echo '<div class="edith-shortcodes-list-items">';
			while ( $wp_query->have_posts() ) :
				$wp_query->the_post();
				$this->shortcodes_list_item( get_the_ID() );
				endwhile;

			if ( $wp_query->found_posts > 10 ) {
				echo wp_kses(
					paginate_links(
						array(
							'base'         => str_replace( 999999999, '%#%', esc_url( get_pagenum_link( 999999999 ) ) ),
							'total'        => isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1,
							'current'      => max( 1, ( isset( $paged ) ? $paged : 1 ) ),
							'format'       => '?paged=%#%',
							'show_all'     => false,
							'type'         => 'list',
							'end_size'     => 2,
							'mid_size'     => 1,
							'prev_next'    => true,
							'prev_text'    => $this->svg_icons['prev_arrow'],
							'next_text'    => $this->svg_icons['next_arrow'],
							'add_args'     => false,
							'add_fragment' => '',
						)
					),
					edith_kses_allowed_svg()
				);
			}

			echo '</div>';
			wp_reset_postdata();
		} else {
			printf( '<div class="edith-alert edith-alert-error">%s</div>', esc_html__( 'No ShortCode Found. Please Add Some.', 'finch-cart-product-recommendations' ) );
		}
	}

	/**
	 * ShortCodes List Item
	 *
	 * @param string $id The post id of shortcode item.
	 * @return mixed
	 */
	public function shortcodes_list_item( $id ) {
		$args = $this->args;

		if ( $id ) {
			?>
			<div class="edith-shortcodes-list-item-wrapper" data-id="<?php echo esc_attr( $id ); ?>">
				<div class="edith-shortcode-header">
					<div class="edith-shortcode-header-inner">
						<div class="edith-shortcode-header-left">
							<h3>
								<a href="<?php echo esc_url( get_edit_post_link( $id ) ); ?>">
									<?php echo '#' . esc_attr( $id ) . ' ' . esc_html( get_the_title( $id ) ); ?>
								</a>
							</h3>
						</div>
						<div class="edith-shortcode-header-right">
							<div class="edith-shortcodes-actions">
								<span class="edith-shortcode-delete edith-tooltip" title="<?php echo esc_html__( 'Delete ', 'finch-cart-product-recommendations' ); ?>" data-nonce="<?php echo esc_attr( wp_create_nonce( 'edith_shortcode_delete_nonce_' . esc_attr( $id ) ) ); ?>"><?php echo wp_kses( $this->svg_icons['delete'], edith_kses_allowed_svg() ); ?></span>
								<span class="edith-shortcode-duplicate edith-tooltip" title="<?php echo esc_html__( 'Duplicate', 'finch-cart-product-recommendations' ); ?>" data-nonce="<?php echo esc_attr( wp_create_nonce( 'edith_shortcode_duplicate_nonce_' . esc_attr( $id ) ) ); ?>"><?php echo wp_kses( $this->svg_icons['duplicate'], edith_kses_allowed_svg() ); ?></span>
								<span class="edith-shortcode-shortcode-popup edith-shortcode-popup-trigger edith-tooltip" title="<?php echo esc_html( $args['post_type_label'] ); ?> <?php echo esc_html__( 'ShortCode', 'finch-cart-product-recommendations' ); ?>" data-id="<?php echo esc_attr( $id ); ?>" data-nonce="<?php echo esc_attr( wp_create_nonce( 'edith_shortcode_popup_nonce_' . esc_attr( $id ) ) ); ?>"><?php echo wp_kses( $this->svg_icons['shortcode'], edith_kses_allowed_svg() ); ?></span>
								<span class="edith-shortcode-expand edith-tooltip" title="<?php echo esc_html__( 'Edit', 'finch-cart-product-recommendations' ); ?>"><a href="<?php echo esc_url( get_edit_post_link( $id ) ); ?>"><?php echo wp_kses( $this->svg_icons['right_arrow'], edith_kses_allowed_svg() ); ?></a></span>
							</div>
						</div>
					</div>
				</div>
				<span class="edith-c-ripple edith-js-ripple"><span class="edith-c-ripple__circle"></span></span>
			</div>
			<?php
		}
	}

	/**
	 * Ajax action for deleting a ShortCode
	 *
	 * @return void
	 */
	public function delete_shortcode() {

		$shortcode_id = isset( $_POST['_edith_shortcode_id'] ) ? intval( wp_unslash( $_POST['_edith_shortcode_id'] ) ) : '';

		check_ajax_referer( 'edith_shortcode_delete_nonce_' . esc_attr( $shortcode_id ), '_edith_delete_nonce' ); // Verify the nonce.

		if ( $shortcode_id ) {
			wp_delete_post( $shortcode_id, true );

			wp_send_json_success( esc_html__( 'Deleted Successfully.', 'finch-cart-product-recommendations' ) );
		}
	}

	/**
	 * Ajax action for duplicating a ShortCode
	 *
	 * @return mixed
	 */
	public function duplicate_shortcode() {
		$shortcode_id = isset( $_POST['_edith_shortcode_id'] ) ? intval( wp_unslash( $_POST['_edith_shortcode_id'] ) ) : '';
		check_ajax_referer( 'edith_shortcode_duplicate_nonce_' . esc_attr( $shortcode_id ), '_edith_duplicate_nonce' ); // Verify the nonce.

		$args = $this->args;
		$data = get_post_custom( $shortcode_id );
		$post = array(
			'post_status' => 'publish',
			'post_type'   => $args['post_type'],
			'post_title'  => get_the_title( $shortcode_id ) . esc_html__( ' - Copy', 'finch-cart-product-recommendations' ),
		);

		$new_post_id = wp_insert_post( $post );

		foreach ( $data as $key => $values ) {
			foreach ( $values as $value ) {
				add_post_meta( $new_post_id, $key, $value );
			}
		}

		ob_start();
		$this->shortcodes_list_item( $new_post_id );
		$shortcode_html = ob_get_clean();

		return wp_send_json_success( $shortcode_html );
	}

	/**
	 * Ajax action for showing a ShortCode popup
	 *
	 * @return mixed
	 */
	public function show_shortcode() {
		$args         = $this->args;
		$shortcode_id = isset( $_POST['_edith_shortcode_id'] ) ? intval( wp_unslash( $_POST['_edith_shortcode_id'] ) ) : '';

		check_ajax_referer( 'edith_shortcode_popup_nonce_' . esc_attr( $shortcode_id ), '_edith_show_shortcode_nonce' ); // Verify the nonce.

		$tabs = array(
			'shortcode' => esc_html__( 'ShortCode', 'finch-cart-product-recommendations' ),
			'php_code'  => esc_html__( 'PHP Code', 'finch-cart-product-recommendations' ),
			'widget'    => esc_html__( 'Classic Widget', 'finch-cart-product-recommendations' ),
			'gutenberg' => esc_html__( 'Gutenberg', 'finch-cart-product-recommendations' ),
			'elementor' => esc_html__( 'Elementor', 'finch-cart-product-recommendations' ),
		);

		$tabs = apply_filters( "edith_shortcode_popup_{$this->unique}_tabs", $tabs );

		if ( $shortcode_id ) {
			ob_start();
			?>
				<div class="edith-shortcode-popup-wrapper">
					<?php if ( isset( $tabs ) && ! empty( $tabs ) ) : ?>
						<div class="edith-shortcode-tabs">
							<div class="edith-shortcode-tabs-nav">
								<ul>
									<?php
									foreach ( $tabs as $key => $tab ) {
										printf( '<li><a href="#edith-tab-%s">%s</a></li>', esc_attr( $key ), esc_html( $tab ) );
									}
									?>
								</ul>
							</div>

							<div class="edith-shortcode-tabs-content-wrapper">
								<?php foreach ( $tabs as $key => $tab ) : ?>
									<div id="edith-tab-<?php echo esc_attr( $key ); ?>" class="edith-shortcode-tab-content">
										<?php
										switch ( $key ) {
											case 'shortcode':
												printf( '<p>%s</p>', esc_html__( 'Copy the code below, and then put it wherever you want it to show up.', 'finch-cart-product-recommendations' ) );
												printf( '<div class="edith-copy-shortcode-wrapper"><div class="edith-copy-shortcode"><div class="edith-copy-shortcode-text">[%s id="%s"]</div><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="rgba(0,0,0,0.2)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></div></div>', esc_attr( $args['shortcode_tag'] ), esc_attr( $shortcode_id ) );
												break;

											case 'php_code':
												printf( '<p>%s</p>', esc_html__( 'This PHP code can be used by advanced users to show the popup.                                                    ', 'finch-cart-product-recommendations' ) );
												printf( '<div class="edith-copy-shortcode-wrapper"><div class="edith-copy-shortcode"><div class="edith-copy-shortcode-text"> &#60;?php echo do_shortcode(\'[%s id="%s"]\'); ?&#62; </div><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="rgba(0,0,0,0.2)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></div></div>', esc_attr( $args['shortcode_tag'] ), esc_attr( $shortcode_id ) );
												break;

											case 'widget':
												printf( '<p>%s</p>', esc_html__( 'Navigate to the widgets page and drag and drop the plugin\'s widget into the desired spot.', 'finch-cart-product-recommendations' ) );
												printf( '<a href="%s" class="button button-secondary button-block">%s</a>', esc_url( admin_url( 'widgets.php' ) ), esc_html__( 'Go to the Widgets Page', 'finch-cart-product-recommendations' ) );
												break;

											case 'elementor':
												printf( '<p>%s</p>', esc_html__( 'Navigate to the Elementor editor page and drag and drop the plugin\'s widgets into the desired spot.', 'finch-cart-product-recommendations' ) );
												break;

											case 'gutenberg':
												printf( '<p>%s</p>', esc_html__( 'Navigate to the Gutenberg editor page and drag and drop the plugin\'s block into the desired spot.', 'finch-cart-product-recommendations' ) );
												break;

											default:
												break;
										}
										?>
									</div>
								<?php endforeach; ?>
							</div>
						</div>
					</div>
					<?php endif; ?>
				</div>
			<?php
			$content = ob_get_clean();
			wp_send_json_success(
				array(
					'title'   => esc_html( $args['post_type_label'] ) . esc_html__( ' #', 'finch-cart-product-recommendations' ) . esc_html( $shortcode_id ),
					'content' => $content,
				)
			);
		}
	}
}
