<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* @PimAnalytics/Update/last_patch.html.twig */
class __TwigTemplate_7e5eeb3296f525f6f86d3433d9be9ef1 extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 1
        if ($this->extensions['Akeneo\Platform\Bundle\AnalyticsBundle\Twig\UpdateExtension']->isLastPatchEnabled()) {
            // line 2
            yield "    <div class=\"AknFooter-item last-version\" style=\"display: none;\"><span>";
            yield Twig\Extension\EscaperExtension::escape($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("pim_analytics.new_patch_available"), "html", null, true);
            yield ":</span><span></span></div>

    <script type=\"text/javascript\" nonce=\"";
            // line 4
            yield Twig\Extension\EscaperExtension::escape($this->env, $this->extensions['Akeneo\Platform\Bundle\UIBundle\Twig\ContentSecurityPolicyExtension']->getScriptNonce(), "html", null, true);
            yield "\">
        require(
            ['jquery', 'pim/patch-fetcher'],
            function (\$, Fetcher) {
                \$(function() {
                    var updateServerUrl = '";
            // line 9
            yield Twig\Extension\EscaperExtension::escape($this->env, $this->extensions['Akeneo\Platform\Bundle\AnalyticsBundle\Twig\UpdateExtension']->getUpdateServerUrl(), "html", null, true);
            yield "';
                    Fetcher.fetch(updateServerUrl).then(function (patch) {
                        var currentVersionName = \$('.current-version:first span:last').text();
                        var currentVersion = currentVersionName.split(' ')[1];
                        if (patch !== null && currentVersion < patch) {
                            \$('.last-version span:last').text(patch);
                            \$('.last-version').show();
                        }
                    });
                });
            }
        );
    </script>
";
        }
        return; yield '';
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName()
    {
        return "@PimAnalytics/Update/last_patch.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable()
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo()
    {
        return array (  54 => 9,  46 => 4,  40 => 2,  38 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "@PimAnalytics/Update/last_patch.html.twig", "/var/www/html/pim/vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/AnalyticsBundle/Resources/views/Update/last_patch.html.twig");
    }
}
