<?php
/**
 * @author 1902 Software
 * @copyright Copyright © 2023 1902 Software (https://1902software.com/magento/)
 * @package WriteTextAI_WriteTextAI
 */
?>

<?php
    use WriteTextAI\WriteTextAI\ViewModel\Popups;
?>

<?php
    /** @var Popups $popups */
    $popups = $block->getPopups();
    $showByConfig = $popups->showPopup('welcome_new_version');

    $showPopup = $showByConfig;
?>

<div class="wtai-welcome-new-version-popup-modal" data-bind="
    scope: 'wtaiWelcomeNewVersionPopup'
" style="display: none;">
    <div class="wtai-popup-content">
        <div class="wtai-popup-image">
            <img src="<?= /* @noEscape */ $block->getViewFileUrl(
                'WriteTextAI_WriteTextAI/images/welcome_bannerv2.png'
            ) ?>" alt="Welcome new version">
        </div>
        <div class="wtai-popup-text">
            <div class="wtai-popup-title">
                <?= /* @noEscape */ __("Welcome to WriteText.ai 4.0") ?>
            </div>
            
            <div>
                <p>
                    <?= /* @noEscape */ __(
                        "Introducing <strong>Brand Voice</strong>, a new way to keep your content consistent with how your brand actually writes. <a href='https://platform.writetext.ai/brand-voices' target='_blank'>Build your own custom brand voice</a> from your existing style guide or product content, and let WriteText.ai follow it when generating text.</a>"
                    ) ?>
                </p>
                 <p>
                    <?= /* @noEscape */ __(
                        "Brand voice works alongside your templates, giving you more control over tone and style without changing your structure. It’s a smarter, more consistent way to scale your content."
                    ) ?>
                </p>
            </div>
            <div class="wtai-popup-buttons">
                <button type="button" class="action-primary primary" data-bind="click: closeNewVersionPopup">
                    <?= $block->escapeHtml(__('Got it')) ?>
                </button>
            </div>
        </div>
    </div>
</div>
<script type="text/x-magento-init">
    {
        "*": {
            "Magento_Ui/js/core/app": {
                "components": {
                    "wtaiWelcomeNewVersionPopup": {
                        "component": "WriteTextAI_WriteTextAI/js/popups/welcome-new-version",
                        "saveUrl": "<?= $block->escapeJs($block->getUrl('wtai/settings/popups')) ?>",
                        "showPopupOnLoad": <?= /* @noEscape */ $showPopup ? 'true' : 'false' ?>
                    }
                }
            }
        }
    }
</script>