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

/** @var \Magento\Multishipping\Block\Checkout\Address\Select $block */
?>
<div class="multicheckout">
    <div class="block block-billing">
    <?php foreach ($block->getAddress() as $address) : ?>
        <div class="box box-billing-address">
            <div class="box-content">
                <address>
                    <?= $block->getAddressAsHtml($address) ?>
                    <?php if ($block->isAddressDefaultBilling($address)) : ?>
                        <br /><strong><?= $block->escapeHtml(__('Default Billing')); ?></strong>
                    <?php endif; ?>
                    <?php if ($block->isAddressDefaultShipping($address)) : ?>
                        <br /><strong><?= $block->escapeHtml(__('Default Shipping')); ?></strong>
                    <?php endif; ?>
                </address>
            </div>
            <div class="box-actions">
                <a href="<?= $block->escapeUrl($block->getEditAddressUrl($address)); ?>" class="btn btn-secondary btn-xs margin-right10 action edit">
                    <span><?= $block->escapeHtml(__('Edit Address')); ?></span>
                </a>
                <a href="<?= $block->escapeUrl($block->getSetAddressUrl($address)); ?>" class="btn btn-primary btn-xs action select">
                    <span><?= $block->escapeHtml(__('Select Address')); ?></span>
                </a>
            </div>
        </div>
    <?php endforeach; ?>
    </div>
    <div class="actions-toolbar">
        <div class="primary">
            <button type="button" class="btn btn-secondary btn-xs action add" role="add-address" title="<?= $block->escapeHtml(__('Add New Address')); ?>">
                <span><?= $block->escapeHtml(__('Add New Address')); ?></span>
            </button>
        </div>
        <div class="secondary">
            <a href="<?= $block->escapeUrl($block->getBackUrl()); ?>" class="action btn btn-xs btn-primary action back">
                <span><?= $block->escapeHtml(__('Back to Billing Information')); ?></span>
            </a>
        </div>
    </div>
</div>
<script type="text/x-magento-init">
    {
        ".action": {
            "address": {
                "addAddress": "button[role='add-address']",
                "addAddressLocation": "<?= $block->escapeUrl($block->getAddNewUrl()); ?>"
            }
        }
    }
</script>
