<?php
/**
 * Copyright 2014 Adobe
 * All Rights Reserved.
 */

use Magento\Checkout\Block\Onepage\Link;
use Magento\Framework\Escaper;

/**
 * @var Link $block
 * @var Escaper $escaper
 */
?>
<?php if ($block->isPossibleOnepageCheckout()): ?>
    <button type="button"
            data-role="proceed-to-checkout"
            title="<?= $escaper->escapeHtmlAttr(__('Proceed to Checkout')) ?>"
            data-mage-init='{
                "Magento_Checkout/js/proceed-to-checkout":{
                    "checkoutUrl":"<?= $escaper->escapeJs($block->getCheckoutUrl()) ?>"
                }
            }'
            class="action primary checkout<?= ($block->isDisabled()) ? ' disabled' : '' ?>"
            <?php if ($block->isDisabled()): ?>
                disabled="disabled"
            <?php endif; ?>>
        <span><?= $escaper->escapeHtml(__('Proceed to Checkout')) ?></span>
    </button>
<?php endif?>
