<?php
/**
 * @author 1902 Software
 * @copyright Copyright © 2023 1902 Software (https://1902software.com/magento/)
 * @package WriteTextAI_WriteTextAI
 */
?>
<div class="wtai-upload-image-loader wtai-no-display">
    <div class="wtai-content">
        <span><?= $block->escapeHtml(__(
            "Preparing images for generation. Please keep this page open".
            " and avoid reloading, closing, switching tabs, or minimizing until preparation is finished"
        )) ?></span>
    </div>
</div>

<div class="wtai-upload-image-loader-ideas wtai-no-display">
    <div class="wtai-content">
        <span><?= $block->escapeHtml(__(
            "Preparing images for keyword ideas generation. Please keep this page".
            " open and avoid reloading, closing, switching tabs, or minimizing until preparation is finished."
        )) ?></span>
    </div>
</div>

<script>
    require([
        "jquery",
        "Magento_Ui/js/modal/modal"
    ],function($, modal) {

        var options = {
            type: 'popup',
            responsive: true,
            title: '',
            buttons: [],
            modalClass: 'wtai-upload-image-loader-modal',
            overlayClass: 'modals-overlay wtai-upload-image-loader-overlay',
            modalCloseBtn: false,
            closed: function () {
                $('.modals-overlay.wtai-upload-image-loader-overlay').remove();
            }
        };
        var optionsIdeas = {
            type: 'popup',
            responsive: true,
            title: '',
            buttons: [],
            modalClass: 'wtai-upload-image-loader-ideas-modal',
            overlayClass: 'modals-overlay wtai-upload-image-loader-overlay',
            modalCloseBtn: false,
            closed: function () {
                $('.modals-overlay.wtai-upload-image-loader-overlay').remove();
            }
        };

        $('.wtai-upload-image-loader').modal(options);
        $('.wtai-upload-image-loader-ideas').modal(optionsIdeas);
        
        $('.wtai-upload-image-loader').removeClass('wtai-no-display');
        $('.wtai-upload-image-loader-ideas').removeClass('wtai-no-display');
    });
</script>
