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

/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
?>

<?php if ($block->getChildHtml()):?>
<div id="gift_options_configure_new" class="gift-options-popup product-configure-popup no-display">
    <div id="gift_options_form_contents">
        <div class="content">
            <?= $block->getChildHtml() ?>
        </div>
        <div class="ui-dialog-buttonset">
            <button type="button" class="action-close" id="gift_options_cancel_button">
                <span><?= $block->escapeHtml(__('Cancel')) ?></span>
            </button>
            <button type="button" class="action-primary" id="gift_options_ok_button">
                <span><?= $block->escapeHtml(__('OK')) ?></span>
            </button>
        </div>
    </div>
</div>
    <div id="giftoptions_tooltip_window" class="gift-options-tooltip no-display">
        <div id="giftoptions_tooltip_window_content">&nbsp;</div>
    </div>
    <?php $scriptString = <<<script
    require(['jquery'], function($){
        'use strict';
        $('div#gift_options_configure_new').css('display', 'none');
        $('div#gift_options_configure_new').removeClass('no-display');

        $('div#giftoptions_tooltip_window').css('display', 'none');
        $('div#giftoptions_tooltip_window').removeClass('no-display');
    });
script;
    ?>
    <?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
    <?php $scriptString = <<<script
require([
    "Magento_Sales/order/create/giftmessage",
    "Magento_Sales/order/giftoptions_tooltip"
], function(){

//<![CDATA[
var giftMessageSet = new GiftMessageSet();

_giftOptions = new GiftOptionsPopup();
giftOptionsTooltip.setTooltipWindow('giftoptions_tooltip_window','giftoptions_tooltip_window_content');
//]]>
window.giftMessageSet = giftMessageSet;
});
script;
    ?>
    <?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
<?php endif;?>
