<?php
/**
 * Copyright 2014 Adobe
 * All Rights Reserved.
 */

/**
 * @var $block \Magento\Catalog\Block\Adminhtml\Category\Tree
 */
?>

<?php $divId = $block->escapeHtml('tree-div_' . time()) ?>
<div id="<?= /* @noEscape */ $divId ?>" class="tree"></div>

<script type="text/x-magento-init">
    {
        "*": {
            "categoryCheckboxTree": {
                "dataUrl":       "<?= $block->escapeUrl($block->getLoadTreeUrl()) ?>",
                "divId":         "<?= /* @noEscape */ $divId ?>",
                "rootVisible":   false,
                "useAjax":       <?= $block->escapeHtml($block->getUseAjax()) ?>,
                "currentNodeId": <?= (int)$block->getCategoryId() ?>,
                "jsFormObject":  "<?= /* @noEscape */ $block->getJsFormObject() ?>",
                "name":          "<?= $block->escapeHtml($block->getRoot()->getName()) ?>",
                "checked":       "<?= $block->escapeHtml($block->getRoot()->getChecked()) ?>",
                "allowdDrop":    <?= /* @noEscape */ $block->getRoot()->getIsVisible() ? 'true' : 'false' ?>,
                "rootId":        <?= (int)$block->getRoot()->getId() ?>,
                "expanded":      true,
                "categoryId":    <?= (int)$block->getCategoryId() ?>,
                "treeJson":      <?= /* @noEscape */ $block->getTreeJson() ?>
            }
        }
    }
</script>
