<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
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;

/* user/stats.html.twig */
class __TwigTemplate_6d49ed059e379842aa161e1fb0bc2ba2ab9d750f01acd03f425720a2e2debc0f extends Template
{
    private $source;
    private $macros = [];

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

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

        $this->blocks = [
            'stylesheets' => [$this, 'block_stylesheets'],
            'head' => [$this, 'block_head'],
            'profile_content' => [$this, 'block_profile_content'],
        ];
    }

    protected function doGetParent(array $context)
    {
        // line 1
        return "user/layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 2
        $macros["widgets"] = $this->macros["widgets"] = $this->loadTemplate("macros/widgets.html.twig", "user/stats.html.twig", 2)->unwrap();
        // line 1
        $this->parent = $this->loadTemplate("user/layout.html.twig", "user/stats.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 4
    public function block_stylesheets($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 5
        echo "    ";
        $this->displayParentBlock("stylesheets", $context, $blocks);
        echo "
    ";
        // line 6
        echo $this->extensions['Symfony\WebpackEncoreBundle\Twig\EntryFilesTwigExtension']->renderWebpackLinkTags("chart");
        echo "
";
    }

    // line 9
    public function block_head($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 10
        echo "    ";
        $this->displayParentBlock("head", $context, $blocks);
        echo "
    ";
        // line 11
        echo $this->extensions['Symfony\WebpackEncoreBundle\Twig\EntryFilesTwigExtension']->renderWebpackScriptTags("chart");
        echo "
";
    }

    // line 14
    public function block_profile_content($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 15
        echo "
    ";
        // line 16
        if (twig_test_empty(($context["years"] ?? null))) {
            // line 17
            echo "        ";
            echo twig_call_macro($macros["widgets"], "macro_nothing_found", [], 17, $context, $this->getSourceContext());
            echo "
    ";
        }
        // line 19
        echo "
    <script type=\"text/javascript\">
        function userProfileChartOptions() {
            return {
                maintainAspectRatio: true,
                responsive: true,
                legend: false,
                barPercentage: 0.5,
                categoryPercentage: 0.9,
                scales: {
                    xAxes: [{
                        gridLines: {
                            display: false
                        }
                    }],
                    yAxes: [{
                        ticks: {
                            beginAtZero: true
                        },
                        gridLines: {
                            display: true,
                            color: '";
        // line 40
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["kimai_context"] ?? null), "chart", [], "any", false, false, false, 40), "grid_color", [], "any", false, false, false, 40), "html", null, true);
        echo "',
                            lineWidth: 1
                        }
                    }]
                },
                tooltips: {
                    callbacks: {
                        label: function(tooltipItem, data) {
                            return data.datasets[tooltipItem.datasetIndex].realData[tooltipItem.index];
                        }
                    }
                }";
        // line 52
        if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("view_reporting") && (0 === twig_compare(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "user", [], "any", false, false, false, 52), "id", [], "any", false, false, false, 52), twig_get_attribute($this->env, $this->source, ($context["user"] ?? null), "id", [], "any", false, false, false, 52)) || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("view_other_timesheet")))) {
            // line 53
            echo ",
                onClick: function(event, elements) {
                    var element = elements[0];
                    var month = this.data.datasets[0].monthData[element._index];
                    var formattedMonth = moment(month).format('";
            // line 57
            echo twig_escape_filter($this->env, ($context["stat_date_format"] ?? null), "html", null, true);
            echo "');
                    var reportUrl = '";
            // line 58
            echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("report_user_month", ["user" => twig_get_attribute($this->env, $this->source, ($context["user"] ?? null), "id", [], "any", false, false, false, 58), "date" => "XXXXX"]);
            echo "'.replace('XXXXX', formattedMonth);
                    document.location = reportUrl;
                }
            ";
        }
        // line 62
        echo "            };
        }
    </script>

    ";
        // line 66
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["years"] ?? null));
        $context['loop'] = [
          'parent' => $context['_parent'],
          'index0' => 0,
          'index'  => 1,
          'first'  => true,
        ];
        if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
            $length = count($context['_seq']);
            $context['loop']['revindex0'] = $length - 1;
            $context['loop']['revindex'] = $length;
            $context['loop']['length'] = $length;
            $context['loop']['last'] = 1 === $length;
        }
        foreach ($context['_seq'] as $context["year"] => $context["yearStat"]) {
            // line 67
            echo "
        ";
            // line 68
            $this->loadTemplate("user/stats.html.twig", "user/stats.html.twig", 68, "93871538")->display($context);
            // line 116
            echo "
    ";
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if (isset($context['loop']['length'])) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['year'], $context['yearStat'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 118
        echo "
";
    }

    public function getTemplateName()
    {
        return "user/stats.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  195 => 118,  180 => 116,  178 => 68,  175 => 67,  158 => 66,  152 => 62,  145 => 58,  141 => 57,  135 => 53,  133 => 52,  119 => 40,  96 => 19,  90 => 17,  88 => 16,  85 => 15,  81 => 14,  75 => 11,  70 => 10,  66 => 9,  60 => 6,  55 => 5,  51 => 4,  46 => 1,  44 => 2,  37 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "user/stats.html.twig", "/var/www/html/kimai2/templates/user/stats.html.twig");
    }
}


