<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/** @var Magento\AuthorizenetAcceptjs\Block\Payment $block */
?>
<script>
    //<![CDATA[
    require(
        [
            'Magento_AuthorizenetAcceptjs/js/authorizenet',
            'jquery',
            'domReady!'
        ], function(AuthorizenetAcceptjs, $) {
            var config = <?= /* @noEscape */ $block->getPaymentConfig() ?>,
                form = $('#payment_form_<?= /* @noEscape */ $block->escapeJs($block->escapeHtml($block->getMethodCode())) ?>');

            config.active = form.length > 0 && !form.is(':hidden');
            new AuthorizenetAcceptjs(config);
        });
    //]]>
</script>
