<?php
/** @var \Rokanthemes\OnePageCheckout\Block\Adminhtml\Field\AbstractField $block */
?>

<div id="<?= $block->escapeQuote($block->getBlockId()) ?>" class="admin-field-container">
    <?php if ($block->isVisible() && $block->hasFields()) : ?>
        <div class="containment row">
            <div class="field-wrapper available-wrapper col-m-4">
                <div><?= __('Area Removed'); ?></div>
                <ul class="sortable-list ui-sortable">
                    <?php foreach ($block->getAvailableFields() as $field) : ?>
                        <li class="sortable-item" id="<?= $block->escapeQuote($field->getId()) ?>"
                            data-code="<?= $block->escapeQuote($field->getAttributeCode()) ?>">
                            <div class="attribute-label">
                                <span><?= $block->escapeHtml($field->getFrontendLabel()) ?></span>
                                <div class="attribute-required">
                                    <input type="checkbox" title="<?= __('Is Required?') ?>"
                                        <?php if ($field->getIsRequired()) {
                                            echo ' checked';
                                        } ?>>
                                </div>
                            </div>
                        </li>
                    <?php endforeach; ?>
                </ul>

            </div>
            <div class="field-wrapper sorted-wrapper col-m-8">
                <div><?= __('Area Sorting'); ?></div>
                <ul class="sortable-list ui-sortable">
                    <?php foreach ($block->getSortedFields() as $field) : ?>
                        <li class="sortable-item <?= $block->escapeQuote($field->getColStyle()) ?>"
                            id="<?= $block->escapeQuote($field->getId()) ?>"
                            data-code="<?= $block->escapeQuote($field->getAttributeCode()) ?>">
                            <div class="attribute-label">
                                <span><?= $block->escapeHtml($field->getFrontendLabel()) ?></span>
                                <?php if ($field->getId()) : ?>
                                    <div class="attribute-required">
                                        <input type="checkbox" title="<?= __('Is Required?') ?>"
                                            <?php if ($field->getIsRequiredMp()) {
                                                echo ' checked';
                                            } ?>>
                                    </div>
                                <?php endif; ?>
                            </div>
                        </li>
                    <?php endforeach; ?>
                </ul>
            </div>
        </div>

        <script type="text/x-magento-init">
        {
            "*": {
                "Rokanthemes_OnePageCheckout/js/field-position": {
                    "blockId": "<?= /** @noEscape */ $block->getBlockId() ?>"
                }
            }
        }
        </script>
    <?php else : ?>
        <div class="messages">
            <div class="message message-info info">
                <span><?= /** @noEscape */ $block->getNoticeMessage() ?></span>
            </div>
        </div>
    <?php endif; ?>
</div>
