<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php
/**
 * WooCommerce Product Block Editor
 */

namespace Automattic\WooCommerce\Admin\Features\ProductBlockEditor;

/**
 * Add tracks for the product block editor.
 */
class Tracks {

	/**
	 * Initialize the tracks.
	 */
	public function init() {
		add_filter( 'woocommerce_product_source', array( $this, 'add_product_source' ) );
	}

	/**
	 * Check if a URL is a product editor page.
	 *
	 * @param string $url Url to check.
	 * @return boolean
	 */
	protected function is_product_editor_page( $url ) {
		$query_string = wp_parse_url( wp_get_referer(), PHP_URL_QUERY );
		parse_str( $query_string, $query );

		if ( ! isset( $query['page'] ) || 'wc-admin' !== $query['page'] || ! isset( $query['path'] ) ) {
			return false;
		}

		$path_pieces = explode( '/', $query['path'] );
		$route       = $path_