<?php
/**
 * Centralized Tutorial Links Configuration
 *
 * This file contains all documentation and video tutorial links used throughout the plugin.
 * Used in: Documentation tab, Addon Builder tutorial buttons, Field Settings modals.
 *
 * @since      4.4.5
 * @subpackage Extra_Product_Options_For_WooCommerce/settings
 * @package    Extra_Product_Options_For_WooCommerce
 */

// If this file is called directly, abort.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Get all tutorial links configuration.
 *
 * @since 4.4.5
 *
 * @return array All tutorial links organized by category.
 */
function epofw_get_tutorial_links() {
	return array(
		// Field Types - used in Documentation tab and Field Settings modal.
		'field_types'  => epofw_get_field_types_links(),

		// General Documentation - Section, Conditional Logic, etc.
		'general'      => epofw_get_general_docs_links(),

		// Addon Builder specific tabs and sections.
		'builder_tabs' => epofw_get_builder_tabs_links(),
	);
}

/**
 * Get field types tutorial links.
 *
 * @since 4.4.5
 *
 * @return array Field types with their documentation links.
 */
function epofw_get_field_types_links() {
	return array(
		'text'          => array(
			'title'       => __( 'Text Field', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Single line text input for short text entries like names, titles, or custom messages.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-edit',
			'doc_link'    => 'https://wpactpro.com/extra-product-option-for-text-field',
			'video_link'  => '',
		),
		'textarea'      => array(
			'title'       => __( 'Textarea', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Multi-line text input for longer text entries like comments, descriptions, or instructions.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-text',
			'doc_link'    => 'https://wpactpro.com/extra-product-option-for-textarea-field',
			'video_link'  => '',
		),
		'number'        => array(
			'title'       => __( 'Number Field', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Numeric input field with increment/decrement controls for quantities or measurements.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-calculator',
			'doc_link'    => 'https://wpactpro.com/extra-product-option-for-number-field',
			'video_link'  => '',
		),
		'password'      => array(
			'title'       => __( 'Password Field', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Secure password input field that masks entered text for sensitive information.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-lock',
			'doc_link'    => '',
			'video_link'  => '',
		),
		'select'        => array(
			'title'       => __( 'Select Dropdown', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Dropdown menu allowing users to select one option from a predefined list.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-arrow-down-alt2',
			'doc_link'    => 'https://wpactpro.com/extra-product-option-for-select-field',
			'video_link'  => '',
		),
		'multiselect'   => array(
			'title'       => __( 'Multi-Select', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Dropdown allowing multiple selections from a list of options.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-menu-alt',
			'doc_link'    => 'https://wpactpro.com/extra-product-option-for-multiselect-field',
			'video_link'  => '',
		),
		'checkbox'      => array(
			'title'       => __( 'Checkbox', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Single checkbox for yes/no or agree/disagree type selections.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-yes',
			'doc_link'    => 'https://wpactpro.com/extra-product-option-for-checkbox-field',
			'video_link'  => '',
		),
		'checkboxgroup' => array(
			'title'       => __( 'Checkbox Group', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Multiple checkboxes allowing users to select one or more options.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-yes-alt',
			'doc_link'    => 'https://wpactpro.com/extra-product-option-for-checkbox-group-field',
			'video_link'  => '',
		),
		'radiogroup'    => array(
			'title'       => __( 'Radio Group', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Radio buttons allowing users to select exactly one option from multiple choices.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-marker',
			'doc_link'    => 'https://wpactpro.com/extra-product-option-for-radio-button',
			'video_link'  => '',
		),
		'datepicker'    => array(
			'title'       => __( 'Date Picker', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Calendar widget for selecting dates with easy navigation.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-calendar-alt',
			'doc_link'    => 'https://wpactpro.com/woocommerce-date-picker-guide',
			'video_link'  => 'https://www.youtube.com/watch?v=3yk3qVNj3D4',
		),
		'timepicker'    => array(
			'title'       => __( 'Time Picker', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Time selection widget for choosing hours and minutes.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-clock',
			'doc_link'    => '',
			'video_link'  => '',
		),
		'colorpicker'   => array(
			'title'       => __( 'Color Picker', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Color selection tool with visual color palette for choosing custom colors.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-art',
			'doc_link'    => '',
			'video_link'  => '',
		),
		'switch'        => array(
			'title'       => __( 'Switch', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Toggle switch for on/off or yes/no selections with visual feedback.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-controls-repeat',
			'doc_link'    => 'https://wpactpro.com/extra-product-option-for-switch-field',
			'video_link'  => '',
		),
		'hidden'        => array(
			'title'       => __( 'Hidden Field', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Hidden field for storing data that is not visible to customers.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-hidden',
			'doc_link'    => '',
			'video_link'  => '',
		),
		'heading'       => array(
			'title'       => __( 'Heading', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Display text as a heading or section title for organizing form content.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-heading',
			'doc_link'    => '',
			'video_link'  => '',
		),
		'paragraph'     => array(
			'title'       => __( 'Paragraph', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Display formatted text content or instructions within the form.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-editor-paragraph',
			'doc_link'    => '',
			'video_link'  => '',
		),
		'file'          => array(
			'title'       => __( 'File Upload', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'File upload field allowing customers to attach images, documents, or other files.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-upload',
			'doc_link'    => 'https://wpactpro.com/woocommerce-file-upload-guide',
			'video_link'  => 'https://www.youtube.com/watch?v=2132rd-C4Xk',
			'premium'     => true,
		),
		'colorswitcher' => array(
			'title'       => __( 'Color Switcher', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Visual color selection with swatches for product variations.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-admin-appearance',
			'doc_link'    => 'https://wpactpro.com/woocommerce-color-swatches-guide',
			'video_link'  => '',
			'premium'     => true,
		),
		'textswitcher'  => array(
			'title'       => __( 'Text Switcher', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Toggle-style buttons for selecting text-based options.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-button',
			'doc_link'    => 'https://wpactpro.com/woocommerce-text-switcher-guide',
			'video_link'  => '',
			'premium'     => true,
		),
		'imageswitcher' => array(
			'title'       => __( 'Image Switcher', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Visual selection using image thumbnails for product customization.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-format-image',
			'doc_link'    => 'https://wpactpro.com/extra-product-options-for-image-switcher-field',
			'video_link'  => '',
			'premium'     => true,
		),
		'slider'        => array(
			'title'       => __( 'Slider', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Range slider for selecting numeric values within a minimum and maximum range.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-leftright',
			'doc_link'    => 'https://wpactpro.com/extra-product-option-for-slider-field',
			'video_link'  => '',
			'premium'     => true,
		),
		'repeater'      => array(
			'title'       => __( 'Repeatable', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Create repeatable groups of fields that customers can add or remove dynamically for flexible product customization.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-controls-repeat',
			'doc_link'    => 'https://wpactpro.com/woocommerce-repeater-fields-guide',
			'video_link'  => '',
			'premium'     => true,
		),
	);
}

/**
 * Get general documentation links.
 *
 * @since 4.4.5
 *
 * @return array General documentation items.
 */
function epofw_get_general_docs_links() {
	return array(
		'additional_rule'    => array(
			'title'       => __( 'Display Rule(Additional Rule)', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Control where and when addons appear using product, category, tag, variation, quantity, and date-based display rules.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-admin-generic',
			'doc_link'    => 'https://wpactpro.com/woocommerce-display-rules-guide',
			'video_link'  => '',
		),
		'section'            => array(
			'title'       => __( 'Section Settings', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Learn how to customize section titles, descriptions, colors, spacing, borders, and styling options.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-admin-generic',
			'doc_link'    => 'https://wpactpro.com/section-settings/',
			'video_link'  => 'https://youtu.be/KT5xUR3rAD8',
		),
		'row'                => array(
			'title'       => __( 'Row & Column Layouts', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Master row and column layouts to organize fields in single, two, three, or four column arrangements.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-grid-view',
			'doc_link'    => '',
			'video_link'  => '',
		),
		'conditional_logic'  => array(
			'title'       => __( 'Conditional Logic', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Create dynamic forms with conditional logic to show or hide fields based on user selections and conditions.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-networking',
			'doc_link'    => 'https://wpactpro.com/extra-product-options-conditional-logic',
			'video_link'  => '',
		),
		'quantity_options'   => array(
			'title'       => __( 'Quantity Options', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Enable quantity selection for addon fields, allowing customers to specify how many of each option they want.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-cart',
			'doc_link'    => 'https://wpactpro.com/quantity-settings',
			'video_link'  => '',
		),
		'woocommerce'        => array(
			'title'       => __( 'WooCommerce Settings', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Fine-tune how your extra product options appear and behave across product pages, cart, checkout, orders, and emails.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-admin-generic',
			'doc_link'    => 'https://wpactpro.com/woocommerce-settings',
			'video_link'  => '',
		),
		'pricing_options'    => array(
			'title'       => __( 'Pricing Options', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Configure addon pricing including fixed prices, percentage-based pricing, and custom formulas.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-money-alt',
			'doc_link'    => 'https://wpactpro.com/woocommerce-product-addon-pricing-guide',
			'video_link'  => '',
		),
		'label_settings'     => array(
			'title'       => __( 'Label Settings', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Customize field labels, subtitles, tooltips, and their styling options.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-tag',
			'doc_link'    => '',
			'video_link'  => '',
		),
		'container_settings' => array(
			'title'       => __( 'Field Container Settings', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Style field containers with custom colors, borders, padding, and CSS classes.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-align-full-width',
			'doc_link'    => '',
			'video_link'  => '',
		),
		'global_settings'    => array(
			'title'       => __( 'Global Settings', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Set default label and field container styling for all addons with override support.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-admin-settings',
			'doc_link'    => 'https://wpactpro.com/global-settings-extra-product-options',
			'video_link'  => '',
		),
		'stock_management'   => array(
			'title'       => __( 'Stock Management (Options)', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Manage per-option stock for addon fields to prevent overselling.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-chart-bar',
			'doc_link'    => 'https://wpactpro.com/stock-management-extra-product-options',
			'video_link'  => '',
		),
		'section_layout'     => array(
			'title'       => __( 'Section Layout', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Configure Accordion, Tabs, and Step Wizard layouts globally or per addon.', 'extra-product-options-for-woocommerce' ),
			'icon'        => 'dashicons-schedule',
			'doc_link'    => 'https://wpactpro.com/section-layout-extra-product-options',
			'video_link'  => '',
		),
	);
}

/**
 * Get addon builder tabs tutorial links.
 *
 * @since 4.4.5
 *
 * @return array Builder tabs with their documentation links.
 */
function epofw_get_builder_tabs_links() {
	return array(
		// Addon Configuration (main builder page).
		'addon_configuration'      => array(
			'title'       => __( 'Addon Configuration', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Configure basic addon settings including status, name, and display rules.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => 'https://wpactpro.com/woocommerce-display-rules-guide',
			'video_link'  => '',
		),
		// Field Settings Modal Tabs.
		'general_settings'         => array(
			'title'       => __( 'General Settings', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Configure field status, name, ID, and basic field properties.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => '',
			'video_link'  => '',
		),
		'label_settings'           => array(
			'title'       => __( 'Label Settings', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Customize field labels, subtitles, tooltips, and their positioning.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => '',
			'video_link'  => '',
		),
		'text_options'             => array(
			'title'       => __( 'Text Options', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Configure text field specific options like placeholder, max length, and restrictions.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => '',
			'video_link'  => '',
		),
		'quantity_options'         => array(
			'title'       => __( 'Quantity Options', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Enable and configure quantity selection for addon fields.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => 'https://wpactpro.com/quantity-settings',
			'video_link'  => '',
		),
		'pricing_options'          => array(
			'title'       => __( 'Pricing Options', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Set addon prices, price types, and pricing formulas.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => '',
			'video_link'  => '',
		),
		'conditional_logic'        => array(
			'title'       => __( 'Conditional Logic', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Show or hide fields based on other field values and conditions.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => 'https://wpactpro.com/extra-product-options-conditional-logic',
			'video_link'  => '',
		),
		'woocommerce_settings'     => array(
			'title'       => __( 'WooCommerce Settings', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Configure how the field appears in cart, checkout, and order details.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => 'https://wpactpro.com/woocommerce-settings',
			'video_link'  => '',
		),
		'field_container_settings' => array(
			'title'       => __( 'Field Container Settings', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Style the field container with colors, borders, and custom CSS.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => '',
			'video_link'  => '',
		),
		// Field type specific options tabs.
		'select_options'           => array(
			'title'       => __( 'Select Options', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Configure dropdown options with labels, values, and prices.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => 'https://wpactpro.com/extra-product-option-for-select-field',
			'video_link'  => '',
		),
		'checkbox_options'         => array(
			'title'       => __( 'Checkbox Options', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Configure checkbox options with labels, values, and prices.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => 'https://wpactpro.com/extra-product-option-for-checkbox-field',
			'video_link'  => '',
		),
		'radio_options'            => array(
			'title'       => __( 'Radio Options', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Configure radio button options with labels, values, and prices.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => 'https://wpactpro.com/extra-product-option-for-radio-button',
			'video_link'  => '',
		),
		'date_options'             => array(
			'title'       => __( 'Date Options', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Configure date picker options including format, min/max dates, and disabled dates.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => 'https://wpactpro.com/woocommerce-date-picker-guide',
			'video_link'  => 'https://www.youtube.com/watch?v=3yk3qVNj3D4',
		),
		'file_options'             => array(
			'title'       => __( 'File Upload Options', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Configure file upload settings including allowed types, max size, and multiple files.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => 'https://wpactpro.com/woocommerce-file-upload-guide',
			'video_link'  => 'https://www.youtube.com/watch?v=2132rd-C4Xk',
		),
		'slider_options'           => array(
			'title'       => __( 'Slider Options', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Configure slider range, step values, and default settings.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => 'https://wpactpro.com/extra-product-option-for-slider-field',
			'video_link'  => '',
		),
		'color_switcher_options'   => array(
			'title'       => __( 'Color Switcher Options', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Configure color swatch options with colors, labels, and prices.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => '',
			'video_link'  => '',
		),
		'image_switcher_options'   => array(
			'title'       => __( 'Image Switcher Options', 'extra-product-options-for-woocommerce' ),
			'description' => __( 'Configure image selection options with thumbnails, labels, and prices.', 'extra-product-options-for-woocommerce' ),
			'doc_link'    => 'https://wpactpro.com/extra-product-options-for-image-switcher-field',
			'video_link'  => '',
		),
	);
}

/**
 * Get tutorial link for a specific context.
 *
 * @since 4.4.5
 *
 * @param string $context The context key (e.g., 'text', 'conditional_logic', 'general_settings').
 * @param string $type    The link type: 'doc_link', 'video_link', or 'all'.
 *
 * @return mixed String URL, array of links, or empty string if not found.
 */
function epofw_get_tutorial_link( $context, $type = 'all' ) {
	$all_links = epofw_get_tutorial_links();

	// Search in field types.
	if ( isset( $all_links['field_types'][ $context ] ) ) {
		$links = $all_links['field_types'][ $context ];
		if ( 'all' === $type ) {
			return $links;
		}

		return isset( $links[ $type ] ) ? $links[ $type ] : '';
	}

	// Search in general docs.
	if ( isset( $all_links['general'][ $context ] ) ) {
		$links = $all_links['general'][ $context ];
		if ( 'all' === $type ) {
			return $links;
		}

		return isset( $links[ $type ] ) ? $links[ $type ] : '';
	}

	// Search in builder tabs.
	if ( isset( $all_links['builder_tabs'][ $context ] ) ) {
		$links = $all_links['builder_tabs'][ $context ];
		if ( 'all' === $type ) {
			return $links;
		}

		return isset( $links[ $type ] ) ? $links[ $type ] : '';
	}

	return 'all' === $type ? array() : '';
}

/**
 * Check if tutorial links exist for a context.
 *
 * @since 4.4.5
 *
 * @param string $context The context key.
 *
 * @return bool True if any links exist, false otherwise.
 */
function epofw_has_tutorial_links( $context ) {
	$links = epofw_get_tutorial_link( $context, 'all' );

	if ( empty( $links ) ) {
		return false;
	}

	return ! empty( $links['doc_link'] ) || ! empty( $links['video_link'] );
}

/**
 * Render tutorial buttons HTML.
 *
 * @since 4.4.5
 *
 * @param string $context     The context key for getting links.
 * @param string $button_size Button size: 'small', 'medium', or 'large'.
 * @param bool   $show_labels Whether to show text labels on buttons.
 *
 * @return void
 */
function epofw_render_tutorial_buttons( $context, $button_size = 'small', $show_labels = true ) {
	$links = epofw_get_tutorial_link( $context, 'all' );

	if ( empty( $links ) ) {
		return;
	}

	$has_doc   = ! empty( $links['doc_link'] );
	$has_video = ! empty( $links['video_link'] );

	if ( ! $has_doc && ! $has_video ) {
		return;
	}

	$size_class = 'epofw-tutorial-btn-' . esc_attr( $button_size );
	?>
	<div class="epofw-tutorial-buttons <?php echo esc_attr( $size_class ); ?>">
		<?php if ( $has_video ) : ?>
			<a href="<?php echo esc_url( $links['video_link'] ); ?>"
			class="epofw-tutorial-btn epofw-tutorial-btn-video"
			title="<?php esc_attr_e( 'Watch Video Tutorial', 'extra-product-options-for-woocommerce' ); ?>"
			target="_blank">
				<span class="dashicons dashicons-video-alt3"></span>
				<?php if ( $show_labels ) : ?>
					<span class="epofw-tutorial-btn-text"><?php esc_html_e( 'Video', 'extra-product-options-for-woocommerce' ); ?></span>
				<?php endif; ?>
			</a>
		<?php endif; ?>
		<?php if ( $has_doc ) : ?>
			<a href="<?php echo esc_url( $links['doc_link'] ); ?>"
			class="epofw-tutorial-btn epofw-tutorial-btn-doc"
			title="<?php esc_attr_e( 'Read Documentation', 'extra-product-options-for-woocommerce' ); ?>"
			target="_blank">
				<span class="dashicons dashicons-book-alt"></span>
				<?php if ( $show_labels ) : ?>
					<span class="epofw-tutorial-btn-text"><?php esc_html_e( 'Docs', 'extra-product-options-for-woocommerce' ); ?></span>
				<?php endif; ?>
			</a>
		<?php endif; ?>
	</div>
	<?php
}

/**
 * Get tutorial buttons HTML as string.
 *
 * @since 4.4.5
 *
 * @param string $context     The context key for getting links.
 * @param string $button_size Button size: 'small', 'medium', or 'large'.
 * @param bool   $show_labels Whether to show text labels on buttons.
 *
 * @return string HTML string of tutorial buttons.
 */
function epofw_get_tutorial_buttons_html( $context, $button_size = 'small', $show_labels = true ) {
	ob_start();
	epofw_render_tutorial_buttons( $context, $button_size, $show_labels );

	return ob_get_clean();
}
