<?php

/**
 * Asset manifest for adapayments-for-woocommerce's checkout / admin script.
 *
 * Normally `@wordpress/scripts` emits this file alongside build/index.js; the
 * upstream plugin shipped without it, which triggers two broken fallbacks:
 *
 *  - includes/Admin/Setup.php calls filemtime() against a relative path →
 *    fatal under our error-to-exception bridge.
 *  - adapayment-block.php sets `dependencies` to an empty array via the
 *    `if (file_exists($asset_path)) { … }` short-circuit — so the WP block
 *    globals (wp.element, wp.data, wp.i18n, wp.components) never get
 *    enqueued, and the payment method silently fails to register on the
 *    block checkout.
 *
 * Deps mirror the plugin's own fallback list exactly (see
 * adapayment-block.php line 28). Don't add wc-blocks-registry / wc-settings
 * here — those handles aren't always registered by the time WP resolves
 * this script's dep tree, and an unknown dependency silently drops the
 * whole chain. The compiled index.js reaches them via window.wc.* globals
 * which WC always sets on the checkout page.
 *
 * Version uses filemtime so the asset cache-busts whenever the bundle is
 * replaced — browsers won't cache a stale build.
 */

return [
    'dependencies' => [
        'wp-element',
        'wp-components',
        'wp-data',
        'wp-i18n',
        'wc-blocks-registry',
        'wc-settings',
        'wc-blocks-data-store',
    ],
    'version' => (string) (file_exists(__DIR__ . '/index.js') ? filemtime(__DIR__ . '/index.js') : '1.0.0'),
];
