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

/** @var \Magento\Catalog\Block\Product\Gallery $block */
?>
<?php $_width = $block->getImageWidth(); ?>
<div class="product-image-popup" style="width:<?= /* @noEscape */ $_width ?>px;">
    <div class="buttons-set"><a href="#" class="button" role="close-window"><span><?= $block->escapeHtml(__('Close Window')) ?></span></a></div>
    <?php if ($block->getPreviousImageUrl() || $block->getNextImageUrl()) :?>
        <div class="nav">
            <?php if ($_prevUrl = $block->getPreviousImageUrl()) :?>
                <a href="<?= $block->escapeUrl($_prevUrl) ?>" class="prev">&laquo; <?= $block->escapeHtml(__('Prev')) ?></a>
            <?php endif; ?>
            <?php if ($_nextUrl = $block->getNextImageUrl()) :?>
                <a href="<?= $block->escapeUrl($_nextUrl) ?>" class="next"><?= $block->escapeHtml(__('Next')) ?> &raquo;</a>
            <?php endif; ?>
        </div>
    <?php endif; ?>
    <?php if ($_imageTitle = $block->escapeHtml($block->getCurrentImage()->getLabel())) :?>
        <h1 class="image-label"><?= /* @noEscape */ $_imageTitle ?></h1>
    <?php endif; ?>
    <?php
    $imageUrl = $block->getImageUrl();
    ?>
    <img src="<?= $block->escapeUrl($imageUrl) ?>"
        <?php if ($_width) :?>
            width="<?= /* @noEscape */ $_width ?>"
        <?php endif; ?>
         alt="<?= $block->escapeHtmlAttr($block->getCurrentImage()->getLabel()) ?>"
         title="<?= $block->escapeHtmlAttr($block->getCurrentImage()->getLabel()) ?>"
         id="product-gallery-image"
         class="image"
         data-mage-init='{"catalogGallery":{}}'/>
    <div class="buttons-set"><a href="#" class="button" role="close-window"><span><?= $block->escapeHtml(__('Close Window')) ?></span></a></div>
    <?php if ($block->getPreviousImageUrl() || $block->getNextImageUrl()) :?>
        <div class="nav">
            <?php if ($_prevUrl = $block->getPreviousImageUrl()) :?>
                <a href="<?= $block->escapeUrl($_prevUrl) ?>" class="prev">&laquo; <?= $block->escapeHtml(__('Prev')) ?></a>
            <?php endif; ?>
            <?php if ($_nextUrl = $block->getNextImageUrl()) :?>
                <a href="<?= $block->escapeUrl($_nextUrl) ?>" class="next"><?= $block->escapeHtml(__('Next')) ?> &raquo;</a>
            <?php endif; ?>
        </div>
    <?php endif; ?>
</div>