/* user/stats.html.twig */
class __TwigTemplate_6d49ed059e379842aa161e1fb0bc2ba2ab9d750f01acd03f425720a2e2debc0f___93871538 extends Template
{
    private $source;
    private $macros = [];

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

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

        $this->blocks = [
            'box_title' => [$this, 'block_box_title'],
            'box_body' => [$this, 'block_box_body'],
        ];
    }

    protected function doGetParent(array $context)
    {
        // line 68
        return "@AdminLTE/Widgets/box-widget.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        $this->parent = $this->loadTemplate("@AdminLTE/Widgets/box-widget.html.twig", "user/stats.html.twig", 68);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 69
    public function block_box_title($context, array $blocks = [])
    {
        $macros = $this->macros;
        echo twig_escape_filter($this->env, ($context["year"] ?? null), "html", null, true);
    }

    // line 70
    public function block_box_body($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 71
        echo "                <div class=\"chart\">
                    <canvas id=\"userProfileChart";
        // line 72
        echo twig_escape_filter($this->env, ($context["year"] ?? null), "html", null, true);
        echo "\" style=\"height: ";
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["kimai_context"] ?? null), "chart", [], "any", false, false, false, 72), "height", [], "any", false, false, false, 72), "html", null, true);
        echo "px;\"></canvas>
                </div>
                <script type=\"text/javascript\">
                    document.addEventListener('kimai.initialized', function() {
                        var userProfileChartData";
        // line 76
        echo twig_escape_filter($this->env, ($context["year"] ?? null), "html", null, true);
        echo " = {
                            labels: moment.months(),
                            datasets: [
                                {
                                    label: '";
        // line 80
        echo twig_escape_filter($this->env, ($context["year"] ?? null), "html", null, true);
        echo "',
                                    backgroundColor: '";
        // line 81
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["kimai_context"] ?? null), "chart", [], "any", false, false, false, 81), "background_color", [], "any", false, false, false, 81), "html", null, true);
        echo "',
                                    borderColor: '";
        // line 82
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["kimai_context"] ?? null), "chart", [], "any", false, false, false, 82), "border_color", [], "any", false, false, false, 82), "html", null, true);
        echo "',
                                    data: [
                                        ";
        // line 84
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, ($context["yearStat"] ?? null), "months", [], "any", false, false, false, 84));
        $context['loop'] = [
          'parent' => $context['_parent'],
          'index0' => 0,
          'index'  => 1,
          'first'  => true,
        ];
        if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
            $length = count($context['_seq']);
            $context['loop']['revindex0'] = $length - 1;
            $context['loop']['revindex'] = $length;
            $context['loop']['length'] = $length;
            $context['loop']['last'] = 1 === $length;
        }
        foreach ($context['_seq'] as $context["_key"] => $context["month"]) {
            // line 85
            echo "                                        ";
            echo twig_escape_filter($this->env, twig_number_format_filter($this->env, (twig_get_attribute($this->env, $this->source, $context["month"], "totalDuration", [], "any", false, false, false, 85) / 3600), 2, ".", ""), "html", null, true);
            echo "
                                        ";
            // line 86
            if ( !twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 86)) {
                echo ",";
            }
            // line 87
            echo "                                        ";
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if (isset($context['loop']['length'])) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['month'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 88
        echo "                                    ],
                                    realData: [
                                        ";
        // line 90
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, ($context["yearStat"] ?? null), "months", [], "any", false, false, false, 90));
        $context['loop'] = [
          'parent' => $context['_parent'],
          'index0' => 0,
          'index'  => 1,
          'first'  => true,
        ];
        if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
            $length = count($context['_seq']);
            $context['loop']['revindex0'] = $length - 1;
            $context['loop']['revindex'] = $length;
            $context['loop']['length'] = $length;
            $context['loop']['last'] = 1 === $length;
        }
        foreach ($context['_seq'] as $context["_key"] => $context["month"]) {
            // line 91
            echo "                                        '";
            echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->duration(twig_get_attribute($this->env, $this->source, $context["month"], "totalDuration", [], "any", false, false, false, 91)), "html", null, true);
            echo "'
                                        ";
            // line 92
            if ( !twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 92)) {
                echo ",";
            }
            // line 93
            echo "                                        ";
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if (isset($context['loop']['length'])) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['month'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 94
        echo "                                    ],
                                    monthData: [
                                        ";
        // line 96
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, ($context["yearStat"] ?? null), "months", [], "any", false, false, false, 96));
        $context['loop'] = [
          'parent' => $context['_parent'],
          'index0' => 0,
          'index'  => 1,
          'first'  => true,
        ];
        if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
            $length = count($context['_seq']);
            $context['loop']['revindex0'] = $length - 1;
            $context['loop']['revindex'] = $length;
            $context['loop']['length'] = $length;
            $context['loop']['last'] = 1 === $length;
        }
        foreach ($context['_seq'] as $context["_key"] => $context["month"]) {
            // line 97
            echo "                                        '";
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, ($context["yearStat"] ?? null), "year", [], "any", false, false, false, 97), "html", null, true);
            echo "-";
            echo twig_escape_filter($this->env, ((0 === twig_compare(twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, $context["month"], "month", [], "any", false, false, false, 97)), 1)) ? (("0" . twig_get_attribute($this->env, $this->source, $context["month"], "month", [], "any", false, false, false, 97))) : (twig_get_attribute($this->env, $this->source, $context["month"], "month", [], "any", false, false, false, 97))), "html", null, true);
            echo "-01'
                                        ";
            // line 98
            if ( !twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 98)) {
                echo ",";
            }
            // line 99
            echo "                                        ";
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if (isset($context['loop']['length'])) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['month'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 100
        echo "                                    ],
                                }
                            ]
                        };

                        var userProfileChart";
        // line 105
        echo twig_escape_filter($this->env, ($context["year"] ?? null), "html", null, true);
        echo " = new Chart(
                            \$(\"#userProfileChart";
        // line 106
        echo twig_escape_filter($this->env, ($context["year"] ?? null), "html", null, true);
        echo "\").get(0).getContext(\"2d\"), {
                                type: 'bar',
                                data: userProfileChartData";
        // line 108
        echo twig_escape_filter($this->env, ($context["year"] ?? null), "html", null, true);
        echo ",
                                options: userProfileChartOptions()
                            }
                        );
                    });
                </script>
            ";
    }

    public function getTemplateName()
    {
        return "user/stats.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  442 => 108,  437 => 106,  433 => 105,  426 => 100,  412 => 99,  408 => 98,  401 => 97,  384 => 96,  380 => 94,  366 => 93,  362 => 92,  357 => 91,  340 => 90,  336 => 88,  322 => 87,  318 => 86,  313 => 85,  296 => 84,  291 => 82,  287 => 81,  283 => 80,  276 => 76,  267 => 72,  264 => 71,  260 => 70,  253 => 69,  242 => 68,  195 => 118,  180 => 116,  178 => 68,  175 => 67,  158 => 66,  152 => 62,  145 => 58,  141 => 57,  135 => 53,  133 => 52,  119 => 40,  96 => 19,  90 => 17,  88 => 16,  85 => 15,  81 => 14,  75 => 11,  70 => 10,  66 => 9,  60 => 6,  55 => 5,  51 => 4,  46 => 1,  44 => 2,  37 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "user/stats.html.twig", "/var/www/html/kimai2/templates/user/stats.html.twig");
    }
}
