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

/**
 * @var $block \Magento\Sales\Block\Widget\Guest\Form
 * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
 */
?>
<?php if ($block->isEnable()): ?>
    <div class="widget block block-orders-returns">
        <div class="block-title">
            <strong role="heading" aria-level="2"><?= $block->escapeHtml(__('Orders and Returns')) ?></strong>
        </div>
        <div class="block-content">
            <form id="oar-widget-orders-and-returns-form" data-mage-init='{"ordersReturns":{},"validation":{}}'
                  action="<?= $block->escapeUrl($block->getActionUrl()) ?>" method="post"
                  class="form form-orders-search" name="guest_post">
                <fieldset class="fieldset">
                    <div class="field find required">
                        <label class="label"><span><?= $block->escapeHtml(__('Find Order By')) ?></span></label>

                        <div class="control">
                            <select name="oar_type" id="quick-search-type-id" class="select" title="">
                                <option value="email"><?= $block->escapeHtml(__('Email')) ?></option>
                                <option value="zip"><?= $block->escapeHtml(__('ZIP Code')) ?></option>
                            </select>
                        </div>
                    </div>
                    <div class="field id required">
                        <label for="oar-order-id" class="label">
                            <span><?= $block->escapeHtml(__('Order ID')) ?></span>
                        </label>

                        <div class="control">
                            <input type="text" class="input-text" id="oar-order-id" name="oar_order_id"
                                   autocomplete="off"
                                   data-validate="{required:true}">
                        </div>
                    </div>
                    <div class="field lastname required">
                        <label for="oar-billing-lastname"
                               class="label"><span><?= $block->escapeHtml(__('Billing Last Name')) ?></span></label>

                        <div class="control">
                            <input type="text" class="input-text" id="oar-billing-lastname" name="oar_billing_lastname"
                                   autocomplete="off" data-validate="{required:true}">
                        </div>
                    </div>
                    <div id="oar-email" class="field email required">
                        <label for="oar_email" class="label"><span><?= $block->escapeHtml(__('Email')) ?></span></label>

                        <div class="control">
                            <input type="email" class="input-text" id="oar_email" name="oar_email" autocomplete="off"
                                   data-validate="{required:true, 'validate-email':true}">
                        </div>
                    </div>
                    <div id="oar-zip" class="field zip required">
                        <label for="oar_zip" class="label">
                            <span><?= $block->escapeHtml(__('Billing ZIP Code')) ?></span>
                        </label>

                        <div class="control">
                            <input type="text" class="input-text" id="oar_zip" name="oar_zip"
                                   data-validate="{required:true}"/>
                        </div>
                    </div>
                    <?= /* @noEscape */ $secureRenderer->renderStyleAsTag("display: none;", 'div#oar-zip') ?>
                </fieldset>
                <div class="actions-toolbar">
                    <div class="primary">
                        <button type="submit" title="<?= $block->escapeHtml(__('Search')) ?>" class="action search">
                            <span><?= $block->escapeHtml(__('Search')) ?></span>
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
<?php endif; ?>
