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

// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound
/** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Type\File */
?>
<script id="custom-option-file-type-template" type="text/x-magento-template">
    <div id="product_option_<%- data.option_id %>_type_<%- data.group %>" class="fieldset">
        <table class="data-table">
            <thead>
            <tr>
                <?php if ($block->getCanReadPrice() !== false) : ?>
                    <th><?= $block->escapeHtml(__('Price')) ?></th>
                    <th><?= $block->escapeHtml(__('Price Type')) ?></th>
                <?php endif; ?>
                <th><?= $block->escapeHtml(__('SKU')) ?></th>
                <th><?= $block->escapeHtml(__('Compatible File Extensions')) ?></th>
                <th><?= $block->escapeHtml(__('Maximum Image Size')) ?></th>
            </tr>
            </thead>
            <tr>
                <?php if ($block->getCanReadPrice() !== false) : ?>
                    <td class="opt-price">
                        <input name="product[options][<%- data.option_id %>][price]" data-store-label="<%- data.price %>"
                               class="input-text validate-zero-or-greater" type="text" value="<%- data.price %>"
                            <?php if ($block->getCanEditPrice() === false) : ?>
                                disabled="disabled"
                            <?php endif; ?>>
                    </td>
                    <td class="opt-price-type"><?= $block->getPriceTypeSelectHtml('data-attr="price-type"') ?><%- data.checkboxScopePrice %></td>
                <?php else : ?>
                    <input name="product[options][<%- data.option_id %>][price]" type="hidden">
                    <input id="product_option_<%- data.option_id %>_price_type" name="product[options][<%- data.option_id %>][price_type]" type="hidden">
                <?php endif; ?>
                <td>
                    <input name="product[options][<%- data.option_id %>][sku]" class="input-text" type="text" value="<%- data.sku %>">
                </td>
                <td>
                    <input name="product[options][<%- data.option_id %>][file_extension]" class="input-text" type="text" value="<%- data.file_extension %>">
                </td>
                <td class="col-file"><?= $block->escapeHtml(
                    __(
                        '%1 <span>x</span> %2 <span>px.</span>',
                        '<input class="input-text" type="text" name="product[options][<%- data.option_id %>][image_size_x]" value="<%- data.image_size_x %>">',
                        '<input class="input-text" type="text" name="product[options][<%- data.option_id %>][image_size_y]" value="<%- data.image_size_y %>">'
                    ),
                    ['span', 'input']
                ) ?>
                    <div class="note"><?= $block->escapeHtml(__('Please leave blank if it is not an image.')) ?></div>
                </td>
            </tr>
        </table>
    </div>
</script>
