<?php

// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound -- APD is the established namespace shared with the Pro add-on and retained for backward compatibility.
namespace APD\WooCommerce;

defined('ABSPATH') || exit;

final class Compatibility
{
    public static function register() : void
    {
        add_action('before_woocommerce_init', [self::class, 'declare']);
    }

    public static function declare() : void
    {
        $featuresUtil = '\Automattic\WooCommerce\Utilities\FeaturesUtil';
        if (! class_exists($featuresUtil)) {
            return;
        }

        $featuresUtil::declare_compatibility('custom_order_tables', ASUKA_PRODUCT_DESIGNER_FILE, true);
        $featuresUtil::declare_compatibility('cart_checkout_blocks', ASUKA_PRODUCT_DESIGNER_FILE, true);
    }
}
