<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>
<?php
/** @var $block \Magento\Swatches\Block\Product\Renderer\Configurable */
/** @var \Magento\Swatches\ViewModel\Product\Renderer\Configurable $configurableViewModel */
$configurableViewModel = $block->getConfigurableViewModel();
$themeSettingConfig = $this->helper('MGS\ThemeSettings\Helper\Config');
?>
<div class="swatch-opt" data-role="swatch-options"></div>

<script type="text/x-magento-init">
    {
        "[data-role=swatch-options]": {
            "Magento_Swatches/js/swatch-renderer": {
                "jsonConfig": <?= /* @noEscape */ $swatchOptions = $block->getJsonConfig() ?>,
                "jsonSwatchConfig": <?= /* @noEscape */ $swatchOptions = $block->getJsonSwatchConfig() ?>,
                "mediaCallback": "<?= $block->escapeJs($block->escapeUrl($block->getMediaCallback())) ?>",
                "gallerySwitchStrategy": "<?= $block->escapeJs($block->getVar('gallery_switch_strategy', 'Magento_ConfigurableProduct')) ?: 'replace'; ?>",
                "jsonSwatchImageSizeConfig": <?= /* @noEscape */ $block->getJsonSwatchSizeConfig() ?>,
                "showTooltip": <?= $block->escapeJs($themeSettingConfig->getConfigShowTooltip()) ?>
            }
        },
        "*" : {
            "Magento_Swatches/js/catalog-add-to-cart": {}
        }
    }
</script>
